Source-Changes-HG archive

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

[src/trunk]: src/sys The MDP_USEDFPU (amd64 and sh3) and MDP_SSTEP (sh3) are ...



details:   https://anonhg.NetBSD.org/src/rev/019ccd69abe6
branches:  trunk
changeset: 780039:019ccd69abe6
user:      dsl <dsl%NetBSD.org@localhost>
date:      Sun Jul 08 20:14:11 2012 +0000

description:
The MDP_USEDFPU (amd64 and sh3) and MDP_SSTEP (sh3) are lwp flags not
process ones, rename to MDL_xxx.

diffstat:

 sys/arch/amd64/amd64/fpu.c                      |  16 ++++++++--------
 sys/arch/amd64/amd64/machdep.c                  |  14 +++++++-------
 sys/arch/amd64/amd64/netbsd32_machdep.c         |  14 +++++++-------
 sys/arch/amd64/amd64/process_machdep.c          |  12 ++++++------
 sys/arch/amd64/include/proc.h                   |   5 +++--
 sys/arch/sh3/include/proc.h                     |   6 +++---
 sys/arch/sh3/include/userret.h                  |   4 ++--
 sys/arch/sh3/sh3/exception.c                    |   6 +++---
 sys/arch/sh3/sh3/process_machdep.c              |   8 ++++----
 sys/arch/sh3/sh3/sh3_machdep.c                  |   6 +++---
 sys/compat/linux/arch/amd64/linux_machdep.c     |   8 ++++----
 sys/compat/linux32/arch/amd64/linux32_machdep.c |   6 +++---
 12 files changed, 53 insertions(+), 52 deletions(-)

diffs (truncated from 449 to 300 lines):

diff -r b3b42d9aba4e -r 019ccd69abe6 sys/arch/amd64/amd64/fpu.c
--- a/sys/arch/amd64/amd64/fpu.c        Sun Jul 08 18:16:01 2012 +0000
+++ b/sys/arch/amd64/amd64/fpu.c        Sun Jul 08 20:14:11 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpu.c,v 1.38 2011/08/11 18:36:14 cherry Exp $  */
+/*     $NetBSD: fpu.c,v 1.39 2012/07/08 20:14:11 dsl Exp $     */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.  All
@@ -100,7 +100,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.38 2011/08/11 18:36:14 cherry Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.39 2012/07/08 20:14:11 dsl Exp $");
 
 #include "opt_multiprocessor.h"
 
@@ -137,17 +137,17 @@
 
 /*
  * We do lazy initialization and switching using the TS bit in cr0 and the
- * MDP_USEDFPU bit in mdproc.
+ * MDL_USEDFPU bit in mdlwp.
  *
  * DNA exceptions are handled like this:
  *
  * 1) If there is no FPU, return and go to the emulator.
  * 2) If someone else has used the FPU, save its state into that lwp's PCB.
- * 3a) If MDP_USEDFPU is not set, set it and initialize the FPU.
+ * 3a) If MDL_USEDFPU is not set, set it and initialize the FPU.
  * 3b) Otherwise, reload the lwp's previous FPU state.
  *
  * When a lwp is created or exec()s, its saved cr0 image has the TS bit
- * set and the MDP_USEDFPU bit clear.  The MDP_USEDFPU bit is set when the
+ * set and the MDL_USEDFPU bit clear.  The MDL_USEDFPU bit is set when the
  * lwp first gets a DNA and the FPU is initialized.  The TS bit is turned
  * off when the FPU is used, and turned on again later when the lwp's FPU
  * state is saved.
@@ -305,13 +305,13 @@
        clts();
        ci->ci_fpcurlwp = l;
        pcb->pcb_fpcpu = ci;
-       if ((l->l_md.md_flags & MDP_USEDFPU) == 0) {
+       if ((l->l_md.md_flags & MDL_USEDFPU) == 0) {
                fninit();
                cw = pcb->pcb_savefpu.fp_fxsave.fx_fcw;
                fldcw(&cw);
                mxcsr = pcb->pcb_savefpu.fp_fxsave.fx_mxcsr;
                x86_ldmxcsr(&mxcsr);
-               l->l_md.md_flags |= MDP_USEDFPU;
+               l->l_md.md_flags |= MDL_USEDFPU;
        } else {
                /*
                 * AMD FPU's do not restore FIP, FDP, and FOP on fxrstor,
@@ -426,6 +426,6 @@
 
        if (!save) {
                /* Ensure we restart with a clean slate. */
-               l->l_md.md_flags &= ~MDP_USEDFPU;
+               l->l_md.md_flags &= ~MDL_USEDFPU;
        }
 }
diff -r b3b42d9aba4e -r 019ccd69abe6 sys/arch/amd64/amd64/machdep.c
--- a/sys/arch/amd64/amd64/machdep.c    Sun Jul 08 18:16:01 2012 +0000
+++ b/sys/arch/amd64/amd64/machdep.c    Sun Jul 08 20:14:11 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.187 2012/06/27 00:37:07 jym Exp $        */
+/*     $NetBSD: machdep.c,v 1.188 2012/07/08 20:14:11 dsl Exp $        */
 
 /*-
  * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008, 2011
@@ -111,7 +111,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.187 2012/06/27 00:37:07 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.188 2012/07/08 20:14:11 dsl Exp $");
 
 /* #define XENDEBUG_LOW  */
 
