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 */
32 * Essential struct definitions for mcontext_t needed by ucontext.h
33 * These were formerly in regset.h, which now includes this file.
36 #ifndef _SYS_MCONTEXT_H
37 #define _SYS_MCONTEXT_H
39 #include <sys/feature_tests.h>
42 #include <sys/types.h>
50 * A gregset_t is defined as an array type for compatibility with the reference
51 * source. This is important due to differences in the way the C language
52 * treats arrays and structures as parameters.
62 #if defined(_LP64) || defined(_I32LPx)
68 #if defined(_SYSCALL32)
70 typedef int32_t greg32_t
;
71 typedef int64_t greg64_t
;
73 #endif /* _SYSCALL32 */
75 typedef greg_t gregset_t
[_NGREG
];
77 #if defined(_SYSCALL32)
82 typedef greg32_t gregset32_t
[_NGREG32
];
83 typedef greg64_t gregset64_t
[_NGREG64
];
85 #endif /* _SYSCALL32 */
88 * Floating point definitions.
95 struct _fpchip_state
{
110 upad128_t __fx_ign2
[6];
111 uint32_t status
; /* sw at exception */
112 uint32_t xstatus
; /* mxcsr at exception */
114 uint32_t f_fpregs
[130];
121 * This definition of the floating point structure is binary
122 * compatible with the Intel386 psABI definition, and source
123 * compatible with that specification for x87-style floating point.
124 * It also allows SSE/SSE2 state to be accessed on machines that
125 * possess such hardware capabilities.
127 typedef struct _fpu
{
129 struct _fpchip_state
{
130 uint32_t state
[27]; /* 287/387 saved state */
131 uint32_t status
; /* saved at exception */
132 uint32_t mxcsr
; /* SSE control and status */
133 uint32_t xstatus
; /* SSE mxcsr at exception */
134 uint32_t __pad
[2]; /* align to 128-bits */
135 upad128_t xmm
[8]; /* %xmm0-%xmm7 */
137 struct _fp_emul_space
{ /* for emulator(s) */
138 uint8_t fp_emul
[246];
141 uint32_t f_fpregs
[95]; /* union of the above */
147 #if defined(_SYSCALL32)
149 /* Kernel view of user i386 fpu structure */
151 typedef struct fpu32
{
153 struct fpchip32_state
{
154 uint32_t state
[27]; /* 287/387 saved state */
155 uint32_t status
; /* saved at exception */
156 uint32_t mxcsr
; /* SSE control and status */
157 uint32_t xstatus
; /* SSE mxcsr at exception */
158 uint32_t __pad
[2]; /* align to 128-bits */
159 uint32_t xmm
[8][4]; /* %xmm0-%xmm7 */
161 uint32_t f_fpregs
[95]; /* union of the above */
165 #endif /* _SYSCALL32 */
168 * Structure mcontext defines the complete hardware machine state.
169 * (This structure is specified in the i386 ABI suppl.)
172 gregset_t gregs
; /* general register set */
173 fpregset_t fpregs
; /* floating point register set */
176 #if defined(_SYSCALL32)
179 gregset32_t gregs
; /* general register set */
180 fpregset32_t fpregs
; /* floating point register set */
183 #endif /* _SYSCALL32 */
191 #endif /* _SYS_MCONTEXT_H */