diff options
author | Gordon Ross <gwr@nexenta.com> | 2015-05-02 16:01:22 -0400 |
---|---|---|
committer | Gordon Ross <gwr@nexenta.com> | 2015-10-17 08:33:25 -0400 |
commit | 21227944c2bcc086121a5428f3f9d2496ba646f5 (patch) | |
tree | 148367c925007409bbc4e3778a61022681fac3ff /usr/src/uts/intel | |
parent | 6a72db4a7fa12c3e0d1c1cf91a07390739fa0fbf (diff) | |
download | illumos-joyent-21227944c2bcc086121a5428f3f9d2496ba646f5.tar.gz |
5876 sys/regset.h pollutes name space
Reviewed by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
Reviewed by: Jonathan Perkin <jperkin@joyent.com>
Reviewed by: Alexander Pyhalov <alp@sfedu.ru>
Approved by: Albert Lee <trisk@omniti.com>
Diffstat (limited to 'usr/src/uts/intel')
-rw-r--r-- | usr/src/uts/intel/ia32/os/archdep.c | 4 | ||||
-rw-r--r-- | usr/src/uts/intel/ia32/os/fpu.c | 2 | ||||
-rw-r--r-- | usr/src/uts/intel/sys/Makefile | 1 | ||||
-rw-r--r-- | usr/src/uts/intel/sys/fp.h | 90 | ||||
-rw-r--r-- | usr/src/uts/intel/sys/mcontext.h | 191 | ||||
-rw-r--r-- | usr/src/uts/intel/sys/pcb.h | 3 | ||||
-rw-r--r-- | usr/src/uts/intel/sys/procfs_isa.h | 6 | ||||
-rw-r--r-- | usr/src/uts/intel/sys/regset.h | 313 | ||||
-rw-r--r-- | usr/src/uts/intel/sys/ucontext.h | 4 |
9 files changed, 300 insertions, 314 deletions
diff --git a/usr/src/uts/intel/ia32/os/archdep.c b/usr/src/uts/intel/ia32/os/archdep.c index d83b16d673..2a33f306c2 100644 --- a/usr/src/uts/intel/ia32/os/archdep.c +++ b/usr/src/uts/intel/ia32/os/archdep.c @@ -193,7 +193,7 @@ fpregset_to_fxsave(const fpregset_t *fp, struct fxsave_state *fx) #if defined(__amd64) bcopy(fp, fx, sizeof (*fx)); #else - const struct fpchip_state *fc = &fp->fp_reg_set.fpchip_state; + const struct _fpchip_state *fc = &fp->fp_reg_set.fpchip_state; fnsave_to_fxsave((const struct fnsave_state *)fc, fx); fx->fx_mxcsr = fc->mxcsr; @@ -214,7 +214,7 @@ fxsave_to_fpregset(const struct fxsave_state *fx, fpregset_t *fp) #if defined(__amd64) bcopy(fx, fp, sizeof (*fx)); #else - struct fpchip_state *fc = &fp->fp_reg_set.fpchip_state; + struct _fpchip_state *fc = &fp->fp_reg_set.fpchip_state; fxsave_to_fnsave(fx, (struct fnsave_state *)fc); fc->mxcsr = fx->fx_mxcsr; diff --git a/usr/src/uts/intel/ia32/os/fpu.c b/usr/src/uts/intel/ia32/os/fpu.c index b7022cf0e5..dc3e286ad5 100644 --- a/usr/src/uts/intel/ia32/os/fpu.c +++ b/usr/src/uts/intel/ia32/os/fpu.c @@ -416,7 +416,7 @@ fpnoextflt(struct regs *rp) ASSERT(sizeof (struct xsave_state) >= AVX_XSAVE_SIZE); #if defined(__i386) - ASSERT(sizeof (struct fpu) == sizeof (struct __old_fpu)); + ASSERT(sizeof (struct _fpu) == sizeof (struct __old_fpu)); #endif /* __i386 */ #endif /* !__lint */ diff --git a/usr/src/uts/intel/sys/Makefile b/usr/src/uts/intel/sys/Makefile index 192ada41a5..5cfbdec4fc 100644 --- a/usr/src/uts/intel/sys/Makefile +++ b/usr/src/uts/intel/sys/Makefile @@ -56,6 +56,7 @@ HDRS = \ mc_intel.h \ mca_amd.h \ mca_x86.h \ + mcontext.h \ mutex_impl.h \ obpdefs.h \ old_procfs.h \ diff --git a/usr/src/uts/intel/sys/fp.h b/usr/src/uts/intel/sys/fp.h index 4956e2d318..3373484dec 100644 --- a/usr/src/uts/intel/sys/fp.h +++ b/usr/src/uts/intel/sys/fp.h @@ -19,6 +19,8 @@ * CDDL HEADER END */ /* + * Copyright 2015 Nexenta Systems, Inc. All rights reserved. + * * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved. */ @@ -168,6 +170,91 @@ extern "C" { "\20\20fz\17ru\16rd\15pm\14um\13om\12zm\11dm" \ "\10im\7daz\6pe\5ue\4oe\3ze\2de\1ie" +/* + * This structure is written to memory by an 'fnsave' instruction + */ +struct fnsave_state { + uint16_t f_fcw; + uint16_t __f_ign0; + uint16_t f_fsw; + uint16_t __f_ign1; + uint16_t f_ftw; + uint16_t __f_ign2; + uint32_t f_eip; + uint16_t f_cs; + uint16_t f_fop; + uint32_t f_dp; + uint16_t f_ds; + uint16_t __f_ign3; + union { + uint16_t fpr_16[5]; /* 80-bits of x87 state */ + } f_st[8]; +}; /* 108 bytes */ + +/* + * This structure is written to memory by an 'fxsave' instruction + * Note the variant behaviour of this instruction between long mode + * and legacy environments! + */ +struct fxsave_state { + uint16_t fx_fcw; + uint16_t fx_fsw; + uint16_t fx_fctw; /* compressed tag word */ + uint16_t fx_fop; +#if defined(__amd64) + uint64_t fx_rip; + uint64_t fx_rdp; +#else + uint32_t fx_eip; + uint16_t fx_cs; + uint16_t __fx_ign0; + uint32_t fx_dp; + uint16_t fx_ds; + uint16_t __fx_ign1; +#endif + uint32_t fx_mxcsr; + uint32_t fx_mxcsr_mask; + union { + uint16_t fpr_16[5]; /* 80-bits of x87 state */ + u_longlong_t fpr_mmx; /* 64-bit mmx register */ + uint32_t __fpr_pad[4]; /* (pad out to 128-bits) */ + } fx_st[8]; +#if defined(__amd64) + upad128_t fx_xmm[16]; /* 128-bit registers */ + upad128_t __fx_ign2[6]; +#else + upad128_t fx_xmm[8]; /* 128-bit registers */ + upad128_t __fx_ign2[14]; +#endif +}; /* 512 bytes */ + +/* + * This structure is written to memory by an 'xsave' instruction. + * First 512 byte is compatible with the format of an 'fxsave' area. + */ +struct xsave_state { + struct fxsave_state xs_fxsave; + uint64_t xs_xstate_bv; /* 512 */ + uint64_t xs_rsv_mbz[2]; + uint64_t xs_reserved[5]; + upad128_t xs_ymm[16]; /* avx - 576 */ +}; /* 832 bytes, asserted in fpnoextflt() */ + +/* + * Kernel's FPU save area + */ +typedef struct { + union _kfpu_u { + struct fxsave_state kfpu_fx; +#if defined(__i386) + struct fnsave_state kfpu_fn; +#endif + struct xsave_state kfpu_xs; + } kfpu_u; + uint32_t kfpu_status; /* saved at #mf exception */ + uint32_t kfpu_xstatus; /* saved at #xm exception */ +} kfpu_t; + extern int fp_kind; /* kind of fp support */ extern int fp_save_mech; /* fp save/restore mechanism */ extern int fpu_exists; /* FPU hw exists */ @@ -188,9 +275,6 @@ extern void fpxsave_ctxt(void *); extern void xsave_ctxt(void *); extern void (*fpsave_ctxt)(void *); -struct fnsave_state; -struct fxsave_state; -struct xsave_state; extern void fxsave_insn(struct fxsave_state *); extern void fpsave(struct fnsave_state *); extern void fprestore(struct fnsave_state *); diff --git a/usr/src/uts/intel/sys/mcontext.h b/usr/src/uts/intel/sys/mcontext.h new file mode 100644 index 0000000000..23d0aba364 --- /dev/null +++ b/usr/src/uts/intel/sys/mcontext.h @@ -0,0 +1,191 @@ +/* + * CDDL HEADER START + * + * The contents of this file are subject to the terms of the + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. + * + * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE + * or http://www.opensolaris.org/os/licensing. + * See the License for the specific language governing permissions + * and limitations under the License. + * + * When distributing Covered Code, include this CDDL HEADER in each + * file and include the License file at usr/src/OPENSOLARIS.LICENSE. + * If applicable, add the following below this CDDL HEADER, with the + * fields enclosed by brackets "[]" replaced with your own identifying + * information: Portions Copyright [yyyy] [name of copyright owner] + * + * CDDL HEADER END + */ +/* + * Copyright 2015 Nexenta Systems, Inc. All rights reserved. + * + * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved. + */ +/* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */ + +/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ +/* All Rights Reserved */ + +/* + * Essential struct definitions for mcontext_t needed by ucontext.h + * These were formerly in regset.h, which now includes this file. + */ + +#ifndef _SYS_MCONTEXT_H +#define _SYS_MCONTEXT_H + +#include <sys/feature_tests.h> + +#if !defined(_ASM) +#include <sys/types.h> +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * A gregset_t is defined as an array type for compatibility with the reference + * source. This is important due to differences in the way the C language + * treats arrays and structures as parameters. + */ +#if defined(__amd64) +#define _NGREG 28 +#else +#define _NGREG 19 +#endif + +#if !defined(_ASM) + +#if defined(_LP64) || defined(_I32LPx) +typedef long greg_t; +#else +typedef int greg_t; +#endif + +#if defined(_SYSCALL32) + +typedef int32_t greg32_t; +typedef int64_t greg64_t; + +#endif /* _SYSCALL32 */ + +typedef greg_t gregset_t[_NGREG]; + +#if defined(_SYSCALL32) + +#define _NGREG32 19 +#define _NGREG64 28 + +typedef greg32_t gregset32_t[_NGREG32]; +typedef greg64_t gregset64_t[_NGREG64]; + +#endif /* _SYSCALL32 */ + +/* + * Floating point definitions. + */ + +#if defined(__amd64) + +typedef struct _fpu { + union { + struct _fpchip_state { + uint16_t cw; + uint16_t sw; + uint8_t fctw; + uint8_t __fx_rsvd; + uint16_t fop; + uint64_t rip; + uint64_t rdp; + uint32_t mxcsr; + uint32_t mxcsr_mask; + union { + uint16_t fpr_16[5]; + upad128_t __fpr_pad; + } st[8]; + upad128_t xmm[16]; + upad128_t __fx_ign2[6]; + uint32_t status; /* sw at exception */ + uint32_t xstatus; /* mxcsr at exception */ + } fpchip_state; + uint32_t f_fpregs[130]; + } fp_reg_set; +} fpregset_t; + +#else /* __i386 */ + +/* + * This definition of the floating point structure is binary + * compatible with the Intel386 psABI definition, and source + * compatible with that specification for x87-style floating point. + * It also allows SSE/SSE2 state to be accessed on machines that + * possess such hardware capabilities. + */ +typedef struct _fpu { + union { + struct _fpchip_state { + uint32_t state[27]; /* 287/387 saved state */ + uint32_t status; /* saved at exception */ + uint32_t mxcsr; /* SSE control and status */ + uint32_t xstatus; /* SSE mxcsr at exception */ + uint32_t __pad[2]; /* align to 128-bits */ + upad128_t xmm[8]; /* %xmm0-%xmm7 */ + } fpchip_state; + struct _fp_emul_space { /* for emulator(s) */ + uint8_t fp_emul[246]; + uint8_t fp_epad[2]; + } fp_emul_space; + uint32_t f_fpregs[95]; /* union of the above */ + } fp_reg_set; +} fpregset_t; + +#endif /* __i386 */ + +#if defined(_SYSCALL32) + +/* Kernel view of user i386 fpu structure */ + +typedef struct fpu32 { + union { + struct fpchip32_state { + uint32_t state[27]; /* 287/387 saved state */ + uint32_t status; /* saved at exception */ + uint32_t mxcsr; /* SSE control and status */ + uint32_t xstatus; /* SSE mxcsr at exception */ + uint32_t __pad[2]; /* align to 128-bits */ + uint32_t xmm[8][4]; /* %xmm0-%xmm7 */ + } fpchip_state; + uint32_t f_fpregs[95]; /* union of the above */ + } fp_reg_set; +} fpregset32_t; + +#endif /* _SYSCALL32 */ + +/* + * Structure mcontext defines the complete hardware machine state. + * (This structure is specified in the i386 ABI suppl.) + */ +typedef struct { + gregset_t gregs; /* general register set */ + fpregset_t fpregs; /* floating point register set */ +} mcontext_t; + +#if defined(_SYSCALL32) + +typedef struct { + gregset32_t gregs; /* general register set */ + fpregset32_t fpregs; /* floating point register set */ +} mcontext32_t; + +#endif /* _SYSCALL32 */ + +#endif /* _ASM */ + +#ifdef __cplusplus +} +#endif + +#endif /* _SYS_MCONTEXT_H */ diff --git a/usr/src/uts/intel/sys/pcb.h b/usr/src/uts/intel/sys/pcb.h index 3a690bd980..defd116eba 100644 --- a/usr/src/uts/intel/sys/pcb.h +++ b/usr/src/uts/intel/sys/pcb.h @@ -28,6 +28,9 @@ #include <sys/regset.h> #include <sys/segments.h> +#ifndef _ASM +#include <sys/fp.h> /* kfpu_t */ +#endif #ifdef __cplusplus extern "C" { diff --git a/usr/src/uts/intel/sys/procfs_isa.h b/usr/src/uts/intel/sys/procfs_isa.h index b7a6cc3582..5af0386d9b 100644 --- a/usr/src/uts/intel/sys/procfs_isa.h +++ b/usr/src/uts/intel/sys/procfs_isa.h @@ -27,8 +27,6 @@ #ifndef _SYS_PROCFS_ISA_H #define _SYS_PROCFS_ISA_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Instruction Set Architecture specific component of <sys/procfs.h> * i386 version @@ -69,7 +67,7 @@ typedef uchar_t instr_t; #define NPRGREG _NGREG #define prgreg_t greg_t #define prgregset_t gregset_t -#define prfpregset fpu +#define prfpregset _fpu #define prfpregset_t fpregset_t #if defined(_SYSCALL32) @@ -87,7 +85,7 @@ typedef uchar_t instr32_t; #define NPRGREG32 _NGREG #define prgreg32_t greg_t #define prgregset32_t gregset_t -#define prfpregset32 fpu +#define prfpregset32 _fpu #define prfpregset32_t fpregset_t #endif #endif /* _SYSCALL32 */ diff --git a/usr/src/uts/intel/sys/regset.h b/usr/src/uts/intel/sys/regset.h index 5436ae0be3..12b8f9e888 100644 --- a/usr/src/uts/intel/sys/regset.h +++ b/usr/src/uts/intel/sys/regset.h @@ -19,6 +19,8 @@ * CDDL HEADER END */ /* + * Copyright 2015 Nexenta Systems, Inc. All rights reserved. + * * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved. */ /* Copyright (c) 1990, 1991 UNIX System Laboratories, Inc. */ @@ -34,13 +36,12 @@ #if !defined(_ASM) #include <sys/types.h> #endif +#include <sys/mcontext.h> #ifdef __cplusplus extern "C" { #endif -#if !defined(_XPG4_2) || defined(__EXTENSIONS__) - /* * The names and offsets defined here should be specified by the * AMD64 ABI suppl. @@ -134,181 +135,16 @@ extern "C" { #endif /* __i386 */ -#endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */ - -/* - * A gregset_t is defined as an array type for compatibility with the reference - * source. This is important due to differences in the way the C language - * treats arrays and structures as parameters. - */ -#if defined(__amd64) -#define _NGREG 28 -#else -#define _NGREG 19 -#endif -#if !defined(_XPG4_2) || defined(__EXTENSIONS__) #define NGREG _NGREG -#endif #if !defined(_ASM) -#if defined(_LP64) || defined(_I32LPx) -typedef long greg_t; -#else -typedef int greg_t; -#endif - -#if defined(_SYSCALL32) - -typedef int32_t greg32_t; -typedef int64_t greg64_t; - -#endif /* _SYSCALL32 */ - -typedef greg_t gregset_t[_NGREG]; - -#if defined(_SYSCALL32) - -#define _NGREG32 19 -#define _NGREG64 28 - -typedef greg32_t gregset32_t[_NGREG32]; -typedef greg64_t gregset64_t[_NGREG64]; - -#endif /* _SYSCALL32 */ - -#if !defined(_XPG4_2) || defined(__EXTENSIONS__) - -/* - * Floating point definitions. - */ - -/* - * This structure is written to memory by an 'fnsave' instruction - */ -struct fnsave_state { - uint16_t f_fcw; - uint16_t __f_ign0; - uint16_t f_fsw; - uint16_t __f_ign1; - uint16_t f_ftw; - uint16_t __f_ign2; - uint32_t f_eip; - uint16_t f_cs; - uint16_t f_fop; - uint32_t f_dp; - uint16_t f_ds; - uint16_t __f_ign3; - union { - uint16_t fpr_16[5]; /* 80-bits of x87 state */ - } f_st[8]; -}; /* 108 bytes */ - -/* - * This structure is written to memory by an 'fxsave' instruction - * Note the variant behaviour of this instruction between long mode - * and legacy environments! - */ -struct fxsave_state { - uint16_t fx_fcw; - uint16_t fx_fsw; - uint16_t fx_fctw; /* compressed tag word */ - uint16_t fx_fop; -#if defined(__amd64) - uint64_t fx_rip; - uint64_t fx_rdp; -#else - uint32_t fx_eip; - uint16_t fx_cs; - uint16_t __fx_ign0; - uint32_t fx_dp; - uint16_t fx_ds; - uint16_t __fx_ign1; -#endif - uint32_t fx_mxcsr; - uint32_t fx_mxcsr_mask; - union { - uint16_t fpr_16[5]; /* 80-bits of x87 state */ - u_longlong_t fpr_mmx; /* 64-bit mmx register */ - uint32_t __fpr_pad[4]; /* (pad out to 128-bits) */ - } fx_st[8]; -#if defined(__amd64) - upad128_t fx_xmm[16]; /* 128-bit registers */ - upad128_t __fx_ign2[6]; -#else - upad128_t fx_xmm[8]; /* 128-bit registers */ - upad128_t __fx_ign2[14]; -#endif -}; /* 512 bytes */ - -/* - * This structure is written to memory by an 'xsave' instruction. - * First 512 byte is compatible with the format of an 'fxsave' area. - */ -struct xsave_state { - struct fxsave_state xs_fxsave; - uint64_t xs_xstate_bv; /* 512 */ - uint64_t xs_rsv_mbz[2]; - uint64_t xs_reserved[5]; - upad128_t xs_ymm[16]; /* avx - 576 */ -}; /* 832 bytes, asserted in fpnoextflt() */ - -#if defined(__amd64) - -typedef struct fpu { - union { - struct fpchip_state { - uint16_t cw; - uint16_t sw; - uint8_t fctw; - uint8_t __fx_rsvd; - uint16_t fop; - uint64_t rip; - uint64_t rdp; - uint32_t mxcsr; - uint32_t mxcsr_mask; - union { - uint16_t fpr_16[5]; - upad128_t __fpr_pad; - } st[8]; - upad128_t xmm[16]; - upad128_t __fx_ign2[6]; - uint32_t status; /* sw at exception */ - uint32_t xstatus; /* mxcsr at exception */ - } fpchip_state; - uint32_t f_fpregs[130]; - } fp_reg_set; -} fpregset_t; - -#else /* __i386 */ - -/* - * This definition of the floating point structure is binary - * compatible with the Intel386 psABI definition, and source - * compatible with that specification for x87-style floating point. - * It also allows SSE/SSE2 state to be accessed on machines that - * possess such hardware capabilities. - */ -typedef struct fpu { - union { - struct fpchip_state { - uint32_t state[27]; /* 287/387 saved state */ - uint32_t status; /* saved at exception */ - uint32_t mxcsr; /* SSE control and status */ - uint32_t xstatus; /* SSE mxcsr at exception */ - uint32_t __pad[2]; /* align to 128-bits */ - upad128_t xmm[8]; /* %xmm0-%xmm7 */ - } fpchip_state; - struct fp_emul_space { /* for emulator(s) */ - uint8_t fp_emul[246]; - uint8_t fp_epad[2]; - } fp_emul_space; - uint32_t f_fpregs[95]; /* union of the above */ - } fp_reg_set; -} fpregset_t; - +#ifdef __i386 /* * (This structure definition is specified in the i386 ABI supplement) + * It's likely we can just get rid of the struct __old_fpu or maybe + * move it to $SRC/uts/intel/ia32/os/fpu.c which appears to be the + * only place that uses it. See: www.illumos.org/issues/6284 */ typedef struct __old_fpu { union { @@ -327,74 +163,19 @@ typedef struct __old_fpu { } fp_reg_set; long f_wregs[33]; /* saved weitek state */ } __old_fpregset_t; - #endif /* __i386 */ -#if defined(_SYSCALL32) - -/* Kernel view of user i386 fpu structure */ - -typedef struct fpu32 { - union { - struct fpchip32_state { - uint32_t state[27]; /* 287/387 saved state */ - uint32_t status; /* saved at exception */ - uint32_t mxcsr; /* SSE control and status */ - uint32_t xstatus; /* SSE mxcsr at exception */ - uint32_t __pad[2]; /* align to 128-bits */ - uint32_t xmm[8][4]; /* %xmm0-%xmm7 */ - } fpchip_state; - uint32_t f_fpregs[95]; /* union of the above */ - } fp_reg_set; -} fpregset32_t; - -#endif /* _SYSCALL32 */ - -/* - * Kernel's FPU save area - */ -typedef struct { - union _kfpu_u { - struct fxsave_state kfpu_fx; -#if defined(__i386) - struct fnsave_state kfpu_fn; -#endif - struct xsave_state kfpu_xs; - } kfpu_u; - uint32_t kfpu_status; /* saved at #mf exception */ - uint32_t kfpu_xstatus; /* saved at #xm exception */ -} kfpu_t; - #if defined(__amd64) -#define NDEBUGREG 16 +#define _NDEBUGREG 16 #else -#define NDEBUGREG 8 +#define _NDEBUGREG 8 #endif typedef struct dbregset { - unsigned long debugreg[NDEBUGREG]; + unsigned long debugreg[_NDEBUGREG]; } dbregset_t; -/* - * Structure mcontext defines the complete hardware machine state. - * (This structure is specified in the i386 ABI suppl.) - */ -typedef struct { - gregset_t gregs; /* general register set */ - fpregset_t fpregs; /* floating point register set */ -} mcontext_t; - -#if defined(_SYSCALL32) - -typedef struct { - gregset32_t gregs; /* general register set */ - fpregset32_t fpregs; /* floating point register set */ -} mcontext32_t; - -#endif /* _SYSCALL32 */ - #endif /* _ASM */ -#endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */ /* * The version of privregs.h that is used on implementations that run on @@ -420,80 +201,6 @@ typedef struct { #include <sys/privregs.h> #endif /* __i386 (!_KERNEL && !_XPG4_2 || __EXTENSIONS__) */ -/* - * The following is here for XPG4.2 standards compliance. - * regset.h is included in ucontext.h for the definition of - * mcontext_t, all of which breaks XPG4.2 namespace. - */ - -#if defined(_XPG4_2) && !defined(__EXTENSIONS__) && !defined(_ASM) - -/* - * The following is here for UNIX 95 compliance (XPG Issue 4, Version 2 - * System Interfaces and Headers). The structures included here are identical - * to those visible elsewhere in this header except that the structure - * element names have been changed in accordance with the X/Open namespace - * rules. Specifically, depending on the name and scope, the names have - * been prepended with a single or double underscore (_ or __). See the - * structure definitions in the non-X/Open namespace for more detailed - * comments describing each of these structures. - */ - -#if defined(__amd64) - -typedef struct __fpu { - union { - struct __fpchip_state { - uint16_t __fx_cw; - uint16_t __fx_sw; - uint16_t __fx_ctw; - uint16_t __fx_op; - uint64_t __fx_rip; - uint64_t __fx_rdp; - uint32_t __fx_mxcsr; - uint32_t __fx_mxcsr_mask; - union { - uint16_t __fpr_16[5]; - upad128_t __fpr_pad; - } __fx_st[8]; - upad128_t __fx_xmm[16]; - upad128_t __fx_ign2[6]; - uint32_t __status; - uint32_t __xstatus; - } __fpchip_state; - uint32_t __f_fpregs[130]; - } __fp_reg_set; -} fpregset_t; - -#else /* __i386 */ - -typedef struct __fpu { - union { - struct __fpchip_state { - uint32_t __state[27]; /* 287/387 saved state */ - uint32_t __status; /* saved at exception */ - uint32_t __mxcsr; /* SSE control and status */ - uint32_t __xstatus; /* SSE mxcsr at exception */ - uint32_t __pad[2]; /* align to 128-bits */ - upad128_t __xmm[8]; /* %xmm0-%xmm7 */ - } __fpchip_state; - struct __fp_emul_space { /* for emulator(s) */ - uint8_t __fp_emul[246]; - uint8_t __fp_epad[2]; - } __fp_emul_space; - uint32_t __f_fpregs[95]; /* union of the above */ - } __fp_reg_set; -} fpregset_t; - -#endif /* __i386 */ - -typedef struct { - gregset_t __gregs; /* general register set */ - fpregset_t __fpregs; /* floating point register set */ -} mcontext_t; - -#endif /* _XPG4_2 && !__EXTENSIONS__ && !_ASM */ - #ifdef __cplusplus } #endif diff --git a/usr/src/uts/intel/sys/ucontext.h b/usr/src/uts/intel/sys/ucontext.h index acd6ddc99e..5f64fa9393 100644 --- a/usr/src/uts/intel/sys/ucontext.h +++ b/usr/src/uts/intel/sys/ucontext.h @@ -20,6 +20,8 @@ */ /* + * Copyright 2015 Nexenta Systems, Inc. All rights reserved. + * * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -33,7 +35,7 @@ #include <sys/feature_tests.h> #include <sys/types.h> -#include <sys/regset.h> +#include <sys/mcontext.h> #if !defined(_XPG4_2) || defined(__EXTENSIONS__) #include <sys/signal.h> #endif |