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.
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.
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]
21 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
22 /* All Rights Reserved */
26 * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
28 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
29 * Use is subject to license terms.
35 #include <sys/feature_tests.h>
38 #include <sys/int_types.h>
40 #include <sys/mcontext.h>
47 * Location of the users' stored registers relative to R0.
48 * Usage is as an index into a gregset_t array or as u.u_ar0[XX].
50 #if defined(__sparcv9)
52 #if defined(_SYSCALL32)
54 #endif /* _SYSCALL32 */
57 #endif /* __sparcv9 */
77 #if defined(__sparcv9)
80 #endif /* __sparcv9 */
82 /* the following defines are for portability */
83 #if !defined(__sparcv9)
84 #define REG_PS REG_PSR
85 #endif /* __sparcv9 */
93 #define MAXFPQ _MAXFPQ
96 * The following structures define how a register window can appear on the
97 * stack. This structure is available (when required) through the `gwins'
98 * field of an mcontext (nested within ucontext). SPARC_MAXWINDOW is the
99 * maximum number of outstanding regiters window defined in the SPARC
100 * architecture (*not* implementation).
102 #define SPARC_MAXREGWINDOW 31 /* max windows in SPARC arch. */
105 greg_t rw_local
[8]; /* locals */
106 greg_t rw_in
[8]; /* ins */
109 #if defined(_SYSCALL32)
112 greg32_t rw_local
[8]; /* locals */
113 greg32_t rw_in
[8]; /* ins */
117 greg64_t rw_local
[8]; /* locals */
118 greg64_t rw_in
[8]; /* ins */
122 extern void rwindow_nto32(struct rwindow
*, struct rwindow32
*);
123 extern void rwindow_32ton(struct rwindow32
*, struct rwindow
*);
126 #endif /* _SYSCALL32 */
128 #define rw_fp rw_in[6] /* frame pointer */
129 #define rw_rtn rw_in[7] /* return address */
131 typedef struct _gwindows
{
133 greg_t
*spbuf
[SPARC_MAXREGWINDOW
];
134 struct rwindow wbuf
[SPARC_MAXREGWINDOW
];
137 #if defined(_SYSCALL32)
139 typedef struct gwindows32
{
141 caddr32_t spbuf
[SPARC_MAXREGWINDOW
];
142 struct rwindow32 wbuf
[SPARC_MAXREGWINDOW
];
145 typedef struct gwindows64
{
147 greg64_t
*spbuf
[SPARC_MAXREGWINDOW
];
148 struct rwindow64 wbuf
[SPARC_MAXREGWINDOW
];
151 #endif /* _SYSCALL32 */
154 * The following #define's are obsolete and may be removed in a future release.
155 * The corresponding integer types should be used instead (i.e. uint64_t).
157 #define FPU_REGS_TYPE uint32_t
158 #define FPU_DREGS_TYPE uint64_t
159 #define V7_FPU_FSR_TYPE uint32_t
160 #define V9_FPU_FSR_TYPE uint64_t
161 #define V9_FPU_FPRS_TYPE uint32_t
163 #define XRS_ID _XRS_ID
168 * The version of privregs.h that is used on implementations that run
169 * on processors that support the V9 instruction set is deliberately not
172 * The V9 'struct regs' definition is -not- compatible with either 32-bit
173 * or 64-bit core file contents, nor with the ucontext. As a result, the
174 * 'regs' structure cannot be used portably by applications, and should
175 * only be used by the kernel implementation.
177 * The inclusion of the SPARC V7 version of privregs.h allows for some
178 * limited source compatibility with 32-bit applications who expect to use
179 * 'struct regs' to match the content of a 32-bit core file, or a ucontext_t.
181 * Note that the ucontext_t actually describes the general registers in
182 * terms of the gregset_t data type, as described in mcontex.h. Note also
183 * that the core file content is defined by core(4) in terms of data types
184 * defined by procfs -- see proc(4).
186 #if !defined(__sparcv9)
187 #if !defined(_KERNEL) && !defined(_XPG4_2) || defined(__EXTENSIONS__)
188 #include <v7/sys/privregs.h>
189 #endif /* !_KERNEL && !_XPG4_2 || __EXTENSIONS__ */
190 #endif /* __sparcv9 */
196 #endif /* _SYS_REGSET_H */