17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 52b616c6cSwesolows * Common Development and Distribution License (the "License"). 62b616c6cSwesolows * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 212b616c6cSwesolows 227c478bd9Sstevel@tonic-gate /* 23*2c5124a1SPrashanth Sreenivasa * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gate #ifndef _SYS_ARCHSYSTM_H 287c478bd9Sstevel@tonic-gate #define _SYS_ARCHSYSTM_H 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate /* 317c478bd9Sstevel@tonic-gate * A selection of ISA-dependent interfaces 327c478bd9Sstevel@tonic-gate */ 337c478bd9Sstevel@tonic-gate 347c478bd9Sstevel@tonic-gate #ifdef __cplusplus 357c478bd9Sstevel@tonic-gate extern "C" { 367c478bd9Sstevel@tonic-gate #endif 377c478bd9Sstevel@tonic-gate 387c478bd9Sstevel@tonic-gate #if defined(_KERNEL) && !defined(_ASM) 397c478bd9Sstevel@tonic-gate 407c478bd9Sstevel@tonic-gate #include <sys/types.h> 417c478bd9Sstevel@tonic-gate #include <sys/regset.h> 427c478bd9Sstevel@tonic-gate #include <sys/model.h> 432b616c6cSwesolows #if defined(__GNUC__) && defined(_ASM_INLINES) 442b616c6cSwesolows #include <asm/flush.h> 452b616c6cSwesolows #endif 467c478bd9Sstevel@tonic-gate 477c478bd9Sstevel@tonic-gate extern greg_t getfp(void); 487c478bd9Sstevel@tonic-gate extern greg_t getpsr(void); 497c478bd9Sstevel@tonic-gate extern uint_t getpil(void); 507c478bd9Sstevel@tonic-gate extern void setpil(uint_t); 517c478bd9Sstevel@tonic-gate extern greg_t gettbr(void); 527c478bd9Sstevel@tonic-gate 537c478bd9Sstevel@tonic-gate extern uintptr_t shm_alignment; 547c478bd9Sstevel@tonic-gate 557c478bd9Sstevel@tonic-gate struct proc; 567c478bd9Sstevel@tonic-gate struct _klwp; 577c478bd9Sstevel@tonic-gate extern void xregrestore(struct _klwp *, int); 587c478bd9Sstevel@tonic-gate extern int copy_return_window(int); 597c478bd9Sstevel@tonic-gate 607c478bd9Sstevel@tonic-gate extern void setgwins(struct _klwp *, gwindows_t *); 617c478bd9Sstevel@tonic-gate extern void getgwins(struct _klwp *, gwindows_t *); 627c478bd9Sstevel@tonic-gate extern void setgwins32(struct _klwp *, gwindows32_t *); 637c478bd9Sstevel@tonic-gate extern void getgwins32(struct _klwp *, gwindows32_t *); 647c478bd9Sstevel@tonic-gate extern void setasrs(struct _klwp *, asrset_t); 657c478bd9Sstevel@tonic-gate extern void getasrs(struct _klwp *, asrset_t); 667c478bd9Sstevel@tonic-gate extern void setfpasrs(struct _klwp *, asrset_t); 677c478bd9Sstevel@tonic-gate extern void getfpasrs(struct _klwp *, asrset_t); 687c478bd9Sstevel@tonic-gate 697c478bd9Sstevel@tonic-gate extern void setgregs(struct _klwp *, gregset_t); 707c478bd9Sstevel@tonic-gate extern void getgregs(struct _klwp *, gregset_t); 717c478bd9Sstevel@tonic-gate extern void setfpregs(struct _klwp *, fpregset_t *); 727c478bd9Sstevel@tonic-gate extern void getfpregs(struct _klwp *, fpregset_t *); 737c478bd9Sstevel@tonic-gate 747c478bd9Sstevel@tonic-gate #ifdef _SYSCALL32_IMPL 757c478bd9Sstevel@tonic-gate extern void getgregs32(struct _klwp *, gregset32_t); 767c478bd9Sstevel@tonic-gate extern void setfpregs32(struct _klwp *, fpregset32_t *); 777c478bd9Sstevel@tonic-gate extern void getfpregs32(struct _klwp *, fpregset32_t *); 787c478bd9Sstevel@tonic-gate #endif 797c478bd9Sstevel@tonic-gate 807c478bd9Sstevel@tonic-gate extern void vac_flushall(void); 817c478bd9Sstevel@tonic-gate 827c478bd9Sstevel@tonic-gate extern void bind_hwcap(void); 837c478bd9Sstevel@tonic-gate 847c478bd9Sstevel@tonic-gate extern u_longlong_t gettick(void); 857c478bd9Sstevel@tonic-gate extern uint64_t gettick_counter(void); 867c478bd9Sstevel@tonic-gate extern int xcopyin_little(const void *, void *, size_t); 877c478bd9Sstevel@tonic-gate extern int xcopyout_little(const void *, void *, size_t); 88ae115bc7Smrj extern void xregs_getgfiller(struct _klwp *lwp, caddr_t xrp); 89ae115bc7Smrj extern void xregs_setgfiller(struct _klwp *lwp, caddr_t xrp); 90ae115bc7Smrj extern void xregs_getfpfiller(struct _klwp *lwp, caddr_t xrp); 91ae115bc7Smrj extern void xregs_setfpfiller(struct _klwp *lwp, caddr_t xrp); 927c478bd9Sstevel@tonic-gate 937c478bd9Sstevel@tonic-gate struct ucontext; 947c478bd9Sstevel@tonic-gate extern void xregs_clrptr(struct _klwp *, struct ucontext *); 957c478bd9Sstevel@tonic-gate extern int xregs_hasptr(struct _klwp *, struct ucontext *); 967c478bd9Sstevel@tonic-gate extern caddr_t xregs_getptr(struct _klwp *, struct ucontext *); 977c478bd9Sstevel@tonic-gate extern void xregs_setptr(struct _klwp *, struct ucontext *, caddr_t); 987c478bd9Sstevel@tonic-gate 997c478bd9Sstevel@tonic-gate #ifdef _SYSCALL32_IMPL 1007c478bd9Sstevel@tonic-gate struct ucontext32; 1017c478bd9Sstevel@tonic-gate extern void xregs_clrptr32(struct _klwp *, struct ucontext32 *); 1027c478bd9Sstevel@tonic-gate extern int xregs_hasptr32(struct _klwp *, struct ucontext32 *); 1037c478bd9Sstevel@tonic-gate extern caddr32_t xregs_getptr32(struct _klwp *, struct ucontext32 *); 1047c478bd9Sstevel@tonic-gate extern void xregs_setptr32(struct _klwp *, struct ucontext32 *, caddr32_t); 1057c478bd9Sstevel@tonic-gate #endif /* _SYSCALL32_IMPL */ 1067c478bd9Sstevel@tonic-gate 1077c478bd9Sstevel@tonic-gate extern void xregs_getgregs(struct _klwp *, caddr_t); 1087c478bd9Sstevel@tonic-gate extern void xregs_getfpregs(struct _klwp *, caddr_t); 1097c478bd9Sstevel@tonic-gate extern void xregs_get(struct _klwp *, caddr_t); 1107c478bd9Sstevel@tonic-gate extern void xregs_setgregs(struct _klwp *, caddr_t); 1117c478bd9Sstevel@tonic-gate extern void xregs_setfpregs(struct _klwp *, caddr_t); 1127c478bd9Sstevel@tonic-gate extern void xregs_set(struct _klwp *, caddr_t); 1137c478bd9Sstevel@tonic-gate extern int xregs_getsize(struct proc *); 1147c478bd9Sstevel@tonic-gate 1157c478bd9Sstevel@tonic-gate extern void doflush(void *); 1167c478bd9Sstevel@tonic-gate 1177c478bd9Sstevel@tonic-gate extern uint_t cpu_hwcap_flags; 1187c478bd9Sstevel@tonic-gate 119*2c5124a1SPrashanth Sreenivasa extern uint_t weakest_mem_model; 120*2c5124a1SPrashanth Sreenivasa 121ae115bc7Smrj #define cpr_dprintf prom_printf 122ae115bc7Smrj 1237c478bd9Sstevel@tonic-gate #endif /* _KERNEL && !_ASM */ 1247c478bd9Sstevel@tonic-gate 1257c478bd9Sstevel@tonic-gate 1267c478bd9Sstevel@tonic-gate #if defined(_KERNEL) 1277c478bd9Sstevel@tonic-gate 1287c478bd9Sstevel@tonic-gate /* 1297c478bd9Sstevel@tonic-gate * For binary compatability with SPARC/Solaris 1. Needed in the 1307c478bd9Sstevel@tonic-gate * sparc assembly files. 1317c478bd9Sstevel@tonic-gate */ 1327c478bd9Sstevel@tonic-gate #define OSYS_mmap 71 1337c478bd9Sstevel@tonic-gate 1347c478bd9Sstevel@tonic-gate #endif /* _KERNEL */ 1357c478bd9Sstevel@tonic-gate 1367c478bd9Sstevel@tonic-gate #ifdef __cplusplus 1377c478bd9Sstevel@tonic-gate } 1387c478bd9Sstevel@tonic-gate #endif 1397c478bd9Sstevel@tonic-gate 1407c478bd9Sstevel@tonic-gate #endif /* _SYS_ARCHSYSTM_H */ 141