xref: /titanic_51/usr/src/uts/sparc/sys/archsystm.h (revision 69bb4bb45c98da60d21839c4dc3c01ea1be60585)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2005 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 #if defined(__GNUC__) && defined(_ASM_INLINES)
46 #include <asm/flush.h>
47 #endif
48 
49 extern greg_t getfp(void);
50 extern greg_t getpsr(void);
51 extern uint_t getpil(void);
52 extern void setpil(uint_t);
53 extern greg_t gettbr(void);
54 extern void realsigprof(int, int);
55 
56 extern uintptr_t shm_alignment;
57 
58 struct proc;
59 struct _klwp;
60 extern void xregrestore(struct _klwp *, int);
61 extern int  copy_return_window(int);
62 
63 extern void setgwins(struct _klwp *, gwindows_t *);
64 extern void getgwins(struct _klwp *, gwindows_t *);
65 extern void setgwins32(struct _klwp *, gwindows32_t *);
66 extern void getgwins32(struct _klwp *, gwindows32_t *);
67 extern void setasrs(struct _klwp *, asrset_t);
68 extern void getasrs(struct _klwp *, asrset_t);
69 extern void setfpasrs(struct _klwp *, asrset_t);
70 extern void getfpasrs(struct _klwp *, asrset_t);
71 
72 extern void setgregs(struct _klwp *, gregset_t);
73 extern void getgregs(struct _klwp *, gregset_t);
74 extern void setfpregs(struct _klwp *, fpregset_t *);
75 extern void getfpregs(struct _klwp *, fpregset_t *);
76 
77 #ifdef _SYSCALL32_IMPL
78 extern void getgregs32(struct _klwp *, gregset32_t);
79 extern void setfpregs32(struct _klwp *, fpregset32_t *);
80 extern void getfpregs32(struct _klwp *, fpregset32_t *);
81 #endif
82 
83 extern void vac_flushall(void);
84 
85 extern void bind_hwcap(void);
86 
87 extern u_longlong_t gettick(void);
88 extern uint64_t	gettick_counter(void);
89 extern int xcopyin_little(const void *, void *, size_t);
90 extern int xcopyout_little(const void *, void *, size_t);
91 extern void xregs_getgfiller(klwp_id_t lwp, caddr_t xrp);
92 extern void xregs_setgfiller(klwp_id_t lwp, caddr_t xrp);
93 extern void xregs_getfpfiller(klwp_id_t lwp, caddr_t xrp);
94 extern void xregs_setfpfiller(klwp_id_t lwp, caddr_t xrp);
95 
96 struct ucontext;
97 extern	void	xregs_clrptr(struct _klwp *, struct ucontext *);
98 extern	int	xregs_hasptr(struct _klwp *, struct ucontext *);
99 extern	caddr_t	xregs_getptr(struct _klwp *, struct ucontext *);
100 extern	void	xregs_setptr(struct _klwp *, struct ucontext *, caddr_t);
101 
102 #ifdef _SYSCALL32_IMPL
103 struct	ucontext32;
104 extern	void	xregs_clrptr32(struct _klwp *, struct ucontext32 *);
105 extern	int	xregs_hasptr32(struct _klwp *, struct ucontext32 *);
106 extern	caddr32_t xregs_getptr32(struct _klwp *, struct ucontext32 *);
107 extern	void	xregs_setptr32(struct _klwp *, struct ucontext32 *, caddr32_t);
108 #endif /* _SYSCALL32_IMPL */
109 
110 extern	void	xregs_getgregs(struct _klwp *, caddr_t);
111 extern	void	xregs_getfpregs(struct _klwp *, caddr_t);
112 extern	void	xregs_get(struct _klwp *, caddr_t);
113 extern	void	xregs_setgregs(struct _klwp *, caddr_t);
114 extern	void	xregs_setfpregs(struct _klwp *, caddr_t);
115 extern	void	xregs_set(struct _klwp *, caddr_t);
116 extern	int	xregs_getsize(struct proc *);
117 
118 extern void doflush(void *);
119 
120 extern uint_t cpu_hwcap_flags;
121 
122 #endif /* _KERNEL && !_ASM */
123 
124 
125 #if defined(_KERNEL)
126 
127 /*
128  * For binary compatability with SPARC/Solaris 1.  Needed in the
129  * sparc assembly files.
130  */
131 #define	OSYS_mmap	71
132 
133 #endif /* _KERNEL */
134 
135 #ifdef __cplusplus
136 }
137 #endif
138 
139 #endif	/* _SYS_ARCHSYSTM_H */
140