summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2008-07-14 13:37:39 +0000
committermiod <miod@openbsd.org>2008-07-14 13:37:39 +0000
commit937d80b421346255dc5d4b8303fbde16c08000fd (patch)
tree1cb2ab5201a807fe5d7f822ee6cb6b26e2980b2a
parentm_copy can return NULL, so check for it (diff)
downloadwireguard-openbsd-937d80b421346255dc5d4b8303fbde16c08000fd.tar.xz
wireguard-openbsd-937d80b421346255dc5d4b8303fbde16c08000fd.zip
Be sure to propagate PSL_O in psw on PCXU* processors to userland processes
and signal handlers. ok kettenis@
-rw-r--r--sys/arch/hppa/hppa/machdep.c6
-rw-r--r--sys/arch/hppa/hppa/vm_machdep.c5
-rw-r--r--sys/arch/hppa/include/cpu.h3
3 files changed, 7 insertions, 7 deletions
diff --git a/sys/arch/hppa/hppa/machdep.c b/sys/arch/hppa/hppa/machdep.c
index 921cd6175ea..4f395192bdb 100644
--- a/sys/arch/hppa/hppa/machdep.c
+++ b/sys/arch/hppa/hppa/machdep.c
@@ -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))
diff --git a/sys/arch/hppa/hppa/vm_machdep.c b/sys/arch/hppa/hppa/vm_machdep.c
index 528a1dba26c..78ab03bb2a3 100644
--- a/sys/arch/hppa/hppa/vm_machdep.c
+++ b/sys/arch/hppa/hppa/vm_machdep.c
@@ -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.
diff --git a/sys/arch/hppa/include/cpu.h b/sys/arch/hppa/include/cpu.h
index ff9f6aa916c..f4b45f47d30 100644
--- a/sys/arch/hppa/include/cpu.h
+++ b/sys/arch/hppa/include/cpu.h
@@ -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