summaryrefslogtreecommitdiff
path: root/sys/arch/aviion
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2007-11-15 21:23:17 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2007-11-15 21:23:17 +0000
commit8ca8bc22d3b776d69bd7ce8622136de5cb8ee376 (patch)
tree08a9ebc32a67886ed5c43c4640c4bfd7e3ac872c /sys/arch/aviion
parent42b7e5295160dddf04004f36ba2cb8756e87fe7c (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/aviion')
-rw-r--r--sys/arch/aviion/aviion/locore.S25
-rw-r--r--sys/arch/aviion/aviion/machdep.c16
2 files changed, 20 insertions, 21 deletions
diff --git a/sys/arch/aviion/aviion/locore.S b/sys/arch/aviion/aviion/locore.S
index 0bfe3e69713..69f7dbde091 100644
--- a/sys/arch/aviion/aviion/locore.S
+++ b/sys/arch/aviion/aviion/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.5 2007/11/06 21:42:55 miod Exp $ */
+/* $OpenBSD: locore.S,v 1.6 2007/11/15 21:23:14 miod Exp $ */
/*
* Copyright (c) 2005, Miodrag Vallat.
* Copyright (c) 1998 Steve Murphree, Jr.
@@ -207,9 +207,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
@@ -337,11 +337,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 */
@@ -373,9 +370,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 */
@@ -395,10 +392,10 @@ GLOBAL(proc0paddr)
#ifdef MULTIPROCESSOR
/* Dummy cpuinfo structure, for cpu_number() to work early. */
ASLOCAL(dummy_cpu)
- word 1 /* ci_alive */
- word 0 /* ci_curproc */
- word 0 /* ci_curpcb */
- word 0 /* ci_cpuid */
+ word 3 /* CIF_PRIMARY | CIF_ALIVE */ /* ci_alive */
+ word 0 /* ci_curproc */
+ word 0 /* ci_curpcb */
+ word 0 /* ci_cpuid */
#endif /* MULTIPROCESSOR */
#if defined(DDB) || NKSYMS > 0
diff --git a/sys/arch/aviion/aviion/machdep.c b/sys/arch/aviion/aviion/machdep.c
index 6beb6d78b53..84478d177f0 100644
--- a/sys/arch/aviion/aviion/machdep.c
+++ b/sys/arch/aviion/aviion/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.14 2007/11/14 23:12:44 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.15 2007/11/15 21:23:14 miod Exp $ */
/*
* Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -100,7 +100,7 @@ u_int getipl(void);
void identifycpu(void);
void savectx(struct pcb *);
void secondary_main(void);
-void secondary_pre_main(void);
+vaddr_t secondary_pre_main(void);
intrhand_t intr_handlers[NVMEINTR];
@@ -564,11 +564,11 @@ 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 its startup stack.
*
* Running on a minimal stack here, with interrupts disabled; do nothing fancy.
*/
-void
+vaddr_t
secondary_pre_main()
{
struct cpu_info *ci;
@@ -587,18 +587,20 @@ 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);
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