Be sure to propagate PSL_O in psw on PCXU* processors to userland processes
authormiod <miod@openbsd.org>
Mon, 14 Jul 2008 13:37:39 +0000 (13:37 +0000)
committermiod <miod@openbsd.org>
Mon, 14 Jul 2008 13:37:39 +0000 (13:37 +0000)
and signal handlers.
ok kettenis@

sys/arch/hppa/hppa/machdep.c
sys/arch/hppa/hppa/vm_machdep.c
sys/arch/hppa/include/cpu.h

index 921cd61..4f39519 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: machdep.c,v 1.167 2008/06/27 17:22:14 miod Exp $      */
+/*     $OpenBSD: machdep.c,v 1.168 2008/07/14 13:37:39 miod Exp $      */
 
 /*
  * Copyright (c) 1999-2003 Michael Shalayeff
@@ -560,8 +560,6 @@ cpuid()
 
        /* force strong ordering for now */
        if (p->features & HPPA_FTRS_W32B) {
-               extern register_t kpsw; /* intr.c */
-
                kpsw |= PSL_O;
        }
 
@@ -1426,7 +1424,7 @@ sys_sigreturn(p, v, retval)
                tf->tf_iisq_tail = HPPA_SID_KERNEL;
        else
                tf->tf_iisq_tail = p->p_addr->u_pcb.pcb_space;
-       tf->tf_ipsw = ksc.sc_ps;
+       tf->tf_ipsw = ksc.sc_ps | (kpsw & PSL_O);
 
 #ifdef DEBUG
        if ((sigdebug & SDB_FOLLOW) && (!sigpid || p->p_pid == sigpid))
index 528a1db..78ab03b 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: vm_machdep.c,v 1.62 2007/10/10 15:53:51 art Exp $     */
+/*     $OpenBSD: vm_machdep.c,v 1.63 2008/07/14 13:37:39 miod Exp $    */
 
 /*
  * Copyright (c) 1999-2004 Michael Shalayeff
@@ -151,7 +151,8 @@ cpu_fork(p1, p2, stack, stacksize, func, arg)
         */
        tf->tf_sr7 = HPPA_SID_KERNEL;
        mfctl(CR_EIEM, tf->tf_eiem);
-       tf->tf_ipsw = PSL_C | PSL_Q | PSL_P | PSL_D | PSL_I /* | PSL_L */;
+       tf->tf_ipsw = PSL_C | PSL_Q | PSL_P | PSL_D | PSL_I /* | PSL_L */ |
+           (kpsw & PSL_O);
 
        /*
         * If specified, give the child a different stack.
index ff9f6aa..f4b45f4 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: cpu.h,v 1.52 2007/10/10 15:53:51 art Exp $    */
+/*     $OpenBSD: cpu.h,v 1.53 2008/07/14 13:39:06 miod Exp $   */
 
 /*
  * Copyright (c) 2000-2004 Michael Shalayeff
@@ -91,6 +91,7 @@ enum hppa_cpu_type {
 extern enum hppa_cpu_type cpu_type;
 extern const char *cpu_typename;
 extern int cpu_hvers;
+extern register_t kpsw;
 #endif
 #endif