Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/powerpc Make sure that the SRR1 we pass to ...



details:   https://anonhg.NetBSD.org/src/rev/51efaef95fe4
branches:  trunk
changeset: 565328:51efaef95fe4
user:      matt <matt%NetBSD.org@localhost>
date:      Sun Apr 04 17:10:32 2004 +0000

description:
Make sure that the SRR1 we pass to userland reflects PSL_FE0|PSL_FE1 even
if the lwp doesn't currently own the FPU.  When returning, copy those bits
back to the PCB.  (In case the user decided to the FP exception mode in the
signal handler).

diffstat:

 sys/arch/powerpc/powerpc/compat_16_machdep.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r e3081dee39ab -r 51efaef95fe4 sys/arch/powerpc/powerpc/compat_16_machdep.c
--- a/sys/arch/powerpc/powerpc/compat_16_machdep.c      Sun Apr 04 17:06:45 2004 +0000
+++ b/sys/arch/powerpc/powerpc/compat_16_machdep.c      Sun Apr 04 17:10:32 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_16_machdep.c,v 1.2 2003/09/25 22:22:36 matt Exp $       */
+/*     $NetBSD: compat_16_machdep.c,v 1.3 2004/04/04 17:10:32 matt Exp $       */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.2 2003/09/25 22:22:36 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.3 2004/04/04 17:10:32 matt Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_ppcarch.h"
@@ -87,6 +87,9 @@
        utf->ctr  = tf->ctr;
        utf->srr0 = tf->srr0;
        utf->srr1 = tf->srr1;
+#ifdef PPC_HAVE_FPU
+       utf->srr1 |= l->l_addr->u_pcb.pcb_flags & (PCB_FE0|PCB_FE1);
+#endif
 #ifdef PPC_OEA
        utf->vrsave = tf->tf_xtra[TF_VRSAVE];
        utf->mq = tf->tf_xtra[TF_MQ];
@@ -188,6 +191,10 @@
        tf->ctr  = utf->ctr;
        tf->srr0 = utf->srr0;
        tf->srr1 = utf->srr1;
+#ifdef PPC_HAVE_FPU
+       l->l_addr->u_pcb.pcb_flags &= ~(PCB_FE0|PCB_FE1);
+       l->l_addr->u_pcb.pcb_flags |= utf->srr1 & (PCB_FE0|PCB_FE1);
+#endif
 #ifdef PPC_OEA
        tf->tf_xtra[TF_VRSAVE] = utf->vrsave;
        tf->tf_xtra[TF_MQ] = utf->mq;



Home | Main Index | Thread Index | Old Index