1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22 /* 23 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27 #ifndef _SYS_ARCHSYSTM_H 28 #define _SYS_ARCHSYSTM_H 29 30 #pragma ident "%Z%%M% %I% %E% SMI" 31 32 /* 33 * A selection of ISA-dependent interfaces 34 */ 35 36 #ifdef __cplusplus 37 extern "C" { 38 #endif 39 40 #if defined(_KERNEL) && !defined(_ASM) 41 42 #include <sys/types.h> 43 #include <sys/regset.h> 44 #include <sys/model.h> 45 46 extern greg_t getfp(void); 47 extern greg_t getpsr(void); 48 extern uint_t getpil(void); 49 extern void setpil(uint_t); 50 extern greg_t gettbr(void); 51 extern void realsigprof(int, int); 52 53 extern uintptr_t shm_alignment; 54 55 struct proc; 56 struct _klwp; 57 extern void xregrestore(struct _klwp *, int); 58 extern int copy_return_window(int); 59 60 extern void setgwins(struct _klwp *, gwindows_t *); 61 extern void getgwins(struct _klwp *, gwindows_t *); 62 extern void setgwins32(struct _klwp *, gwindows32_t *); 63 extern void getgwins32(struct _klwp *, gwindows32_t *); 64 extern void setasrs(struct _klwp *, asrset_t); 65 extern void getasrs(struct _klwp *, asrset_t); 66 extern void setfpasrs(struct _klwp *, asrset_t); 67 extern void getfpasrs(struct _klwp *, asrset_t); 68 69 extern void setgregs(struct _klwp *, gregset_t); 70 extern void getgregs(struct _klwp *, gregset_t); 71 extern void setfpregs(struct _klwp *, fpregset_t *); 72 extern void getfpregs(struct _klwp *, fpregset_t *); 73 74 #ifdef _SYSCALL32_IMPL 75 extern void getgregs32(struct _klwp *, gregset32_t); 76 extern void setfpregs32(struct _klwp *, fpregset32_t *); 77 extern void getfpregs32(struct _klwp *, fpregset32_t *); 78 #endif 79 80 extern void vac_flushall(void); 81 82 extern void bind_hwcap(void); 83 84 extern u_longlong_t gettick(void); 85 extern uint64_t gettick_counter(void); 86 extern int xcopyin_little(const void *, void *, size_t); 87 extern int xcopyout_little(const void *, void *, size_t); 88 extern void xregs_getgfiller(klwp_id_t lwp, caddr_t xrp); 89 extern void xregs_setgfiller(klwp_id_t lwp, caddr_t xrp); 90 extern void xregs_getfpfiller(klwp_id_t lwp, caddr_t xrp); 91 extern void xregs_setfpfiller(klwp_id_t lwp, caddr_t xrp); 92 93 struct ucontext; 94 extern void xregs_clrptr(struct _klwp *, struct ucontext *); 95 extern int xregs_hasptr(struct _klwp *, struct ucontext *); 96 extern caddr_t xregs_getptr(struct _klwp *, struct ucontext *); 97 extern void xregs_setptr(struct _klwp *, struct ucontext *, caddr_t); 98 99 #ifdef _SYSCALL32_IMPL 100 struct ucontext32; 101 extern void xregs_clrptr32(struct _klwp *, struct ucontext32 *); 102 extern int xregs_hasptr32(struct _klwp *, struct ucontext32 *); 103 extern caddr32_t xregs_getptr32(struct _klwp *, struct ucontext32 *); 104 extern void xregs_setptr32(struct _klwp *, struct ucontext32 *, caddr32_t); 105 #endif /* _SYSCALL32_IMPL */ 106 107 extern void xregs_getgregs(struct _klwp *, caddr_t); 108 extern void xregs_getfpregs(struct _klwp *, caddr_t); 109 extern void xregs_get(struct _klwp *, caddr_t); 110 extern void xregs_setgregs(struct _klwp *, caddr_t); 111 extern void xregs_setfpregs(struct _klwp *, caddr_t); 112 extern void xregs_set(struct _klwp *, caddr_t); 113 extern int xregs_getsize(struct proc *); 114 115 extern void doflush(void *); 116 117 extern uint_t cpu_hwcap_flags; 118 119 #endif /* _KERNEL && !_ASM */ 120 121 122 #if defined(_KERNEL) 123 124 /* 125 * For binary compatability with SPARC/Solaris 1. Needed in the 126 * sparc assembly files. 127 */ 128 #define OSYS_mmap 71 129 130 #endif /* _KERNEL */ 131 132 #ifdef __cplusplus 133 } 134 #endif 135 136 #endif /* _SYS_ARCHSYSTM_H */ 137