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