Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/i386/include Remove the fields from 'struct save87'...



details:   https://anonhg.NetBSD.org/src/rev/f559dfde7d5c
branches:  trunk
changeset: 793321:f559dfde7d5c
user:      dsl <dsl%NetBSD.org@localhost>
date:      Tue Feb 04 22:21:35 2014 +0000

description:
Remove the fields from 'struct save87' and 'struct fxsave' that were used
  to save the control word and tag word on fp faults.
Nothing I could find looked at them before I removed the code that wrote them.
It might appear that these fields got exported to userspace (via mcontext),
  but that code carefully avoided those fields.
I've also deleted some very historic fields from the union inside __fpregset_t
  this doesn't affect its size.
The __fpregset_t fields are now the same size as the ones in the pcb.
Which is good because they get cast to each other in a few places.

diffstat:

 sys/arch/i386/include/mcontext.h |  14 +++++---------
 sys/arch/i386/include/npx.h      |  16 +++-------------
 2 files changed, 8 insertions(+), 22 deletions(-)

diffs (76 lines):

diff -r 9c24685a6a74 -r f559dfde7d5c sys/arch/i386/include/mcontext.h
--- a/sys/arch/i386/include/mcontext.h  Tue Feb 04 21:09:23 2014 +0000
+++ b/sys/arch/i386/include/mcontext.h  Tue Feb 04 22:21:35 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mcontext.h,v 1.10 2011/02/25 14:07:13 joerg Exp $      */
+/*     $NetBSD: mcontext.h,v 1.11 2014/02/04 22:21:35 dsl Exp $        */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -80,19 +80,15 @@
        union {
                struct {
                        int     __fp_state[27]; /* Environment and registers */
-                       int     __fp_status;    /* Software status word */
-               } __fpchip_state;
-               struct {
-                       char    __fp_emul[246];
-                       char    __fp_epad[2];
-               } __fp_emul_space;
+               } __fpchip_state;       /* x87 regs in fsave format */
                struct {
                        char    __fp_xmm[512];
-               } __fp_xmm_state;
+               } __fp_xmm_state;       /* x87 and xmm regs in fxsave format */
                int     __fp_fpregs[128];
        } __fp_reg_set;
-       long    __fp_wregs[33];                 /* Weitek? */
+       long    __fp_pad[33];                   /* Historic padding */
 } __fpregset_t;
+__CTASSERT(sizeof (__fpregset_t) == 512 + 33 * 4);
 
 typedef struct {
        __gregset_t     __gregs;
diff -r 9c24685a6a74 -r f559dfde7d5c sys/arch/i386/include/npx.h
--- a/sys/arch/i386/include/npx.h       Tue Feb 04 21:09:23 2014 +0000
+++ b/sys/arch/i386/include/npx.h       Tue Feb 04 22:21:35 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: npx.h,v 1.32 2014/01/26 19:16:17 dsl Exp $     */
+/*     $NetBSD: npx.h,v 1.33 2014/02/04 22:21:35 dsl Exp $     */
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -82,17 +82,10 @@
 #define s87_opcode s87_ip.fa_32.fa_opcode      /* opcode last executed (11bits) */
        union fp_addr   s87_dp;         /* floating operand offset */
        struct fpacc87  s87_ac[8];      /* accumulator contents, 0-7 */
-
-       /* Additional fields that are not part of the hardware definition */
-#ifndef dontdef
-       uint32_t        s87_ex_sw;      /* status word for last exception */
-       uint32_t        s87_ex_tw;      /* tag word for last exception */
-       uint8_t         s87_pad[8 * 2 - 2 * 4]; /* bogus historical padding */
-#endif
 };
 #ifndef __lint__
 // Has different packing semantics, adding packed to save87 works
-__CTASSERT(sizeof (struct save87) == 108 + 16);
+__CTASSERT(sizeof (struct save87) == 108);
 #endif
 
 /* SSE/SSE2 registers. */
@@ -114,13 +107,10 @@
        struct fpaccfx fx_87_ac[8];     /* 8 x87 registers */
        struct xmmreg sv_xmmregs[8];    /* XMM regs */
        uint8_t sv_rsvd[16 * 14];
-       /* 512-bytes --- end of hardware portion of save area */
-       uint32_t sv_ex_sw;              /* saved SW from last exception */
-       uint32_t sv_ex_tw;              /* saved TW from last exception */
 } __aligned(16);
 #ifndef __lint__
 // lint does not know aligned
-__CTASSERT(sizeof (struct fxsave) == 512 + 16);
+__CTASSERT(sizeof (struct fxsave) == 512);
 #endif
 
 



Home | Main Index | Thread Index | Old Index