summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-08-02 08:34:22 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-08-02 08:34:22 +0000
commite2855b65eec8e646a5cc8b1f72d602529d8b4d19 (patch)
tree0aa35ec98784a69b25cf5d04e242e4f5c1099ea5
parent5b49804e2faaa0a8545ff16533664bdaed8f696c (diff)
When restoring a process' ipl, invoke setipl() on behalf on the kernel stack,
rather than on the process stack.
-rw-r--r--sys/arch/m88k/m88k/process.S22
1 files changed, 8 insertions, 14 deletions
diff --git a/sys/arch/m88k/m88k/process.S b/sys/arch/m88k/m88k/process.S
index 31d0dc044e0..1684a763aee 100644
--- a/sys/arch/m88k/m88k/process.S
+++ b/sys/arch/m88k/m88k/process.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: process.S,v 1.4 2004/07/13 09:45:51 miod Exp $ */
+/* $OpenBSD: process.S,v 1.5 2004/08/02 08:34:21 miod Exp $ */
/*
* Copyright (c) 1996 Nivas Madhur
* All rights reserved.
@@ -249,8 +249,6 @@ ASLOCAL(Ldoneloop)
ld r3, r10, PCB_FCR63
fstcr r2, fcr62
fstcr r3, fcr63
- ld r1, r10, PCB_PC
- ld r14,r10, PCB_R14
ld r15,r10, PCB_R15
ld r16,r10, PCB_R16
ld r17,r10, PCB_R17
@@ -266,19 +264,15 @@ ASLOCAL(Ldoneloop)
ld r27,r10, PCB_R27
ld r28,r10, PCB_R28
ld r29,r10, PCB_R29
- ld r30,r10, PCB_R30 /* restore frame pointer & stack */
- ld r31,r10, PCB_SP
-
-/* XXX
- * Should we postpone restoring stack till after ipl is restored?
- * The stack access could fault
- */
- subu r31,r31,48
- st r1, r31,36 /* save r1 on stack */
+ or r14,r10, r0 /* preserve curpcb in a register... */
+ subu r31,r31,32
bsr.n _C_LABEL(setipl)
ld r2, r10, PCB_IPL /* restore interrupt mask */
- ld r1, r31,36 /* restore r1 from stack */
- addu r31,r31,48
+ addu r31,r31,32
+ ld r1, r14, PCB_PC
+ ld r30,r14, PCB_R30 /* restore frame pointer & stack */
+ ld r31,r14, PCB_SP
+ ld r14,r14, PCB_R14
jmp.n r1
or r2, r0, 1 /* return 1 (for alternate returns) */