Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/include When seeing if the FP or VEC unit h...



details:   https://anonhg.NetBSD.org/src/rev/9f38333acdfb
branches:  trunk
changeset: 565387:9f38333acdfb
user:      matt <matt%NetBSD.org@localhost>
date:      Tue Apr 06 02:25:22 2004 +0000

description:
When seeing if the FP or VEC unit has been stolen by another process, check
PSL_{FP|VEC} instead of PCB_{FP|VEC}.  The former will only be set if the
process owned the {FP,VEC} unit when it trapped into the kernel.  The latter
would be set if the lwp ever used the {FP,VEC} unit.

diffstat:

 sys/arch/powerpc/include/userret.h |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (30 lines):

diff -r 85a0c68ceb29 -r 9f38333acdfb sys/arch/powerpc/include/userret.h
--- a/sys/arch/powerpc/include/userret.h        Tue Apr 06 01:45:03 2004 +0000
+++ b/sys/arch/powerpc/include/userret.h        Tue Apr 06 02:25:22 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: userret.h,v 1.7 2004/04/04 16:47:02 matt Exp $ */
+/*     $NetBSD: userret.h,v 1.8 2004/04/06 02:25:22 matt Exp $ */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -54,16 +54,17 @@
 
        /*
         * If someone stole the fp or vector unit while we were away,
-        * disable it
+        * disable it.  Note that if the PSL FP/VEC bits aren't set, then
+        * we don't own it.
         */
 #ifdef PPC_HAVE_FPU
-       if ((pcb->pcb_flags & PCB_FPU) &&
+       if ((frame->srr1 & PSL_FP) &&
            (l != ci->ci_fpulwp || pcb->pcb_fpcpu != ci)) {
                frame->srr1 &= ~(PSL_FP|PSL_FE0|PSL_FE1);
        }
 #endif
 #ifdef ALTIVEC
-       if ((pcb->pcb_flags & PCB_ALTIVEC) &&
+       if ((frame->srr1 & PSL_VEC) &&
            (l != ci->ci_veclwp || pcb->pcb_veccpu != ci)) {
                frame->srr1 &= ~PSL_VEC;
        }



Home | Main Index | Thread Index | Old Index