diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2007-11-15 21:23:17 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2007-11-15 21:23:17 +0000 |
commit | 8ca8bc22d3b776d69bd7ce8622136de5cb8ee376 (patch) | |
tree | 08a9ebc32a67886ed5c43c4640c4bfd7e3ac872c /sys/arch/mvme88k | |
parent | 42b7e5295160dddf04004f36ba2cb8756e87fe7c (diff) |
Stop referring the initial kernel stack as the ``interrupt stack''. It's
been years since it has last been used for that purpose, so name it the
initialization/startup stack.
While there, do not store the initialization stack in cpu_info, and have
secondary_pre_main() return its value so that the bootstrap code does not
need to fetch it from cpu_info.
This might be reconsidered when the startup stacks will be freed after they
are not used anymore, but there are more things to do first.
Diffstat (limited to 'sys/arch/mvme88k')
-rw-r--r-- | sys/arch/mvme88k/mvme88k/locore.S | 21 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/machdep.c | 17 |
2 files changed, 19 insertions, 19 deletions
diff --git a/sys/arch/mvme88k/mvme88k/locore.S b/sys/arch/mvme88k/mvme88k/locore.S index 558b1da00b9..33ea4ad78dc 100644 --- a/sys/arch/mvme88k/mvme88k/locore.S +++ b/sys/arch/mvme88k/mvme88k/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.53 2007/11/14 23:12:46 miod Exp $ */ +/* $OpenBSD: locore.S,v 1.54 2007/11/15 21:23:16 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat. * Copyright (c) 1998 Steve Murphree, Jr. @@ -210,9 +210,9 @@ ASLOCAL(main_start) */ #endif /* MULTIPROCESSOR */ - /* Switch to interrupt stack */ - or.u r31, r0, hi16(_ASM_LABEL(intstack_end)) - or r31, r31, lo16(_ASM_LABEL(intstack_end)) + /* Switch to startup stack */ + or.u r31, r0, hi16(_ASM_LABEL(initstack_end)) + or r31, r31, lo16(_ASM_LABEL(initstack_end)) #ifdef M88110 #ifdef M88100 @@ -317,11 +317,8 @@ GLOBAL(secondary_start) */ bsr _C_LABEL(secondary_pre_main) /* set cpu number */ - - ldcr r2, CPU - ld r3, r2, CI_INIT_STACK bsr.n _C_LABEL(secondary_main) - addu r31, r3, USIZE /* switch to startup stack */ + or r31, r2, r0 /* switch to startup stack */ #endif /* MULTIPROCESSOR */ @@ -364,9 +361,9 @@ GLOBAL(doboot) */ 8: - or.u r31, r0, hi16(_ASM_LABEL(intstack_end)) + or.u r31, r0, hi16(_ASM_LABEL(initstack_end)) bsr.n _C_LABEL(_doboot) - or r31, r31, lo16(_ASM_LABEL(intstack_end)) + or r31, r31, lo16(_ASM_LABEL(initstack_end)) /*NOTREACHED*/ /* @@ -403,9 +400,9 @@ GLOBAL(kernel_sdt) /* SDT (segment descriptor table */ space 0x2000 /* 8K - 4K phys, 4K virt*/ .align PAGE_SIZE -ASGLOBAL(intstack) +ASGLOBAL(initstack) space USIZE -ASGLOBAL(intstack_end) +ASGLOBAL(initstack_end) #ifdef MULTIPROCESSOR space PAGE_SIZE /* 4K, small, interim stack */ diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c index a3d3d336b9d..d364c9a94b8 100644 --- a/sys/arch/mvme88k/mvme88k/machdep.c +++ b/sys/arch/mvme88k/mvme88k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.200 2007/11/14 23:15:07 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.201 2007/11/15 21:23:16 miod Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -102,7 +102,7 @@ void mvme88k_vector_init(u_int32_t *, u_int32_t *); void myetheraddr(u_char *); void savectx(struct pcb *); void secondary_main(void); -void secondary_pre_main(void); +vaddr_t secondary_pre_main(void); void _doboot(void); extern void setlevel(unsigned int); @@ -680,14 +680,15 @@ abort: /* * Secondary CPU early initialization routine. - * Determine CPU number and set it, then allocate the idle pcb (and stack). + * Determine CPU number and set it, then allocate the startup stack. * * Running on a minimal stack here, with interrupts disabled; do nothing fancy. */ -void +vaddr_t secondary_pre_main() { struct cpu_info *ci; + vaddr_t init_stack; set_cpu_number(cmmu_cpu_number()); /* Determine cpu number by CMMU */ ci = curcpu(); @@ -703,19 +704,21 @@ secondary_pre_main() /* * Allocate UPAGES contiguous pages for the startup stack. */ - ci->ci_init_stack = uvm_km_zalloc(kernel_map, USPACE); - if (ci->ci_init_stack == (vaddr_t)NULL) { + init_stack = uvm_km_zalloc(kernel_map, USPACE); + if (init_stack == (vaddr_t)NULL) { printf("cpu%d: unable to allocate startup stack\n", ci->ci_cpuid); __cpu_simple_unlock(&cpu_boot_mutex); for (;;) ; } + + return (init_stack); } /* * Further secondary CPU initialization. * - * We are now running on our idle stack, with proper page tables. + * We are now running on our startup stack, with proper page tables. * There is nothing to do but display some details about the CPU and its CMMUs. */ void |