Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86_64/include Hand-align the fxsave area to be abl...



details:   https://anonhg.NetBSD.org/src/rev/70ff7de51123
branches:  trunk
changeset: 533825:70ff7de51123
user:      fvdl <fvdl%NetBSD.org@localhost>
date:      Wed Jul 10 01:54:00 2002 +0000

description:
Hand-align the fxsave area to be able to determine its offset in structures
more precisely.

diffstat:

 sys/arch/x86_64/include/fpu.h |  5 +++--
 sys/arch/x86_64/include/pcb.h |  8 ++++++--
 2 files changed, 9 insertions(+), 4 deletions(-)

diffs (56 lines):

diff -r 29ad1c8f47d4 -r 70ff7de51123 sys/arch/x86_64/include/fpu.h
--- a/sys/arch/x86_64/include/fpu.h     Wed Jul 10 01:22:42 2002 +0000
+++ b/sys/arch/x86_64/include/fpu.h     Wed Jul 10 01:54:00 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpu.h,v 1.4 2002/07/06 10:43:32 fvdl Exp $     */
+/*     $NetBSD: fpu.h,v 1.5 2002/07/10 01:54:00 fvdl Exp $     */
 
 #ifndef        _X86_64_FPU_H_
 #define        _X86_64_FPU_H_
@@ -7,6 +7,7 @@
  * NetBSD/x86_64 only uses the extended save/restore format used
  * by fxsave/fsrestore, to always deal with the SSE registers,
  * which are part of the ABI to pass floating point values.
+ * Must be stored in memory on a 16-byte boundary.
  */
 
 struct fxsave64 {
@@ -22,7 +23,7 @@
 /*BITFIELDTYPE*/ u_int64_t     fx_st[8 * 2];   /* 8 normal FP regs */
 /*BITFIELDTYPE*/ u_int64_t     fx_xmm[16 * 2]; /* 16 SSE2 registers */
 /*BITFIELDTYPE*/ u_int8_t      fx_unused3[96];
-} __attribute__ ((aligned (16)));
+};
 
 struct savefpu {
        struct fxsave64 fp_fxsave;      /* see above */
diff -r 29ad1c8f47d4 -r 70ff7de51123 sys/arch/x86_64/include/pcb.h
--- a/sys/arch/x86_64/include/pcb.h     Wed Jul 10 01:22:42 2002 +0000
+++ b/sys/arch/x86_64/include/pcb.h     Wed Jul 10 01:54:00 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pcb.h,v 1.4 2002/06/12 19:13:27 fvdl Exp $     */
+/*     $NetBSD: pcb.h,v 1.5 2002/07/10 01:54:00 fvdl Exp $     */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -90,6 +90,10 @@
 
 #define        NIOPORTS        1024            /* # of ports we allow to be mapped */
 
+/*
+ * Please note that the pcb_savefpu field in struct below must be
+ * on a 16-byte boundary.
+ */
 struct pcb {
        /*
         * XXXfvdl
@@ -105,8 +109,8 @@
        u_int64_t pcb_rbp;
        u_int64_t pcb_usersp;
        u_int64_t pcb_ldt_sel;
+       struct  savefpu pcb_savefpu;    /* floating point state */
        int     pcb_cr0;                /* saved image of CR0 */
-       struct  savefpu pcb_savefpu;    /* floating point state */
        int     pcb_flags;
 #define        PCB_USER_LDT    0x01            /* has user-set LDT */
        caddr_t pcb_onfault;            /* copyin/out fault recovery */



Home | Main Index | Thread Index | Old Index