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]
22 * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
24 * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
26 /* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */
28 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
29 /* All Rights Reserved */
34 #include <sys/feature_tests.h>
37 #include <sys/types.h>
39 #include <sys/mcontext.h>
46 * The names and offsets defined here should be specified by the
49 * We make fsbase and gsbase part of the lwp context (since they're
50 * the only way to access the full 64-bit address range via the segment
51 * registers) and thus belong here too. However we treat them as
52 * read-only; if %fs or %gs are updated, the results of the descriptor
53 * table lookup that those updates implicitly cause will be reflected
54 * in the corresponding fsbase and/or gsbase values the next time the
55 * context can be inspected. However it is NOT possible to override
56 * the fsbase/gsbase settings via this interface.
58 * Direct modification of the base registers (thus overriding the
59 * descriptor table base address) can be achieved with _lwp_setprivate.
93 * The names and offsets defined here are specified by i386 ABI suppl.
96 #define SS 18 /* only stored on a privilege transition */
97 #define UESP 17 /* only stored on a privilege transition */
116 /* aliases for portability */
120 #define REG_PC REG_RIP
121 #define REG_FP REG_RBP
122 #define REG_SP REG_RSP
123 #define REG_PS REG_RFL
124 #define REG_R0 REG_RAX
125 #define REG_R1 REG_RDX
144 * (This structure definition is specified in the i386 ABI supplement)
145 * It's likely we can just get rid of the struct __old_fpu or maybe
146 * move it to $SRC/uts/intel/ia32/os/fpu.c which appears to be the
147 * only place that uses it. See: www.illumos.org/issues/6284
149 typedef struct __old_fpu
{
151 struct __old_fpchip_state
/* fp extension state */
153 int state
[27]; /* 287/387 saved state */
154 int status
; /* status word saved at */
157 struct __old_fp_emul_space
/* for emulator(s) */
162 int f_fpregs
[62]; /* union of the above */
164 long f_wregs
[33]; /* saved weitek state */
169 #define _NDEBUGREG 16
174 typedef struct dbregset
{
175 unsigned long debugreg
[_NDEBUGREG
];
181 * The version of privregs.h that is used on implementations that run on
182 * processors that support the AMD64 instruction set is deliberately not
185 * The amd64 'struct regs' definition may -not- compatible with either
186 * 32-bit or 64-bit core file contents, nor with the ucontext. As a result,
187 * the 'regs' structure cannot be used portably by applications, and should
188 * only be used by the kernel implementation.
190 * The inclusion of the i386 version of privregs.h allows for some limited
191 * source compatibility with 32-bit applications who expect to use
192 * 'struct regs' to match the context of a 32-bit core file, or a ucontext_t.
194 * Note that the ucontext_t actually describes the general register in terms
195 * of the gregset_t data type, as described in this file. Note also
196 * that the core file content is defined by core(4) in terms of data types
197 * defined by procfs -- see proc(4).
199 #if defined(__i386) && \
200 (!defined(_KERNEL) && !defined(_XPG4_2) || defined(__EXTENSIONS__))
201 #include <sys/privregs.h>
202 #endif /* __i386 (!_KERNEL && !_XPG4_2 || __EXTENSIONS__) */
208 #endif /* _SYS_REGSET_H */