summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-06-22 05:01:09 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-06-22 05:01:09 +0000
commitca1eff565277850b0231424d808feb6336d85a51 (patch)
treeed48e27e8aa655b766ca3cb381f3853630299af8
parent0263a692679472b19b1107d6b9710aaeb3856d9a (diff)
On 88110, simplify enip processing:
- always fetch its value when building trapframe, it is faster than only doing it after checking if it will have a meaningful value. - don't bother setting it to a safe value if we change exip to a non-delayslot address.
-rw-r--r--sys/arch/m88k/m88k/trap.c11
-rw-r--r--sys/arch/mvme88k/mvme88k/eh.S25
2 files changed, 7 insertions, 29 deletions
diff --git a/sys/arch/m88k/m88k/trap.c b/sys/arch/m88k/m88k/trap.c
index a8578b7d9c5..4fe7b704a49 100644
--- a/sys/arch/m88k/m88k/trap.c
+++ b/sys/arch/m88k/m88k/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.5 2004/06/07 10:28:47 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.6 2004/06/22 05:01:05 miod Exp $ */
/*
* Copyright (c) 2004, Miodrag Vallat.
* Copyright (c) 1998 Steve Murphree, Jr.
@@ -736,7 +736,6 @@ m88110_trap(unsigned type, struct trapframe *frame)
frame->tf_exip = frame->tf_enip;
else
frame->tf_exip += 4;
- frame->tf_enip = 0;
splx(s);
return;
#if 0
@@ -823,7 +822,6 @@ m88110_trap(unsigned type, struct trapframe *frame)
(frame->tf_exip & XIP_ADDR) <=
(unsigned)&guarded_access_end) {
frame->tf_exip = (unsigned)&guarded_access_bad;
- frame->tf_enip = 0;
return;
}
}
@@ -1011,7 +1009,6 @@ m88110_user_fault:
*/
if (result != 0 && p->p_addr->u_pcb.pcb_onfault != NULL) {
frame->tf_exip = p->p_addr->u_pcb.pcb_onfault;
- frame->tf_enip = 0;
frame->tf_dsr = frame->tf_isr = 0;
/*
* Continue as if the fault had been resolved.
@@ -1452,7 +1449,7 @@ m88110_syscall(register_t code, struct trapframe *tf)
* shown above.
* Given this,
* 1. If the system call returned 0, need to jmp r1.
- * exip += 8
+ * exip += 8
* 2. If the system call returned an errno > 0, increment
* exip += 4 and plug the value in r2. This will have us
* executing "br err" on return to user space.
@@ -1481,7 +1478,6 @@ m88110_syscall(register_t code, struct trapframe *tf)
tf->tf_exip = tf->tf_enip + 4;
else
tf->tf_exip += 4 + 4;
- tf->tf_enip = 0;
break;
case ERESTART:
/*
@@ -1498,7 +1494,6 @@ m88110_syscall(register_t code, struct trapframe *tf)
tf->tf_exip = tf->tf_enip;
else
tf->tf_exip += 4;
- tf->tf_enip = 0;
break;
default:
if (p->p_emul->e_errno)
@@ -1510,7 +1505,6 @@ m88110_syscall(register_t code, struct trapframe *tf)
tf->tf_exip = tf->tf_enip;
else
tf->tf_exip += 4;
- tf->tf_enip = 0;
break;
}
@@ -1549,7 +1543,6 @@ child_return(arg)
tf->tf_exip = tf->tf_enip + 4;
else
tf->tf_exip += 4 + 4;
- tf->tf_enip = 0;
}
userret(p, tf, p->p_sticks);
diff --git a/sys/arch/mvme88k/mvme88k/eh.S b/sys/arch/mvme88k/mvme88k/eh.S
index 7ded52bad93..88a8990fcac 100644
--- a/sys/arch/mvme88k/mvme88k/eh.S
+++ b/sys/arch/mvme88k/mvme88k/eh.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: eh.S,v 1.50 2004/01/29 21:39:05 deraadt Exp $ */
+/* $OpenBSD: eh.S,v 1.51 2004/06/22 05:01:08 miod Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1991 Carnegie Mellon University
@@ -1602,12 +1602,6 @@ ASLOCAL(fpu_enable)
st r27, r31, GENREG_OFF(27)
st r28, r31, GENREG_OFF(28)
st r29, r31, GENREG_OFF(29)
-#ifdef JEFF_DEBUG
- /* mark beginning of frame with notable value */
- or.u r20, r0, hi16(0x12345678)
- or r20, r20, lo16(0x12345678)
- st r20, r31, GENREG_OFF(0)
-#endif
/* get and save IPL */
bsr.n _C_LABEL(getipl)
@@ -2249,6 +2243,8 @@ GLOBAL(m88110_reset_handler)
ld r10, r30, REG_OFF(EF_EPSR)
st r10, r31, REG_OFF(EF_EPSR)
ld r10, r30, REG_OFF(EF_EXIP)
+ st r10, r31, REG_OFF(EF_EXIP)
+ ld r10, r30, REG_OFF(EF_ENIP)
st r10, r31, REG_OFF(EF_ENIP)
ld r10, r30, REG_OFF(EF_DSR)
st r10, r31, REG_OFF(EF_DSR)
@@ -2471,12 +2467,9 @@ ASLOCAL(m88110_have_pcb)
ldcr TMP, EPSR
st TMP, r31, REG_OFF(EF_EPSR)
ldcr TMP2, EXIP
- /* if the instruction was NOT in the delay slot, ignore ENIP */
- bb0.n 0, TMP2, 1f
- st TMP2, r31, REG_OFF(EF_EXIP)
ldcr TMP3, ENIP
+ st TMP2, r31, REG_OFF(EF_EXIP)
st TMP3, r31, REG_OFF(EF_ENIP)
-1:
/* get and store the cpu number */
extu TMP, FLAGS, FLAG_CPU_FIELD_WIDTH<0> /* TMP = cpu# */
@@ -2545,9 +2538,7 @@ ASLOCAL(m88110_setup_phase_two)
or.u TMP, r0, hi16(_ASM_LABEL(m88110_fpu_enable))
or TMP, TMP, lo16(_ASM_LABEL(m88110_fpu_enable))
- stcr TMP, EXIP /* jump to here m88110_fpu_enable */
- addu TMP, TMP, 4
- stcr TMP, ENIP /* and then continue after that */
+ stcr TMP, EXIP /* jump to m88110_fpu_enable upon RTE */
set FLAGS, FLAGS, 1<FLAG_ENABLING_FPU>
xcr FLAGS, FLAGS, SR1
@@ -2637,12 +2628,6 @@ ASLOCAL(m88110_fpu_enable)
st r27, r31, GENREG_OFF(27)
st r28, r31, GENREG_OFF(28)
st r29, r31, GENREG_OFF(29)
-#ifdef JEFF_DEBUG
- /* mark beginning of frame with notable value */
- or.u r20, r0, hi16(0x12345678)
- or r20, r20, lo16(0x12345678)
- st r20, r31, GENREG_OFF(0)
-#endif
/* get and save IPL */
bsr.n _C_LABEL(getipl)