@@ -627,7 +627,7 @@
        tf->tf_ss = GSEL(GUDATA_SEL, SEL_UPL);
 
        /* Ensure FP state is reset, if FP is used. */
-       l->l_md.md_flags &= ~MDP_USEDFPU;
+       l->l_md.md_flags &= ~MDL_USEDFPU;
 }
 
 void
@@ -674,7 +674,7 @@
        /*
         * Don't bother copying out FP state if there is none.
         */
-       if (l->l_md.md_flags & MDP_USEDFPU)
+       if (l->l_md.md_flags & MDL_USEDFPU)
                tocopy = sizeof (struct sigframe_siginfo);
        else
                tocopy = sizeof (struct sigframe_siginfo) -
@@ -1406,7 +1406,7 @@
        pmap_ldt_cleanup(l);
 #endif
 
-       l->l_md.md_flags &= ~MDP_USEDFPU;
+       l->l_md.md_flags &= ~MDL_USEDFPU;
        pcb->pcb_flags = 0;
        pcb->pcb_savefpu.fp_fxsave.fx_fcw = __NetBSD_NPXCW__;
        pcb->pcb_savefpu.fp_fxsave.fx_mxcsr = __INITIAL_MXCSR__;
@@ -1999,7 +1999,7 @@
        mcp->_mc_tlsbase = (uintptr_t)l->l_private;;
        *flags |= _UC_TLSBASE;
 
