summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/m88k/include/cpu.h15
-rw-r--r--sys/arch/m88k/m88k/eh_common.S50
-rw-r--r--sys/arch/m88k/m88k/genassym.cf5
-rw-r--r--sys/arch/mvme88k/mvme88k/locore.S7
-rw-r--r--sys/arch/mvme88k/mvme88k/m197_machdep.c19
-rw-r--r--sys/arch/mvme88k/mvme88k/machdep.c22
6 files changed, 23 insertions, 95 deletions
diff --git a/sys/arch/m88k/include/cpu.h b/sys/arch/m88k/include/cpu.h
index c724487f22e..b85a7e93dad 100644
--- a/sys/arch/m88k/include/cpu.h
+++ b/sys/arch/m88k/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.42 2009/02/17 21:03:59 miod Exp $ */
+/* $OpenBSD: cpu.h,v 1.43 2009/02/21 18:35:20 miod Exp $ */
/*
* Copyright (c) 1996 Nivas Madhur
* Copyright (c) 1992, 1993
@@ -114,13 +114,12 @@ struct cpu_info {
#define ci_pfsr_d1 ci_cpudep3
/* 88110 fields */
-#define ci_nmi_stack ci_cpudep0 /* NMI stack */
-#define ci_ipi_arg1 ci_cpudep1 /* Complex IPI arguments */
-#define ci_ipi_arg2 ci_cpudep2
-#define ci_h_sxip ci_cpudep3 /* trapframe values */
-#define ci_h_epsr ci_cpudep4 /* for hardclock */
-#define ci_s_sxip ci_cpudep5 /* and softclock */
-#define ci_s_epsr ci_cpudep6
+#define ci_ipi_arg1 ci_cpudep0 /* Complex IPI arguments */
+#define ci_ipi_arg2 ci_cpudep1
+#define ci_h_sxip ci_cpudep2 /* trapframe values */
+#define ci_h_epsr ci_cpudep3 /* for hardclock */
+#define ci_s_sxip ci_cpudep4 /* and softclock */
+#define ci_s_epsr ci_cpudep5
struct schedstate_percpu
ci_schedstate; /* scheduling state */
diff --git a/sys/arch/m88k/m88k/eh_common.S b/sys/arch/m88k/m88k/eh_common.S
index 669f0a02b12..1b48c14b9a8 100644
--- a/sys/arch/m88k/m88k/eh_common.S
+++ b/sys/arch/m88k/m88k/eh_common.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: eh_common.S,v 1.51 2009/02/16 22:55:03 miod Exp $ */
+/* $OpenBSD: eh_common.S,v 1.52 2009/02/21 18:35:22 miod Exp $ */
/*
* Mach Operating System
* Copyright (c) 1993-1991 Carnegie Mellon University
@@ -222,13 +222,10 @@
* cause other exceptions to happen, and the whole system is
* in a rather precarious state and so special cautions must
* be taken.
- * The bit FLAG_NMI_STACK, on 88110, indicates that this exception
- * should be handled on the NMI stack.
*/
#define FLAG_IGNORE_DATA_EXCEPTION 0
#define FLAG_ENABLING_FPU 1
#define FLAG_FROM_KERNEL 2
-#define FLAG_NMI_STACK 3
/* GENeral REGister OFFset into the E.F. (exception frame) */
#define GENREG_OFF(num) (EF_R0 + (num) * 4)
@@ -332,7 +329,6 @@
#ifdef M88110
#define PREP88110(NAME, NUM, FLAG_PRECHECK) \
xcr FLAGS, FLAGS, SR1 ; \
- clr FLAGS, FLAGS, 1<FLAG_NMI_STACK> ; \
FLAG_PRECHECK \
/* the bsr later clobbers r1, so save now */ ; \
stcr r1, SR2 /* r1 now free */ ; \
@@ -360,8 +356,6 @@
#define M88110_Data_Precheck \
bb1.n FLAG_IGNORE_DATA_EXCEPTION, FLAGS, \
_ASM_LABEL(m88110_ignore_data_exception);
-#define M88110_Set_NMI_Flag \
- set FLAGS, FLAGS, 1<FLAG_NMI_STACK>
#ifdef M88100
/*
@@ -1605,7 +1599,7 @@ GLOBAL(m88110_fpu_handler)
/* non-maskable interrupt handler (IPIs, ABORT button) */
GLOBAL(m88110_nonmaskable)
- PREP88110("NMI", 11, M88110_Set_NMI_Flag)
+ PREP88110("NMI", 11,)
or r2, r0, r30
XCALL(_C_LABEL(nmi), _ASM_LABEL(check_ast))
@@ -1852,19 +1846,18 @@ ASLOCAL(m88110_setup_phase_one)
/*
* If we were in the kernel when the exception occured, we have
* a valid stack. Keep using it, and build the frame on it.
+ *
+ * Note that if this exception is an NMI, we might be currently
+ * switching processes, and curpcb and curproc won't match. It
+ * is nevertheless safe to use curpcb, since nmi are processed
+ * with interrupts disabled, and we won't check for AST or soft
+ * interrupts before returning to the cpu_switchto kernel code.
*/
bb1 FLAG_FROM_KERNEL, FLAGS, _ASM_LABEL(m88110_kernel_stack)
/*
- * If this is an NMI, pick the NMI stack, and build the frame
- * in it.
- */
- bb1 FLAG_NMI_STACK, FLAGS, _ASM_LABEL(m88110_nmi_stack)
-
- /*
- * Otherwise, this is a normal exception in user mode, we'll
- * use the PCB for the exception frame and the top of the PCB
- * as the stack.
+ * Otherwise, this is an exception in user mode, we'll use the PCB
+ * for the exception frame and the top of the PCB as the stack.
*/
/* compute frame address: in PCB */
@@ -1886,28 +1879,7 @@ ASLOCAL(m88110_setup_phase_one)
br _ASM_LABEL(m88110_have_stack)
-ASLOCAL(m88110_nmi_stack)
- /* NMI exception in user mode */
-
- /* compute frame address: top of NMI stack */
- stcr r30, SR3 /* save r30, now free */
- ldcr r30, CPU
- ld r30, r30, CI_NMI_STACK
- addu r30, r30, (USPACE - TRAPFRAME_SIZEOF)
-
- /* save a few registers before we lose them */
- st r1, r30, GENREG_OFF(1) /* save prev. r1 (now free) */
- ldcr r1, SR3 /* save previous r30 */
- st r31, r30, GENREG_OFF(31)
- st r1, r30, GENREG_OFF(30)
-
- /* compute stack address: bottom of exception frame */
- or r31, r30, r0
-
- br _ASM_LABEL(m88110_have_stack)
-
-ASLOCAL(m88110_kernel_stack)
- /* Exception in kernel mode */
+ASLOCAL(m88110_kernel_stack) /* Exception in kernel mode */
/* compute stack and frame address: allocate them on current stack */
subu r31, r31, TRAPFRAME_SIZEOF /* r31 now our E.F. */
diff --git a/sys/arch/m88k/m88k/genassym.cf b/sys/arch/m88k/m88k/genassym.cf
index 05563cb829e..a06a498bffb 100644
--- a/sys/arch/m88k/m88k/genassym.cf
+++ b/sys/arch/m88k/m88k/genassym.cf
@@ -1,4 +1,4 @@
-# $OpenBSD: genassym.cf,v 1.18 2009/02/08 21:40:58 miod Exp $
+# $OpenBSD: genassym.cf,v 1.19 2009/02/21 18:35:22 miod Exp $
#
# Copyright (c) 1982, 1990 The Regents of the University of California.
# All rights reserved.
@@ -28,7 +28,7 @@
# SUCH DAMAGE.
#
# @(#)genassym.c 7.8 (Berkeley) 5/7/91
-# $Id: genassym.cf,v 1.18 2009/02/08 21:40:58 miod Exp $
+# $Id: genassym.cf,v 1.19 2009/02/21 18:35:22 miod Exp $
#
include <sys/param.h>
@@ -69,7 +69,6 @@ member ci_pfsr_d0
member ci_pfsr_d1
member ci_want_resched
member ci_softintr
-member ci_nmi_stack
# pcb fields
struct pcb
diff --git a/sys/arch/mvme88k/mvme88k/locore.S b/sys/arch/mvme88k/mvme88k/locore.S
index 291fee7edc5..479fc43280f 100644
--- a/sys/arch/mvme88k/mvme88k/locore.S
+++ b/sys/arch/mvme88k/mvme88k/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.63 2009/02/08 21:40:58 miod Exp $ */
+/* $OpenBSD: locore.S,v 1.64 2009/02/21 18:35:22 miod Exp $ */
/*
* Copyright (c) 2005, Miodrag Vallat.
* Copyright (c) 1998 Steve Murphree, Jr.
@@ -328,11 +328,6 @@ ASGLOBAL(initstack)
space USPACE
ASGLOBAL(initstack_end)
-#ifdef M88110
-GLOBAL(nmi_stack) /* NMI stack for the boot processor */
- space USPACE
-#endif
-
#ifdef MULTIPROCESSOR
space PAGE_SIZE /* 4K, small, interim stack */
ASLOCAL(slavestack_end)
diff --git a/sys/arch/mvme88k/mvme88k/m197_machdep.c b/sys/arch/mvme88k/mvme88k/m197_machdep.c
index 4a002ef9d04..1614020694a 100644
--- a/sys/arch/mvme88k/mvme88k/m197_machdep.c
+++ b/sys/arch/mvme88k/mvme88k/m197_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: m197_machdep.c,v 1.34 2009/02/17 21:04:01 miod Exp $ */
+/* $OpenBSD: m197_machdep.c,v 1.35 2009/02/21 18:35:22 miod Exp $ */
/*
* Copyright (c) 2009 Miodrag Vallat.
@@ -266,14 +266,6 @@ void
m197_nmi(struct trapframe *eframe)
{
u_int8_t abort;
-#if 0
- u_int32_t psr;
-
- /* block all hardware interrupts */
- m197_setipl(IPL_HIGH); /* IPL_IPI? */
- psr = get_psr();
- set_psr(psr & ~PSR_IND);
-#endif
/*
* Non-maskable interrupts are either the abort switch (on
@@ -299,15 +291,6 @@ m197_nmi(struct trapframe *eframe)
*(u_int8_t *)(BS_BASE + BS_ABORT) |= BS_ABORT_IEN;
}
}
-
-#if 0
- /*
- * Disable interrupts before returning to assembler,
- * the spl will be restored later.
- */
- set_psr(psr | PSR_IND);
-#endif
-
}
u_int
diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c
index e5da1923e31..17228943858 100644
--- a/sys/arch/mvme88k/mvme88k/machdep.c
+++ b/sys/arch/mvme88k/mvme88k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.223 2009/02/20 20:36:14 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.224 2009/02/21 18:35:22 miod Exp $ */
/*
* Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -733,20 +733,6 @@ secondary_pre_main()
for (;;) ;
}
- /*
- * On 88110 processors, allocate UPAGES contiguous pages for
- * the NMI handling stack.
- */
- if (CPU_IS88110) {
- ci->ci_nmi_stack = uvm_km_zalloc(kernel_map, USPACE);
- if (ci->ci_nmi_stack == (vaddr_t)NULL) {
- printf("cpu%d: unable to allocate NMI stack\n",
- ci->ci_cpuid);
- __cpu_simple_unlock(&cpu_boot_mutex);
- for (;;) ;
- }
- }
-
return (init_stack);
}
@@ -1027,12 +1013,6 @@ mvme_bootstrap()
set_cpu_number(master_cpu);
SET(curcpu()->ci_flags, CIF_ALIVE | CIF_PRIMARY);
-#ifdef M88110
- if (CPU_IS88110) {
- extern caddr_t nmi_stack;
- curcpu()->ci_nmi_stack = (vaddr_t)&nmi_stack;
- }
-#endif
#ifdef M88100
if (CPU_IS88100) {