diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2003-09-20 13:57:38 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2003-09-20 13:57:38 +0000 |
commit | 7ea27ab2a221e6997bebcc29a89aba11ffc997de (patch) | |
tree | 2bdc6cd76e2d5e0135e5d641d944cbb2eed36b35 /sys | |
parent | 9f630f25366256c52721937800ddbb8958053097 (diff) |
Cleanup uses of intstack and interrupt_stack[] - also makes time % in top
more realistic.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/mvme88k/include/cpu.h | 8 | ||||
-rw-r--r-- | sys/arch/mvme88k/include/vmparam.h | 4 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/eh.S | 59 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/locore.S | 8 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/machdep.c | 14 |
5 files changed, 20 insertions, 73 deletions
diff --git a/sys/arch/mvme88k/include/cpu.h b/sys/arch/mvme88k/include/cpu.h index 3fd474334a2..ebbdbb7de5a 100644 --- a/sys/arch/mvme88k/include/cpu.h +++ b/sys/arch/mvme88k/include/cpu.h @@ -1,4 +1,4 @@ -/* $OpenBSD: cpu.h,v 1.20 2003/06/02 23:27:52 millert Exp $ */ +/* $OpenBSD: cpu.h,v 1.21 2003/09/20 13:57:35 miod Exp $ */ /* * Copyright (c) 1996 Nivas Madhur * Copyright (c) 1992, 1993 @@ -77,11 +77,9 @@ struct clockframe { struct trapframe tf; }; -extern int intstack; - #define CLKF_USERMODE(framep) ((((struct trapframe *)(framep))->epsr & PSR_MODE) == 0) -#define CLKF_PC(framep) (((struct trapframe *)(framep))->sxip & ~3) -#define CLKF_INTR(framep) (((struct trapframe *)(framep))->r[31] > intstack) +#define CLKF_PC(framep) (((struct trapframe *)(framep))->sxip & XIP_ADDR) +#define CLKF_INTR(framep) (((struct trapframe *)(framep))->r[31] >= UADDR) /* * Get interrupt glue. diff --git a/sys/arch/mvme88k/include/vmparam.h b/sys/arch/mvme88k/include/vmparam.h index c1565f01437..b37c80a0297 100644 --- a/sys/arch/mvme88k/include/vmparam.h +++ b/sys/arch/mvme88k/include/vmparam.h @@ -1,4 +1,4 @@ -/* $OpenBSD: vmparam.h,v 1.21 2003/01/24 09:57:41 miod Exp $ */ +/* $OpenBSD: vmparam.h,v 1.22 2003/09/20 13:57:35 miod Exp $ */ /* * Mach Operating System * Copyright (c) 1992 Carnegie Mellon University @@ -87,7 +87,7 @@ #define VM_MAX_KERNEL_ADDRESS ((vm_offset_t) 0x1fffffff) #define KERNEL_STACK_SIZE (3 * PAGE_SIZE) /* kernel stack size */ -#define INTSTACK_SIZE (3 * PAGE_SIZE) /* interrupt stack size */ +#define INTSTACK_SIZE (4 * PAGE_SIZE) /* interrupt stack size */ /* virtual sizes (bytes) for various kernel submaps */ #define VM_PHYS_SIZE (1 * NPTEPG * PAGE_SIZE) diff --git a/sys/arch/mvme88k/mvme88k/eh.S b/sys/arch/mvme88k/mvme88k/eh.S index 3014a61dee0..2251ee2ab17 100644 --- a/sys/arch/mvme88k/mvme88k/eh.S +++ b/sys/arch/mvme88k/mvme88k/eh.S @@ -1,4 +1,4 @@ -/* $OpenBSD: eh.S,v 1.41 2003/09/17 22:22:32 miod Exp $ */ +/* $OpenBSD: eh.S,v 1.42 2003/09/20 13:57:37 miod Exp $ */ /* * Mach Operating System * Copyright (c) 1993-1991 Carnegie Mellon University @@ -222,9 +222,6 @@ #define EF_SR3 (EF_R0 + 5) #define EF_FLAGS EF_MODE -/* Define this to make interrupts use their own stack */ -#undef INTSTACK - data align 4 ASLOCAL(sbadcpupanic) @@ -1659,34 +1656,10 @@ ASLOCAL(fpu_enable) ld r2, r31, REG_OFF(EF_EPSR) bb1 PSR_SUPERVISOR_MODE_BIT, r2, 1f /* if in kernel mode */ -#ifdef INTSTACK - /* - * If interrupt exception, switch to interrupt stack if not - * already there. Else, switch to kernel stack. - */ - ld r3, r31, REG_OFF(EF_VECTOR) - cmp r3, r3, 1 /* is interrupt ? */ - bb0 eq, r3, 2f - or.u r31, r0, hi16(_ASM_LABEL(intstack_end)) - or r31, r31, lo16(_ASM_LABEL(intstack_end)) - br 3f -2: -#endif or.u r31, r0, hi16(_ASM_LABEL(kstack)) ld r31, r31, lo16(_ASM_LABEL(kstack)) addu r31, r31, USIZE /* point at proper end */ -#ifdef INTSTACK - br 3f 1: - ld r3, r31, REG_OFF(EF_VECTOR) - cmp r3, r3, 1 /* is interrupt ? */ - bb0 eq, r3, 3f /* no, we will stay on kern stack */ - or.u r31, r0, hi16(_ASM_LABEL(intstack_end)) - or r31, r31, lo16(_ASM_LABEL(intstack_end)) -3: -#else -1: -#endif /* * here - r30 holds a pointer to the exception frame. @@ -1699,7 +1672,7 @@ ASLOCAL(fpu_enable) #endif /* DDB */ ld r2, r30, REG_OFF(EF_VECTOR) - bcnd.n eq0, r2, 8f /* is error */ + bcnd.n eq0, r2, 8f /* error exception */ ld r14, r30, REG_OFF(EF_RET) /* @@ -1808,7 +1781,7 @@ ASLOCAL(return_from_exception_handler) bb0 DMT_VALID_BIT, r3, _ASM_LABEL(check_ast) /* - * If it's not the interrupt exception, and interrupts were + * If it's the interrupt exception, and interrupts were * initially disabled, enable interrupts again... */ ld r2, FPTR, REG_OFF(EF_VECTOR) @@ -1877,7 +1850,7 @@ ASLOCAL(check_ast) or r2, r0, IPL_SOFTCLOCK /* at ipl 1 now */ bsr _C_LABEL(dosoftint) - /* is this needed? we are going to restore the ipl below XXX nivas */ + /* is this needed? we are going to restore the ipl below XXX nivas */ bsr.n _C_LABEL(setipl) or r2, r0, IPL_NONE /* ints are enabled */ addu r31, r31, 32 @@ -2722,34 +2695,10 @@ ASLOCAL(m88110_fpu_enable) ld r2, r31, REG_OFF(EF_EPSR) bb1 PSR_SUPERVISOR_MODE_BIT, r2, 1f /* if in kernel mode */ -#ifdef INTSTACK - /* - * If interrupt exception, switch to interrupt stack if not - * already there. Else, switch to kernel stack. - */ - ld r3, r31, REG_OFF(EF_VECTOR) - cmp r3, r3, 1 /* is interrupt ? */ - bb0 eq, r3, 2f - or.u r31, r0, hi16(_ASM_LABEL(intstack_end)) - or r31, r31, lo16(_ASM_LABEL(intstack_end)) - br 3f -2: -#endif or.u r31, r0, hi16(_ASM_LABEL(kstack)) ld r31, r31, lo16(_ASM_LABEL(kstack)) addu r31, r31, USIZE /* point at proper end */ -#ifdef INTSTACK - br 3f 1: - ld r3, r31, REG_OFF(EF_VECTOR) - cmp r3, r3, 1 /* is interrupt ? */ - bb0 eq, r3, 3f /* no, we will stay on kern stack */ - or.u r31, r0, hi16(_ASM_LABEL(intstack_end)) - or r31, r31, lo16(_ASM_LABEL(intstack_end)) -3: -#else -1: -#endif /* * here - r30 holds a pointer to the exception frame. diff --git a/sys/arch/mvme88k/mvme88k/locore.S b/sys/arch/mvme88k/mvme88k/locore.S index c6953d81787..c597e4d7f0b 100644 --- a/sys/arch/mvme88k/mvme88k/locore.S +++ b/sys/arch/mvme88k/mvme88k/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.30 2003/08/20 20:33:47 miod Exp $ */ +/* $OpenBSD: locore.S,v 1.31 2003/09/20 13:57:37 miod Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -65,7 +65,7 @@ #include <machine/m88100.h> #include <machine/psl.h> #include <machine/param.h> -#include <machine/vmparam.h> /* INTSTACK_SIZE */ +#include <machine/vmparam.h> /* * The memory looks like: @@ -386,7 +386,7 @@ ASLOCAL(slave_start) subu r31, r31, 48 /* allocate frame */ bsr _C_LABEL(get_slave_stack) - addu r31, r2, INTSTACK_SIZE + 4096 + addu r31, r2, INTSTACK_SIZE /* * SR1 now contains our cpu number. We can now release the @@ -430,7 +430,7 @@ ASLOCAL(inter_processor_lock) .align 4096 GLOBAL(intstack) - space (4 * NBPG) /* 16K, just to be safe */ + space (INTSTACK_SIZE) /* 16K, just to be safe */ ASGLOBAL(intstack_end) ASGLOBAL(slavestack) space (NBPG) /* 4K, small, interim stack */ diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c index 2fc8f1a1c4a..d9ac14718d4 100644 --- a/sys/arch/mvme88k/mvme88k/machdep.c +++ b/sys/arch/mvme88k/mvme88k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.112 2003/09/16 20:52:22 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.113 2003/09/20 13:57:37 miod Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -113,7 +113,7 @@ #endif /* DDB */ struct intrhand *intr_handlers[256]; -vm_offset_t interrupt_stack[MAX_CPUS] = {0}; +vm_offset_t interrupt_stack[MAX_CPUS]; /* machine dependant function pointers. */ struct md_p md; @@ -1458,14 +1458,14 @@ setupiackvectors() vm_offset_t get_slave_stack() { - vm_offset_t addr = 0; - addr = (vm_offset_t)uvm_km_zalloc(kernel_map, INTSTACK_SIZE + 4096); + vm_offset_t addr; + + addr = (vm_offset_t)uvm_km_zalloc(kernel_map, INTSTACK_SIZE); if (addr == NULL) - panic("Cannot allocate slave stack"); + panic("Cannot allocate slave stack for cpu %d", + cpu_number()); - if (interrupt_stack[0] == 0) - interrupt_stack[0] = (vm_offset_t) intstack; interrupt_stack[cpu_number()] = addr; return addr; } |