-       if ((l->l_md.md_flags & MDP_USEDFPU) != 0) {
+       if ((l->l_md.md_flags & MDL_USEDFPU) != 0) {
                struct pcb *pcb = lwp_getpcb(l);
 
                if (pcb->pcb_fpcpu) {
@@ -2063,7 +2063,7 @@
        if ((flags & _UC_FPU) != 0) {
                memcpy(&pcb->pcb_savefpu.fp_fxsave, mcp->__fpregs,
                    sizeof (mcp->__fpregs));
-               l->l_md.md_flags |= MDP_USEDFPU;
+               l->l_md.md_flags |= MDL_USEDFPU;
        }
 
        if ((flags & _UC_TLSBASE) != 0)
diff -r b3b42d9aba4e -r 019ccd69abe6 sys/arch/amd64/amd64/netbsd32_machdep.c
--- a/sys/arch/amd64/amd64/netbsd32_machdep.c   Sun Jul 08 18:16:01 2012 +0000
+++ b/sys/arch/amd64/amd64/netbsd32_machdep.c   Sun Jul 08 20:14:11 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep.c,v 1.77 2012/06/12 22:16:05 bouyer Exp $     */
+/*     $NetBSD: netbsd32_machdep.c,v 1.78 2012/07/08 20:14:11 dsl Exp $        */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.77 2012/06/12 22:16:05 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.78 2012/07/08 20:14:11 dsl Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -142,7 +142,7 @@
 
        netbsd32_adjust_limits(p);
 
-       l->l_md.md_flags &= ~MDP_USEDFPU;
+       l->l_md.md_flags &= ~MDL_USEDFPU;
        pcb->pcb_flags = PCB_COMPAT32;
         pcb->pcb_savefpu.fp_fxsave.fx_fcw = __NetBSD_NPXCW__;
         pcb->pcb_savefpu.fp_fxsave.fx_mxcsr = __INITIAL_MXCSR__;  
@@ -267,7 +267,7 @@
        tf->tf_gs = GSEL(GUDATA32_SEL, SEL_UPL);
 
        /* Ensure FP state is reset, if FP is used. */
-       l->l_md.md_flags &= ~MDP_USEDFPU;
+       l->l_md.md_flags &= ~MDL_USEDFPU;
 
        tf->tf_rip = (uint64_t)catcher;
        tf->tf_cs = GSEL(GUCODE32_SEL, SEL_UPL);
@@ -370,7 +370,7 @@
        tf->tf_ss = GSEL(GUDATA32_SEL, SEL_UPL);
 
        /* Ensure FP state is reset, if FP is used. */
-       l->l_md.md_flags &= ~MDP_USEDFPU;
+       l->l_md.md_flags &= ~MDL_USEDFPU;
 
        /* Remember that we're now on the signal stack. */
        if (onstack)
@@ -890,7 +890,7 @@
                memcpy(&pcb->pcb_savefpu.fp_fxsave, &mcp->__fpregs,
                    sizeof (pcb->pcb_savefpu.fp_fxsave));
                /* If not set already. */
-               l->l_md.md_flags |= MDP_USEDFPU;
+               l->l_md.md_flags |= MDL_USEDFPU;
        }
 
        mutex_enter(p->p_lock);
@@ -941,7 +941,7 @@
        *flags |= _UC_TLSBASE;
 
        /* Save floating point register context, if any. */
-       if ((l->l_md.md_flags & MDP_USEDFPU) != 0) {
+       if ((l->l_md.md_flags & MDL_USEDFPU) != 0) {
                struct pcb *pcb = lwp_getpcb(l);
 
                if (pcb->pcb_fpcpu) {
diff -r b3b42d9aba4e -r 019ccd69abe6 sys/arch/amd64/amd64/process_machdep.c
--- a/sys/arch/amd64/amd64/process_machdep.c    Sun Jul 08 18:16:01 2012 +0000
+++ b/sys/arch/amd64/amd64/process_machdep.c    Sun Jul 08 20:14:11 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: process_machdep.c,v 1.20 2012/05/21 14:15:17 martin Exp $      */
+/*     $NetBSD: process_machdep.c,v 1.21 2012/07/08 20:14:11 dsl Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.20 2012/05/21 14:15:17 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.21 2012/07/08 20:14:11 dsl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -107,7 +107,7 @@
 {
        struct fxsave64 *frame = process_fpframe(l);
 
-       if (l->l_md.md_flags & MDP_USEDFPU) {
+       if (l->l_md.md_flags & MDL_USEDFPU) {
                fpusave_lwp(l, true);
        } else {
                uint16_t cw;
@@ -127,7 +127,7 @@
                frame->fx_ftw = 0x00;   /* abridged tag; all empty */
                frame->fx_mxcsr = mxcsr;
                frame->fx_mxcsr_mask = mxcsr_mask;
-               l->l_md.md_flags |= MDP_USEDFPU;
+               l->l_md.md_flags |= MDL_USEDFPU;
        }
 
        memcpy(&regs->fxstate, frame, sizeof(*regs));
@@ -162,10 +162,10 @@
 {
        struct fxsave64 *frame = process_fpframe(l);
 
-       if (l->l_md.md_flags & MDP_USEDFPU) {
+       if (l->l_md.md_flags & MDL_USEDFPU) {
                fpusave_lwp(l, false);
        } else {
-               l->l_md.md_flags |= MDP_USEDFPU;
+               l->l_md.md_flags |= MDL_USEDFPU;
        }
 
        memcpy(frame, &regs->fxstate, sizeof(*regs));
diff -r b3b42d9aba4e -r 019ccd69abe6 sys/arch/amd64/include/proc.h
--- a/sys/arch/amd64/include/proc.h     Sun Jul 08 18:16:01 2012 +0000
+++ b/sys/arch/amd64/include/proc.h     Sun Jul 08 20:14:11 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: proc.h,v 1.13 2011/01/14 02:06:22 rmind Exp $  */
+/*     $NetBSD: proc.h,v 1.14 2012/07/08 20:14:11 dsl Exp $    */
 
 /*
  * Copyright (c) 1991 Regents of the University of California.
@@ -53,6 +53,8 @@
        volatile int md_astpending;
 };
 
+#define        MDL_USEDFPU     0x0001  /* has used the FPU */
+
 struct mdproc {
        int     md_flags;
                                        /* Syscall handling function */
@@ -60,7 +62,6 @@
 };
 
 /* md_flags */
-#define        MDP_USEDFPU     0x0001  /* has used the FPU */
 #define MDP_COMPAT     0x0002  /* x86 compatibility process */
 #define MDP_SYSCALL    0x0004  /* entered kernel via syscall ins */
 #define MDP_USEDMTRR   0x0008  /* has set volatile MTRRs */
diff -r b3b42d9aba4e -r 019ccd69abe6 sys/arch/sh3/include/proc.h
--- a/sys/arch/sh3/include/proc.h       Sun Jul 08 18:16:01 2012 +0000
+++ b/sys/arch/sh3/include/proc.h       Sun Jul 08 20:14:11 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: proc.h,v 1.16 2011/01/26 23:26:37 uwe Exp $    */
+/*     $NetBSD: proc.h,v 1.17 2012/07/08 20:14:11 dsl Exp $    */
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc. All rights reserved.
@@ -57,8 +57,8 @@
 };
 
 /* md_flags */
-#define        MDP_USEDFPU     0x0001  /* has used the FPU */
-#define        MDP_SSTEP       0x0002  /* single-stepped with PT_STEP */
+#define        MDL_USEDFPU     0x0001  /* has used the FPU */
+#define        MDL_SSTEP       0x0002  /* single-stepped with PT_STEP */
 
 struct lwp;
 
diff -r b3b42d9aba4e -r 019ccd69abe6 sys/arch/sh3/include/userret.h
--- a/sys/arch/sh3/include/userret.h    Sun Jul 08 18:16:01 2012 +0000
+++ b/sys/arch/sh3/include/userret.h    Sun Jul 08 20:14:11 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: userret.h,v 1.12 2011/02/08 20:20:23 rmind Exp $       */
+/*     $NetBSD: userret.h,v 1.13 2012/07/08 20:14:11 dsl Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -56,7 +56,7 @@
 
 #ifdef PTRACE
        /* Check if lwp is being PT_STEP'ed */
-       if (l->l_md.md_flags & MDP_SSTEP) {
+       if (l->l_md.md_flags & MDL_SSTEP) {
                struct trapframe *tf = l->l_md.md_regs;



Home | Main Index | Thread Index | Old Index