xref: /titanic_41/usr/src/uts/sparc/sys/archsystm.h (revision abddfefb3168362a915cd681eb5a6498ec6c9e09)
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 2009 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 /*
31  * A selection of ISA-dependent interfaces
32  */
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 #if defined(_KERNEL) && !defined(_ASM)
39 
40 #include <sys/types.h>
41 #include <sys/regset.h>
42 #include <sys/model.h>
43 #if defined(__GNUC__) && defined(_ASM_INLINES)
44 #include <asm/flush.h>
45 #endif
46 
47 extern greg_t getfp(void);
48 extern greg_t getpsr(void);
49 extern uint_t getpil(void);
50 extern void setpil(uint_t);
51 extern greg_t gettbr(void);
52 extern void realsigprof(int, int);
53 
54 extern uintptr_t shm_alignment;
55 
56 struct proc;
57 struct _klwp;
58 extern void xregrestore(struct _klwp *, int);
59 extern int  copy_return_window(int);
60 
61 extern void setgwins(struct _klwp *, gwindows_t *);
62 extern void getgwins(struct _klwp *, gwindows_t *);
63 extern void setgwins32(struct _klwp *, gwindows32_t *);
64 extern void getgwins32(struct _klwp *, gwindows32_t *);
65 extern void setasrs(struct _klwp *, asrset_t);
66 extern void getasrs(struct _klwp *, asrset_t);
67 extern void setfpasrs(struct _klwp *, asrset_t);
68 extern void getfpasrs(struct _klwp *, asrset_t);
69 
70 extern void setgregs(struct _klwp *, gregset_t);
71 extern void getgregs(struct _klwp *, gregset_t);
72 extern void setfpregs(struct _klwp *, fpregset_t *);
73 extern void getfpregs(struct _klwp *, fpregset_t *);
74 
75 #ifdef _SYSCALL32_IMPL
76 extern void getgregs32(struct _klwp *, gregset32_t);
77 extern void setfpregs32(struct _klwp *, fpregset32_t *);
78 extern void getfpregs32(struct _klwp *, fpregset32_t *);
79 #endif
80 
81 extern void vac_flushall(void);
82 
83 extern void bind_hwcap(void);
84 
85 extern u_longlong_t gettick(void);
86 extern uint64_t	gettick_counter(void);
87 extern int xcopyin_little(const void *, void *, size_t);
88 extern int xcopyout_little(const void *, void *, size_t);
89 extern void xregs_getgfiller(struct _klwp *lwp, caddr_t xrp);
90 extern void xregs_setgfiller(struct _klwp *lwp, caddr_t xrp);
91 extern void xregs_getfpfiller(struct _klwp *lwp, caddr_t xrp);
92 extern void xregs_setfpfiller(struct _klwp *lwp, caddr_t xrp);
93 
94 struct ucontext;
95 extern	void	xregs_clrptr(struct _klwp *, struct ucontext *);
96 extern	int	xregs_hasptr(struct _klwp *, struct ucontext *);
97 extern	caddr_t	xregs_getptr(struct _klwp *, struct ucontext *);
98 extern	void	xregs_setptr(struct _klwp *, struct ucontext *, caddr_t);
99 
100 #ifdef _SYSCALL32_IMPL
101 struct	ucontext32;
102 extern	void	xregs_clrptr32(struct _klwp *, struct ucontext32 *);
103 extern	int	xregs_hasptr32(struct _klwp *, struct ucontext32 *);
104 extern	caddr32_t xregs_getptr32(struct _klwp *, struct ucontext32 *);
105 extern	void	xregs_setptr32(struct _klwp *, struct ucontext32 *, caddr32_t);
106 #endif /* _SYSCALL32_IMPL */
107 
108 extern	void	xregs_getgregs(struct _klwp *, caddr_t);
109 extern	void	xregs_getfpregs(struct _klwp *, caddr_t);
110 extern	void	xregs_get(struct _klwp *, caddr_t);
111 extern	void	xregs_setgregs(struct _klwp *, caddr_t);
112 extern	void	xregs_setfpregs(struct _klwp *, caddr_t);
113 extern	void	xregs_set(struct _klwp *, caddr_t);
114 extern	int	xregs_getsize(struct proc *);
115 
116 extern void doflush(void *);
117 
118 extern uint_t cpu_hwcap_flags;
119 
120 extern uint_t weakest_mem_model;
121 
122 #define	cpr_dprintf prom_printf
123 
124 #endif /* _KERNEL && !_ASM */
125 
126 
127 #if defined(_KERNEL)
128 
129 /*
130  * For binary compatability with SPARC/Solaris 1.  Needed in the
131  * sparc assembly files.
132  */
133 #define	OSYS_mmap	71
134 
135 #endif /* _KERNEL */
136 
137 #ifdef __cplusplus
138 }
139 #endif
140 
141 #endif	/* _SYS_ARCHSYSTM_H */
142