diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2005-10-12 19:05:45 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2005-10-12 19:05:45 +0000 |
commit | b48d6934c3ae42b1d0c118e7d128242f119249c6 (patch) | |
tree | 3d2658a2bfd7328e6728be8b928df6e3c6774ba4 /sys/arch/mvme88k | |
parent | 1cbe376d5cfe8937a275b18544f674b001dc8931 (diff) |
Stop mapping the u area at fixed UADDR in addition to its actual va.
While there, attempt to clean and comment stack usage in the kernel.
No functional change.
From the m88k SMP tree; help&test martin@
Diffstat (limited to 'sys/arch/mvme88k')
-rw-r--r-- | sys/arch/mvme88k/mvme88k/locore.S | 53 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/machdep.c | 29 |
2 files changed, 27 insertions, 55 deletions
diff --git a/sys/arch/mvme88k/mvme88k/locore.S b/sys/arch/mvme88k/mvme88k/locore.S index 1ea081bf111..793fe7169ea 100644 --- a/sys/arch/mvme88k/mvme88k/locore.S +++ b/sys/arch/mvme88k/mvme88k/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.41 2004/12/24 22:50:30 miod Exp $ */ +/* $OpenBSD: locore.S,v 1.42 2005/10/12 19:05:44 miod Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -316,7 +316,6 @@ GLOBAL(start_text) ASLOCAL(master_start) /* * Switch to interrupt stack - * Use idle_u's stack instead? */ or.u r31, r0, hi16(_ASM_LABEL(intstack_end)) or r31, r31, lo16(_ASM_LABEL(intstack_end)) @@ -340,34 +339,33 @@ ASLOCAL(master_start) bsr.n _C_LABEL(vector_init) ldcr r2, VBR - /* still on int stack */ + /* + * mvme_bootstrap(), among other things, clears proc0's u area. + * We are still using the interrupt stack here, thus we are not + * affected... + */ bsr _C_LABEL(mvme_bootstrap) /* - * we now know our cpu number, so we - * can set interrupt_stack[cpu_number()] = intstack + * ...and we can switch to the u area stack now. */ - ldcr r10, SR1 - extu r10, r10, FLAG_CPU_FIELD_WIDTH<0> /* r10 <-- CPU# */ - - /* figure interrupt_stack[cpu_number()] */ - or.u r11, r0, hi16(_C_LABEL(interrupt_stack)) - or r11, r11, lo16(_C_LABEL(interrupt_stack)) - or.u r12, r0, hi16(_C_LABEL(intstack)) - or r12, r12, lo16(_C_LABEL(intstack)) - st r12, r11 [r10] - - /* switch to proc0 uarea */ - or.u r10, r0, hi16(UADDR) - or r31, r10,lo16(UADDR) - addu r31, r31, USIZE - 8 - - /* make the call: main() */ - or.u r2, r0, hi16(UADDR) - or r2, r2,lo16(UADDR) - bsr.n _C_LABEL(main) - addu r2, r2, USIZE - 8 - bsr _C_LABEL(panic) + or.u r10, r0, hi16(_C_LABEL(curpcb)) + ld r31, r10,lo16(_C_LABEL(curpcb)) + addu r31, r31, USIZE + + /* call main() - no arguments although main() still defines one */ + bsr _C_LABEL(main) + + or.u r2, r0, hi16(_ASM_LABEL(main_panic)) + bsr.n _C_LABEL(panic) + or r2, r2, lo16(_ASM_LABEL(main_panic)) + + data + .align 4 +ASLOCAL(main_panic) + string "main() returned\0" + text + .align 8 /* * slave CPUs starts here @@ -477,9 +475,6 @@ GLOBAL(idle_u) ASLOCAL(u0) space UPAGES * NBPG -/* UPAGES get mapped to kstack */ -ASGLOBAL(kstack) - word UADDR GLOBAL(ret_addr) word 0 /* XMEM spin lock -- to count CPUs */ diff --git a/sys/arch/mvme88k/mvme88k/machdep.c b/sys/arch/mvme88k/mvme88k/machdep.c index 51f969e82a9..16e38ca0e01 100644 --- a/sys/arch/mvme88k/mvme88k/machdep.c +++ b/sys/arch/mvme88k/mvme88k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.167 2005/09/25 20:30:03 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.168 2005/10/12 19:05:44 miod Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -111,8 +111,6 @@ int slave_main(void); void vector_init(m88k_exception_vector_area *, unsigned *); void _doboot(void); -extern void load_u_area(struct proc *); -extern void save_u_area(struct proc *, vaddr_t); extern void setlevel(unsigned int); extern void m187_bootstrap(void); @@ -129,7 +127,6 @@ extern void m197_setupiackvectors(void); extern void m197_startup(void); intrhand_t intr_handlers[NVMEINTR]; -vaddr_t interrupt_stack[MAX_CPUS]; /* board dependent pointers */ void (*md_interrupt_func_ptr)(u_int, struct trapframe *); @@ -363,7 +360,7 @@ cpu_startup() int sz, i; vsize_t size; int base, residual; - vaddr_t minaddr, maxaddr, uarea_pages; + vaddr_t minaddr, maxaddr; /* * Initialize error message buffer (at end of core). @@ -394,17 +391,6 @@ cpu_startup() panic("startup: table size inconsistency"); /* - * Grab UADDR virtual address - */ - uarea_pages = UADDR; - uvm_map(kernel_map, (vaddr_t *)&uarea_pages, USPACE, - NULL, UVM_UNKNOWN_OFFSET, 0, - UVM_MAPFLAG(UVM_PROT_NONE, UVM_PROT_NONE, UVM_INH_NONE, - UVM_ADV_NORMAL, 0)); - if (uarea_pages != UADDR) - panic("uarea_pages %lx: UADDR not free", uarea_pages); - - /* * Grab machine dependent memory spaces */ switch (brdtyp) { @@ -840,7 +826,6 @@ get_slave_stack() panic("Cannot allocate slave stack for cpu %d", cpu_number()); - interrupt_stack[cpu_number()] = addr; return addr; } @@ -1184,16 +1169,8 @@ mvme_bootstrap() uvm_page_physload(atop(avail_start), atop(avail_end), atop(avail_start), atop(avail_end), VM_FREELIST_DEFAULT); - /* Initialize cached PTEs for u-area mapping. */ - save_u_area(&proc0, (vaddr_t)proc0paddr); - - /* - * Map proc0's u-area at the standard address (UADDR). - */ - load_u_area(&proc0); - /* Initialize the "u-area" pages. */ - bzero((caddr_t)UADDR, UPAGES * PAGE_SIZE); + bzero((caddr_t)curpcb, USPACE); #ifdef DEBUG printf("leaving mvme_bootstrap()\n"); #endif |