diff options
| author | matt <matt@NetBSD.org> | 2009-11-26 00:19:11 +0000 |
|---|---|---|
| committer | matt <matt@NetBSD.org> | 2009-11-26 00:19:11 +0000 |
| commit | 11af2f9cfaf7c0dabb4c8dfb59b3a863bc6d23b1 (patch) | |
| tree | d7ed2143bc0f5c987aa4e7eb2aa536052d083a4b /sys | |
| parent | f3d037fec47bbee9044382b06e61b105fe1750a0 (diff) | |
Kill proc0paddr. Use lwp0.l_addr instead.
Diffstat (limited to 'sys')
130 files changed, 510 insertions, 801 deletions
diff --git a/sys/arch/acorn26/acorn26/start.c b/sys/arch/acorn26/acorn26/start.c index 7892cdf419e..17cbee90f5a 100644 --- a/sys/arch/acorn26/acorn26/start.c +++ b/sys/arch/acorn26/acorn26/start.c @@ -1,4 +1,4 @@ -/* $NetBSD: start.c,v 1.15 2009/11/21 20:32:17 rmind Exp $ */ +/* $NetBSD: start.c,v 1.16 2009/11/26 00:19:11 matt Exp $ */ /*- * Copyright (c) 1998, 2000 Ben Harris * All rights reserved. @@ -31,7 +31,7 @@ #include <sys/param.h> -__KERNEL_RCSID(0, "$NetBSD: start.c,v 1.15 2009/11/21 20:32:17 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: start.c,v 1.16 2009/11/26 00:19:11 matt Exp $"); #include "opt_modular.h" @@ -64,8 +64,6 @@ extern void main(void); /* XXX Should be in a header file */ struct bootconfig bootconfig; -struct user *proc0paddr; - /* in machdep.h */ extern i2c_tag_t acorn26_i2c_tag; @@ -190,8 +188,8 @@ start(struct bootconfig *initbootconfig) * Locate process 0's user structure, in the bottom of its kernel * stack page. That's our current stack page too. */ - proc0paddr = (struct user *)(round_page((vaddr_t)&onstack) - USPACE); - memset(proc0paddr, 0, sizeof(*proc0paddr)); + lwp0.l_addr = (struct user *)(round_page((vaddr_t)&onstack) - USPACE); + memset(lwp0.l_addr, 0, sizeof(*lwp0.l_addr)); /* TODO: anything else? */ diff --git a/sys/arch/acorn26/acorn26/vm_machdep.c b/sys/arch/acorn26/acorn26/vm_machdep.c index f5f707c64c0..67a05c41d6d 100644 --- a/sys/arch/acorn26/acorn26/vm_machdep.c +++ b/sys/arch/acorn26/acorn26/vm_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: vm_machdep.c,v 1.23 2009/11/21 20:32:17 rmind Exp $ */ +/* $NetBSD: vm_machdep.c,v 1.24 2009/11/26 00:19:11 matt Exp $ */ /*- * Copyright (c) 2000, 2001 Ben Harris @@ -64,7 +64,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.23 2009/11/21 20:32:17 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.24 2009/11/26 00:19:11 matt Exp $"); #include <sys/param.h> #include <sys/buf.h> @@ -82,10 +82,10 @@ __KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.23 2009/11/21 20:32:17 rmind Exp $" #include <machine/machdep.h> /* - * Finish a fork operation, with process p2 nearly set up. + * Finish a fork operation, with thread l2 nearly set up. * Copy and update the pcb and trap frame, making the child ready to run. * - * p1 is the process being forked; if p1 == &proc0, we are creating + * l1 is the thread being forked; if l1 == &lwp0, we are creating * a kernel thread, and the return path and argument are specified with * `func' and `arg'. * @@ -97,8 +97,9 @@ __KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.23 2009/11/21 20:32:17 rmind Exp $" /* * Note: * - * The pcb structure has to be* at the start of the area -- we start the - * kernel stack from the end. + * l->l_addr points to a page containing the user structure + * (see <sys/user.h>) and the kernel stack. The pcb structure has to be + * at the start of the area -- we start the kernel stack from the end. */ void diff --git a/sys/arch/acorn32/acorn32/rpc_machdep.c b/sys/arch/acorn32/acorn32/rpc_machdep.c index 49081feb8cc..f697fadfd29 100644 --- a/sys/arch/acorn32/acorn32/rpc_machdep.c +++ b/sys/arch/acorn32/acorn32/rpc_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: rpc_machdep.c,v 1.77 2009/08/16 22:06:12 cegger Exp $ */ +/* $NetBSD: rpc_machdep.c,v 1.78 2009/11/26 00:19:11 matt Exp $ */ /* * Copyright (c) 2000-2002 Reinoud Zandijk. @@ -55,7 +55,7 @@ #include <sys/param.h> -__KERNEL_RCSID(0, "$NetBSD: rpc_machdep.c,v 1.77 2009/08/16 22:06:12 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: rpc_machdep.c,v 1.78 2009/11/26 00:19:11 matt Exp $"); #include <sys/systm.h> #include <sys/kernel.h> @@ -181,8 +181,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -struct user *proc0paddr; - #ifdef CPU_SA110 #define CPU_SA110_CACHE_CLEAN_SIZE (0x4000 * 2) static vaddr_t sa110_cc_base; @@ -843,8 +841,7 @@ initarm(void *cookie) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; /* * if there is support for a serial console ...we should now diff --git a/sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c b/sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c index 53b8efc3a3a..1551a6321e2 100644 --- a/sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c +++ b/sys/arch/acorn32/eb7500atx/eb7500atx_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: eb7500atx_machdep.c,v 1.16 2009/09/22 14:49:28 tsutsui Exp $ */ +/* $NetBSD: eb7500atx_machdep.c,v 1.17 2009/11/26 00:19:11 matt Exp $ */ /* * Copyright (c) 2000-2002 Reinoud Zandijk. @@ -55,7 +55,7 @@ #include <sys/param.h> -__KERNEL_RCSID(0, "$NetBSD: eb7500atx_machdep.c,v 1.16 2009/09/22 14:49:28 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: eb7500atx_machdep.c,v 1.17 2009/11/26 00:19:11 matt Exp $"); #include <sys/systm.h> #include <sys/kernel.h> @@ -121,7 +121,6 @@ __KERNEL_RCSID(0, "$NetBSD: eb7500atx_machdep.c,v 1.16 2009/09/22 14:49:28 tsuts */ u_int cpu_reset_address = 0x0; /* XXX 0x3800000 too for rev0 RiscPC 600 */ - #define VERBOSE_INIT_ARM @@ -183,7 +182,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -struct user *proc0paddr; #ifdef CPU_SA110 #define CPU_SA110_CACHE_CLEAN_SIZE (0x4000 * 2) @@ -783,8 +781,7 @@ initarm(void *cookie) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; /* * if there is support for a serial console ...we should now diff --git a/sys/arch/algor/algor/machdep.c b/sys/arch/algor/algor/machdep.c index 844d0c61241..e4f13ae6a09 100644 --- a/sys/arch/algor/algor/machdep.c +++ b/sys/arch/algor/algor/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.41 2008/11/30 18:21:32 martin Exp $ */ +/* $NetBSD: machdep.c,v 1.42 2009/11/26 00:19:11 matt Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -106,7 +106,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.41 2008/11/30 18:21:32 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.42 2009/11/26 00:19:11 matt Exp $"); #include "opt_algor_p4032.h" #include "opt_algor_p5064.h" @@ -184,8 +184,6 @@ struct p5064_config p5064_configuration; struct p6032_config p6032_configuration; #endif -struct user *proc0paddr; - /* Our exported CPU info; we can have only one. */ struct cpu_info cpu_info_store; @@ -566,9 +564,9 @@ mach_init(int argc, char *argv[], char *envp[]) */ led_display('u', 's', 'p', 'c'); v = (void *) uvm_pageboot_alloc(USPACE); - lwp0.l_addr = proc0paddr = (struct user *) v; + lwp0.l_addr = (struct user *) v; lwp0.l_md.md_regs = (struct frame *)((char*)v + USPACE) - 1; - proc0paddr->u_pcb.pcb_context[11] = + lwp0.l_addr->u_pcb.pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */ /* diff --git a/sys/arch/alpha/alpha/cpu.c b/sys/arch/alpha/alpha/cpu.c index 720e554c1a9..6a5ee169def 100644 --- a/sys/arch/alpha/alpha/cpu.c +++ b/sys/arch/alpha/alpha/cpu.c @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.c,v 1.87 2009/11/21 05:35:40 rmind Exp $ */ +/* $NetBSD: cpu.c,v 1.88 2009/11/26 00:19:11 matt Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc. @@ -59,7 +59,7 @@ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.87 2009/11/21 05:35:40 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.88 2009/11/26 00:19:11 matt Exp $"); #include "opt_ddb.h" #include "opt_multiprocessor.h" @@ -155,10 +155,10 @@ struct cputable_struct { * * As we find processors during the autoconfiguration sequence, all * processors have idle stacks and PCBs created for them, including - * the primary (although the primary idles on proc0's PCB until its + * the primary (although the primary idles on lwp0's PCB until its * idle PCB is created). * - * Right before calling uvm_scheduler(), main() calls, on proc0's + * Right before calling uvm_scheduler(), main() calls, on lwp0's * context, cpu_boot_secondary_processors(). This is our key to * actually spin up the additional processor's we've found. We * run through our cpu_info[] array looking for secondary processors diff --git a/sys/arch/alpha/alpha/machdep.c b/sys/arch/alpha/alpha/machdep.c index 053860aa0d4..a91364c8d3b 100644 --- a/sys/arch/alpha/alpha/machdep.c +++ b/sys/arch/alpha/alpha/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.322 2009/11/21 05:35:40 rmind Exp $ */ +/* $NetBSD: machdep.c,v 1.323 2009/11/26 00:19:11 matt Exp $ */ /*- * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc. @@ -68,7 +68,7 @@ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.322 2009/11/21 05:35:40 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.323 2009/11/26 00:19:11 matt Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -166,8 +166,6 @@ char machine[] = MACHINE; /* from <machine/param.h> */ char machine_arch[] = MACHINE_ARCH; /* from <machine/param.h> */ char cpu_model[128]; -struct user *proc0paddr; - /* Number of machine cycles per microsecond */ u_int64_t cycles_per_usec; @@ -638,8 +636,7 @@ nobootinfo: /* * Init mapping for u page(s) for proc 0 */ - lwp0.l_addr = proc0paddr = - (struct user *)uvm_pageboot_alloc(UPAGES * PAGE_SIZE); + lwp0.l_addr = (struct user *)uvm_pageboot_alloc(UPAGES * PAGE_SIZE); /* * Initialize the virtual memory system, and set the @@ -653,19 +650,19 @@ nobootinfo: * address. */ lwp0.l_md.md_pcbpaddr = - (struct pcb *)ALPHA_K0SEG_TO_PHYS((vaddr_t)&proc0paddr->u_pcb); + (struct pcb *)ALPHA_K0SEG_TO_PHYS((vaddr_t)&lwp0.l_addr->u_pcb); /* * Set the kernel sp, reserving space for an (empty) trapframe, - * and make proc0's trapframe pointer point to it for sanity. + * and make lwp0's trapframe pointer point to it for sanity. */ - proc0paddr->u_pcb.pcb_hw.apcb_ksp = - (u_int64_t)proc0paddr + USPACE - sizeof(struct trapframe); + lwp0.l_addr->u_pcb.pcb_hw.apcb_ksp = + (vaddr_t)lwp0.l_addr + USPACE - sizeof(struct trapframe); lwp0.l_md.md_tf = - (struct trapframe *)proc0paddr->u_pcb.pcb_hw.apcb_ksp; - simple_lock_init(&proc0paddr->u_pcb.pcb_fpcpu_slock); + (struct trapframe *)lwp0.l_addr->u_pcb.pcb_hw.apcb_ksp; + simple_lock_init(&lwp0.l_addr->u_pcb.pcb_fpcpu_slock); - /* Indicate that proc0 has a CPU. */ + /* Indicate that lwp0 has a CPU. */ lwp0.l_cpu = ci; /* diff --git a/sys/arch/alpha/alpha/pmap.c b/sys/arch/alpha/alpha/pmap.c index c7386dc75a3..bac589b8c86 100644 --- a/sys/arch/alpha/alpha/pmap.c +++ b/sys/arch/alpha/alpha/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.251 2009/11/21 05:35:40 rmind Exp $ */ +/* $NetBSD: pmap.c,v 1.252 2009/11/26 00:19:11 matt Exp $ */ /*- * Copyright (c) 1998, 1999, 2000, 2001, 2007, 2008 The NetBSD Foundation, Inc. @@ -140,7 +140,7 @@ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.251 2009/11/21 05:35:40 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.252 2009/11/26 00:19:11 matt Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -946,7 +946,7 @@ pmap_bootstrap(paddr_t ptaddr, u_int maxasn, u_long ncpuids) #endif /* - * Set up proc0's PCB such that the ptbr points to the right place + * Set up lwp0's PCB such that the ptbr points to the right place * and has the kernel pmap's (really unused) ASN. */ pcb = lwp_getpcb(&lwp0); diff --git a/sys/arch/alpha/alpha/vm_machdep.c b/sys/arch/alpha/alpha/vm_machdep.c index e87db5cc6e4..8b79b6d46dc 100644 --- a/sys/arch/alpha/alpha/vm_machdep.c +++ b/sys/arch/alpha/alpha/vm_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: vm_machdep.c,v 1.102 2009/11/21 05:35:41 rmind Exp $ */ +/* $NetBSD: vm_machdep.c,v 1.103 2009/11/26 00:19:11 matt Exp $ */ /* * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University. @@ -29,7 +29,7 @@ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.102 2009/11/21 05:35:41 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.103 2009/11/26 00:19:11 matt Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -63,16 +63,16 @@ cpu_lwp_free2(struct lwp *l) } /* - * Finish a fork operation, with process p2 nearly set up. + * Finish a fork operation, with thread l2 nearly set up. * Copy and update the pcb and trap frame, making the child ready to run. * * Rig the child's kernel stack so that it will start out in - * lwp_trampoline() and call child_return() with p2 as an - * argument. This causes the newly-created child process to go + * lwp_trampoline() and call child_return() with l2 as an + * argument. This causes the newly-created child thread to go * directly to user level with an apparent return value of 0 from * fork(), while the parent process returns normally. * - * p1 is the process being forked; if p1 == &proc0, we are creating + * l1 is the thread being forked; if l1 == &lwp0, we are creating * a kernel thread, and the return path and argument are specified with * `func' and `arg'. * diff --git a/sys/arch/amd64/amd64/locore.S b/sys/arch/amd64/amd64/locore.S index 3e83f5a8687..95713d20cad 100644 --- a/sys/arch/amd64/amd64/locore.S +++ b/sys/arch/amd64/amd64/locore.S @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.53 2009/11/25 14:28:50 rmind Exp $ */ +/* $NetBSD: locore.S,v 1.54 2009/11/26 00:19:12 matt Exp $ */ /* * Copyright-o-rama! @@ -234,7 +234,7 @@ _C_LABEL(lapic_isr): .globl _C_LABEL(cpuid_level),_C_LABEL(cpu_feature),_C_LABEL(cpu_feature2) .globl _C_LABEL(esym),_C_LABEL(eblob),_C_LABEL(boothowto) .globl _C_LABEL(bootinfo),_C_LABEL(atdevbase) - .globl _C_LABEL(proc0paddr),_C_LABEL(PDPpaddr) + .globl _C_LABEL(PDPpaddr) .globl _C_LABEL(biosbasemem),_C_LABEL(biosextmem) .globl _C_LABEL(gdtstore),_C_LABEL(cpu) @@ -253,7 +253,6 @@ _C_LABEL(cpu_brand_id): .long 0 # brand ID from 'cpuid' instruction _C_LABEL(esym): .quad 0 # ptr to end of syms _C_LABEL(eblob): .quad 0 # ptr to end of modules _C_LABEL(atdevbase): .quad 0 # location of start of iomem in virtual -_C_LABEL(proc0paddr): .quad 0 _C_LABEL(PDPpaddr): .quad 0 # paddr of PTD, for libkvm #ifndef REALBASEMEM _C_LABEL(biosbasemem): .long 0 # base memory reported by BIOS @@ -696,7 +695,7 @@ longmode_hi: /* Set up bootstrap stack. */ leaq (PROC0_STK_OFF)(%rsi),%rax addq %r8,%rax - movq %rax,_C_LABEL(proc0paddr)(%rip) + movq %rax,(_C_LABEL(lwp0)+L_ADDR)(%rip) leaq (USPACE-FRAMESIZE)(%rax),%rsp movq %rsi,PCB_CR3(%rax) # pcb->pcb_cr3 xorq %rbp,%rbp # mark end of frames @@ -776,7 +775,7 @@ start: * First avail returned by xen_pmap_bootstrap in %rax */ movq %rax, %rsi - movq %rsi,_C_LABEL(proc0paddr) + movq %rsi,(_C_LABEL(lwp0)+L_ADDR) xorq %rax,%rax movq %rsi,%rdi diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index 0bf5c7a6f44..67985c5659c 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.137 2009/11/21 03:11:01 rmind Exp $ */ +/* $NetBSD: machdep.c,v 1.138 2009/11/26 00:19:12 matt Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008 @@ -107,7 +107,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.137 2009/11/21 03:11:01 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.138 2009/11/26 00:19:12 matt Exp $"); /* #define XENDEBUG_LOW */ @@ -1051,7 +1051,6 @@ int xen_idt_idx; #endif char *ldtstore; char *gdtstore; -extern struct user *proc0paddr; void setgate(struct gate_descriptor *gd, void *func, int ist, int type, int dpl, int sel) @@ -1271,9 +1270,7 @@ init_x86_64(paddr_t first_avail) cpu_init_msrs(&cpu_info_primary, true); - lwp0.l_addr = proc0paddr; - pcb = (void *)proc0paddr; - + pcb = lwp_getpcb(&lwp0); #ifdef XEN pcb->pcb_cr3 = xen_start_info.pt_base - KERNBASE; __PRINTK(("pcb_cr3 0x%lx\n", xen_start_info.pt_base - KERNBASE)); diff --git a/sys/arch/amiga/amiga/amiga_init.c b/sys/arch/amiga/amiga/amiga_init.c index affecc00e21..0da7696eadb 100644 --- a/sys/arch/amiga/amiga/amiga_init.c +++ b/sys/arch/amiga/amiga/amiga_init.c @@ -1,4 +1,4 @@ -/* $NetBSD: amiga_init.c,v 1.111 2009/11/23 00:11:42 rmind Exp $ */ +/* $NetBSD: amiga_init.c,v 1.112 2009/11/26 00:19:12 matt Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -36,7 +36,7 @@ #include "opt_devreload.h" #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: amiga_init.c,v 1.111 2009/11/23 00:11:42 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: amiga_init.c,v 1.112 2009/11/26 00:19:12 matt Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -67,7 +67,7 @@ __KERNEL_RCSID(0, "$NetBSD: amiga_init.c,v 1.111 2009/11/23 00:11:42 rmind Exp $ #define RELOC(v, t) *((t*)((u_int)&(v) + loadbase)) extern u_int lowram; -extern u_int Umap, proc0paddr; +extern u_int Umap; extern u_int Sysseg_pa; #if defined(M68040) || defined(M68060) extern int protostfree; @@ -351,9 +351,9 @@ start_c(id, fphystart, fphysize, cphysize, esym_addr, flags, inh_sync, avail -= vstart; /* - * save KVA of proc0 u-area and allocate it. + * save KVA of lwp0 u-area and allocate it. */ - RELOC(proc0paddr, u_int) = vstart; + RELOC(lwp0.l_addr, struct user *) = vstart; pstart += USPACE; vstart += USPACE; avail -= USPACE; @@ -574,7 +574,7 @@ start_c(id, fphystart, fphysize, cphysize, esym_addr, flags, inh_sync, #endif /* * go till end of data allocated so far - * plus proc0 u-area (to be allocated) + * plus lwp0 u-area (to be allocated) */ for (; kva < vstart; kva += PAGE_SIZE, pg_proto += PAGE_SIZE) *pg++ = pg_proto; @@ -788,7 +788,7 @@ start_c_finish(void) ((volatile struct Custom *)CUSTOMADDR)->color[0] = 0x0a0; /* GREEN */ #endif - bzero ((u_char *)proc0paddr, USPACE); + memset(lwp0.l_addr, 0, USPACE); pmap_bootstrap(start_c_pstart, start_c_fphystart); /* @@ -822,11 +822,6 @@ start_c_finish(void) z2mem_start = ZTWOMEMADDR; } -#if 0 - i = *(int *)proc0paddr; - *(volatile int *)proc0paddr = i; -#endif - /* * disable all interrupts but enable allow them to be enabled * by specific driver code (global int enable bit) diff --git a/sys/arch/amiga/amiga/locore.s b/sys/arch/amiga/amiga/locore.s index 0df46da34b4..84ad4f62bd1 100644 --- a/sys/arch/amiga/amiga/locore.s +++ b/sys/arch/amiga/amiga/locore.s @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.145 2008/01/06 18:50:30 mhitch Exp $ */ +/* $NetBSD: locore.s,v 1.146 2009/11/26 00:19:12 matt Exp $ */ /* * Copyright (c) 1980, 1990 The Regents of the University of California. @@ -1024,11 +1024,10 @@ LMMUenable_end: jbsr _C_LABEL(start_c_finish) /* set kernel stack, user SP, and initial pcb */ - movl _C_LABEL(proc0paddr),%a1 | proc0 kernel stack + lea _C_LABEL(lwp0),%a2 | grab lwp0 and initialize + movl %a2,_C_LABEL(curlwp) | curlwp so that + movl %a2@(L_ADDR),%a1 | we don't dref NULL in trap() lea %a1@(USPACE),%sp | set kernel stack to end of area - lea _C_LABEL(lwp0),%a2 | initialize lwp0.p_addr - movl %a2,_C_LABEL(curlwp) | and curlwp so that - movl %a1,%a2@(L_ADDR) | we don't dref NULL in trap() movl #USRSTACK-4,%a2 movl %a2,%usp | init user SP movl %a2,%a1@(PCB_USP) | and save it @@ -1608,9 +1607,6 @@ GLOBAL(fputype) GLOBAL(protorp) .long 0x80000002,0 | prototype root pointer -GLOBAL(proc0paddr) - .long 0 | KVA of proc0 u-area - #ifdef DEBUG ASGLOBAL(fulltflush) .long 0 diff --git a/sys/arch/amigappc/amigappc/locore.S b/sys/arch/amigappc/amigappc/locore.S index cea7e56a853..e42a88d4f5c 100644 --- a/sys/arch/amigappc/amigappc/locore.S +++ b/sys/arch/amigappc/amigappc/locore.S @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.16 2009/07/21 09:49:15 phx Exp $ */ +/* $NetBSD: locore.S,v 1.17 2009/11/26 00:19:12 matt Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -72,8 +72,6 @@ GLOBAL(startsym) .long 0 /* start symbol table */ GLOBAL(endsym) .long 0 /* end symbol table */ -GLOBAL(proc0paddr) - .long 0 GLOBAL(oeacpufeat) .long 0 /* cpu features */ diff --git a/sys/arch/arc/arc/machdep.c b/sys/arch/arc/arc/machdep.c index 13bb07b2db6..72237e7083a 100644 --- a/sys/arch/arc/arc/machdep.c +++ b/sys/arch/arc/arc/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.116 2009/02/13 22:41:01 apb Exp $ */ +/* $NetBSD: machdep.c,v 1.117 2009/11/26 00:19:12 matt Exp $ */ /* $OpenBSD: machdep.c,v 1.36 1999/05/22 21:22:19 weingart Exp $ */ /* @@ -78,7 +78,7 @@ /* from: Utah Hdr: machdep.c 1.63 91/04/24 */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.116 2009/02/13 22:41:01 apb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.117 2009/11/26 00:19:12 matt Exp $"); #include "fs_mfs.h" #include "opt_ddb.h" @@ -218,7 +218,6 @@ int safepri = MIPS3_PSL_LOWIPL; const uint32_t *ipl_sr_bits; extern char kernel_text[], edata[], end[]; -extern struct user *proc0paddr; /* * Do all the stuff that locore normally does before calling main(). @@ -490,12 +489,12 @@ mach_init(int argc, char *argv[], u_int bim, void *bip) pmap_bootstrap(); /* - * Allocate space for proc0's USPACE. + * Allocate space for lwp0's USPACE. */ v = uvm_pageboot_alloc(USPACE); - lwp0.l_addr = proc0paddr = (struct user *)v; + lwp0.l_addr = (struct user *)v; lwp0.l_md.md_regs = (struct frame *)(v + USPACE) - 1; - proc0paddr->u_pcb.pcb_context[11] = + lwp0.l_addr->u_pcb.pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */ } diff --git a/sys/arch/arm/arm32/arm32_machdep.c b/sys/arch/arm/arm32/arm32_machdep.c index d235064c241..2a2f04e8660 100644 --- a/sys/arch/arm/arm32/arm32_machdep.c +++ b/sys/arch/arm/arm32/arm32_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: arm32_machdep.c,v 1.68 2009/11/21 20:32:17 rmind Exp $ */ +/* $NetBSD: arm32_machdep.c,v 1.69 2009/11/26 00:19:12 matt Exp $ */ /* * Copyright (c) 1994-1998 Mark Brinicombe. @@ -42,7 +42,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: arm32_machdep.c,v 1.68 2009/11/21 20:32:17 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: arm32_machdep.c,v 1.69 2009/11/26 00:19:12 matt Exp $"); #include "opt_md.h" #include "opt_pmap_debug.h" @@ -84,8 +84,6 @@ extern paddr_t msgbufphys; int kernel_debug = 0; -struct user *proc0paddr; - /* exported variable to be filled in by the bootloaders */ char *booted_kernel; diff --git a/sys/arch/arm/arm32/vm_machdep.c b/sys/arch/arm/arm32/vm_machdep.c index bcfe455d921..f561aee8700 100644 --- a/sys/arch/arm/arm32/vm_machdep.c +++ b/sys/arch/arm/arm32/vm_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: vm_machdep.c,v 1.51 2009/11/21 20:32:25 rmind Exp $ */ +/* $NetBSD: vm_machdep.c,v 1.52 2009/11/26 00:19:12 matt Exp $ */ /* * Copyright (c) 1994-1998 Mark Brinicombe. @@ -44,7 +44,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.51 2009/11/21 20:32:25 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.52 2009/11/26 00:19:12 matt Exp $"); #include "opt_armfpe.h" #include "opt_pmap_debug.h" @@ -207,7 +207,7 @@ cpu_lwp_fork(struct lwp *l1, struct lwp *l2, void *stack, size_t stacksize, * cpu_exit is called as the last action during exit. * * We clean up a little and then call switch_exit() with the old proc as an - * argument. switch_exit() first switches to proc0's context, and finally + * argument. switch_exit() first switches to lwp0's context, and finally * jumps into switch() to wait for another process to wake up. */ diff --git a/sys/arch/arm/at91/at91bus.c b/sys/arch/arm/at91/at91bus.c index 1c9aa3ecd2e..309b1d033fc 100644 --- a/sys/arch/arm/at91/at91bus.c +++ b/sys/arch/arm/at91/at91bus.c @@ -1,4 +1,4 @@ -/* $NetBSD: at91bus.c,v 1.7 2009/10/23 06:53:13 snj Exp $ */ +/* $NetBSD: at91bus.c,v 1.8 2009/11/26 00:19:12 matt Exp $ */ /* * Copyright (c) 2007 Embedtronics Oy @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: at91bus.c,v 1.7 2009/10/23 06:53:13 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: at91bus.c,v 1.8 2009/11/26 00:19:12 matt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -138,9 +138,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -struct user *proc0paddr; - - /* prototypes: */ void consinit(void); static int at91bus_match(device_t, cfdata_t, void *); @@ -461,8 +458,7 @@ at91bus_setup(BootConfig *mem) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("done!\n"); diff --git a/sys/arch/atari/atari/atari_init.c b/sys/arch/atari/atari/atari_init.c index 6614cd139d5..af2ab1a10d3 100644 --- a/sys/arch/atari/atari/atari_init.c +++ b/sys/arch/atari/atari/atari_init.c @@ -1,4 +1,4 @@ -/* $NetBSD: atari_init.c,v 1.86 2009/08/23 01:27:13 mrg Exp $ */ +/* $NetBSD: atari_init.c,v 1.87 2009/11/26 00:19:13 matt Exp $ */ /* * Copyright (c) 1995 Leo Weppelman @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: atari_init.c,v 1.86 2009/08/23 01:27:13 mrg Exp $"); +__KERNEL_RCSID(0, "$NetBSD: atari_init.c,v 1.87 2009/11/26 00:19:13 matt Exp $"); #include "opt_ddb.h" #include "opt_mbtype.h" @@ -118,7 +118,6 @@ int iomem_malloc_safe; static cpu_kcore_hdr_t cpu_kcore_hdr; extern u_int lowram; -extern u_int proc0paddr; int machineid, mmutype, cputype, astpending; #if defined(M68040) || defined(M68060) extern int protostfree; @@ -275,9 +274,9 @@ start_c(int id, u_int ttphystart, u_int ttphysize, u_int stphysize, avail = stphysize - pstart; /* - * Save KVA of proc0 user-area and allocate it + * Save KVA of lwp0 user-area and allocate it */ - proc0paddr = vstart; + lwp.l_addr = (struct user *)vstart; pstart += USPACE; vstart += USPACE; avail -= USPACE; @@ -408,7 +407,7 @@ start_c(int id, u_int ttphystart, u_int ttphysize, u_int stphysize, /* * go till end of data allocated so far - * plus proc0 u-area (to be allocated) + * plus lwp0 u-area (to be allocated) */ for (; kva < vstart; kva += PAGE_SIZE) { *pg++ = pg_proto; @@ -568,19 +567,14 @@ start_c(int id, u_int ttphystart, u_int ttphysize, u_int stphysize, __asm volatile ("pmove %0@,%%tc" : : "a" (&tc)); } - /* Is this to fool the optimizer?? */ - i = *(int *)proc0paddr; - *(volatile int *)proc0paddr = i; - /* * Initialize the "u-area" pages. * Must initialize p_addr before autoconfig or the * fault handler will get a NULL reference. */ - memset((u_char *)proc0paddr, 0, USPACE); - lwp0.l_addr = (struct user *)proc0paddr; + memset(lwp0.l_addr, 0, USPACE); curlwp = &lwp0; - curpcb = &((struct user *)proc0paddr)->u_pcb; + curpcb = &lwp0.l_addr->u_pcb; /* * Get the hardware into a defined state diff --git a/sys/arch/atari/atari/locore.s b/sys/arch/atari/atari/locore.s index 318ff76c973..4aaecbad725 100644 --- a/sys/arch/atari/atari/locore.s +++ b/sys/arch/atari/atari/locore.s @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.102 2008/12/27 16:17:24 tsutsui Exp $ */ +/* $NetBSD: locore.s,v 1.103 2009/11/26 00:19:13 matt Exp $ */ /* * Copyright (c) 1980, 1990 The Regents of the University of California. @@ -1026,10 +1026,9 @@ Lend_cpuset: /* * set kernel stack, user SP, and initial pcb */ - movl _C_LABEL(proc0paddr),%a1| lwp0 kernel stack + lea _C_LABEL(lwp0),%a0 | grab lwp0.p_addr + movl %a0@(L_ADDR),%a1 lea %a1@(USPACE-4),%sp | set kernel stack to end of area - lea _C_LABEL(lwp0),%a2 | initialize lwp0.p_addr so that - movl %a1,%a2@(L_ADDR) | we don't deref NULL in trap() movl #USRSTACK-4,%a2 movl %a2,%usp | init user SP movl %a2,%a1@(PCB_USP) | and save it @@ -1078,8 +1077,8 @@ Lcacheon: movw #PSL_USER,%sp@- | in user mode clrl %sp@- | stack adjust count lea %sp@(-64),%sp | construct space for D0-D7/A0-A7 - lea _C_LABEL(lwp0),%a0 | proc0 in a0 - movl %sp,%a0@(L_MD_REGS) | save frame for proc0 + #lea _C_LABEL(lwp0),%a0 | lwp0 in a0 + movl %sp,%a0@(L_MD_REGS) | save frame for lwp0 movl %usp,%a1 movl %a1,%sp@(FR_SP) | save user stack pointer in frame pea %sp@ | addr of space for D0 @@ -1464,8 +1463,6 @@ ASLOCAL(tmpstk) GLOBAL(protorp) .long 0x80000002,0 | prototype root pointer -GLOBAL(proc0paddr) - .long 0 | KVA of proc0 u-area #ifdef M68060 /* XXX */ L60iem: .long 0 L60fpiem: .long 0 diff --git a/sys/arch/bebox/bebox/locore.S b/sys/arch/bebox/bebox/locore.S index 946b44f869d..f63e9729296 100644 --- a/sys/arch/bebox/bebox/locore.S +++ b/sys/arch/bebox/bebox/locore.S @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.18 2009/02/13 22:41:01 apb Exp $ */ +/* $NetBSD: locore.S,v 1.19 2009/11/26 00:19:13 matt Exp $ */ /* $OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $ */ /* @@ -66,8 +66,6 @@ GLOBAL(startsym) .long 0 /* start symbol table */ GLOBAL(endsym) .long 0 /* end symbol table */ -GLOBAL(proc0paddr) - .long 0 /* proc0 p_addr */ GLOBAL(oeacpufeat) .long 0 /* cpu features */ diff --git a/sys/arch/cats/cats/cats_machdep.c b/sys/arch/cats/cats/cats_machdep.c index 11b07700fc4..d82407648c1 100644 --- a/sys/arch/cats/cats/cats_machdep.c +++ b/sys/arch/cats/cats/cats_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: cats_machdep.c,v 1.66 2009/08/18 09:22:47 he Exp $ */ +/* $NetBSD: cats_machdep.c,v 1.67 2009/11/26 00:19:13 matt Exp $ */ /* * Copyright (c) 1997,1998 Mark Brinicombe. @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.66 2009/08/18 09:22:47 he Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.67 2009/11/26 00:19:13 matt Exp $"); #include "opt_ddb.h" #include "opt_modular.h" @@ -159,8 +159,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -struct user *proc0paddr; - /* Prototypes */ void consinit(void); @@ -741,8 +739,7 @@ initarm(void *arm_bootargs) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; /* * XXX this should only be done in main() but it useful to * have output earlier ... diff --git a/sys/arch/cesfic/cesfic/locore.s b/sys/arch/cesfic/cesfic/locore.s index 12d1f5ed6b4..3e56c3dbaac 100644 --- a/sys/arch/cesfic/cesfic/locore.s +++ b/sys/arch/cesfic/cesfic/locore.s @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.17 2009/01/11 06:02:18 tsutsui Exp $ */ +/* $NetBSD: locore.s,v 1.18 2009/11/26 00:19:13 matt Exp $ */ /* * Copyright (c) 1980, 1990, 1993 @@ -335,11 +335,10 @@ Lenab1: lea _ASM_LABEL(tmpstk),%sp | temporary stack jbsr _C_LABEL(uvm_setpagesize) | select software page size /* set kernel stack, user SP, and initial pcb */ - movl _C_LABEL(proc0paddr),%a1 | get lwp0 pcb addr + lea _C_LABEL(lwp0),%a2 | get lwp0 pcb addr and initialize + movl %a2,_C_LABEL(curlwp) | curlwp so that + movl %a2@(L_ADDR),%a1 | we don't deref NULL in trap() lea %a1@(USPACE-4),%sp | set kernel stack to end of area - lea _C_LABEL(lwp0),%a2 | initialize lwp0.l_addr - movl %a2,_C_LABEL(curlwp) | and curlwp so that - movl %a1,%a2@(L_ADDR) | we don't deref NULL in trap() movl #USRSTACK-4,%a2 movl %a2,%usp | init user SP movl %a1,_C_LABEL(curpcb) | lwp0 is running @@ -1139,8 +1138,6 @@ GLOBAL(protorp) GLOBAL(prototc) .long 0 | prototype translation control -GLOBAL(proc0paddr) - .long 0 | KVA of lwp0 u-area #ifdef DEBUG .globl fulltflush, fullcflush fulltflush: diff --git a/sys/arch/cesfic/cesfic/pmap_bootstrap.c b/sys/arch/cesfic/cesfic/pmap_bootstrap.c index f331a9f19d5..95f3b273ef8 100644 --- a/sys/arch/cesfic/cesfic/pmap_bootstrap.c +++ b/sys/arch/cesfic/cesfic/pmap_bootstrap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap_bootstrap.c,v 1.17 2009/08/11 17:04:15 matt Exp $ */ +/* $NetBSD: pmap_bootstrap.c,v 1.18 2009/11/26 00:19:13 matt Exp $ */ /* * Copyright (c) 1991, 1993 @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.17 2009/08/11 17:04:15 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.18 2009/11/26 00:19:13 matt Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -54,7 +54,6 @@ __KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.17 2009/08/11 17:04:15 matt Exp #define RELOCPTR(v, t) ((t)((uintptr_t)RELOC((v), t) + firstpa - KERNBASE)) extern char *etext; -extern char *proc0paddr; extern paddr_t avail_start, avail_end; void pmap_bootstrap(vm_offset_t, vm_offset_t); @@ -365,7 +364,7 @@ pmap_bootstrap(vm_offset_t nextpa, vm_offset_t firstpa) * Remember the u-area address so it can be loaded in the * proc struct p_addr field later. */ - RELOC(proc0paddr, char *) = (char *)(p0upa - firstpa + KERNBASE); + RELOC(lwp0.l_addr, struct user *) = (char *)(p0upa - firstpa + KERNBASE); /* * VM data structures are now initialized, set up data for diff --git a/sys/arch/cobalt/cobalt/machdep.c b/sys/arch/cobalt/cobalt/machdep.c index 416b644d457..6e6480bb51b 100644 --- a/sys/arch/cobalt/cobalt/machdep.c +++ b/sys/arch/cobalt/cobalt/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.102 2009/02/13 22:41:01 apb Exp $ */ +/* $NetBSD: machdep.c,v 1.103 2009/11/26 00:19:13 matt Exp $ */ /*- * Copyright (c) 2006 Izumi Tsutsui. All rights reserved. @@ -50,7 +50,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.102 2009/02/13 22:41:01 apb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.103 2009/11/26 00:19:13 matt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -139,9 +139,6 @@ static u_int read_board_id(void); int safepri = MIPS1_PSL_LOWIPL; extern char *esym; -extern struct user *proc0paddr; - - /* * Do all the stuff that locore normally does before calling main(). @@ -318,9 +315,9 @@ mach_init(unsigned int memsize, u_int bim, char *bip) * Allocate space for proc0's USPACE. */ v = (char *)uvm_pageboot_alloc(USPACE); - lwp0.l_addr = proc0paddr = (struct user *)v; + lwp0.l_addr = (struct user *)v; lwp0.l_md.md_regs = (struct frame *)(v + USPACE) - 1; - proc0paddr->u_pcb.pcb_context[11] = + lwp0.l_addr->u_pcb.pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */ } diff --git a/sys/arch/evbarm/adi_brh/brh_machdep.c b/sys/arch/evbarm/adi_brh/brh_machdep.c index e65e0289ea8..73bba10bca7 100644 --- a/sys/arch/evbarm/adi_brh/brh_machdep.c +++ b/sys/arch/evbarm/adi_brh/brh_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: brh_machdep.c,v 1.32 2009/08/11 17:04:15 matt Exp $ */ +/* $NetBSD: brh_machdep.c,v 1.33 2009/11/26 00:19:13 matt Exp $ */ /* * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc. @@ -73,7 +73,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: brh_machdep.c,v 1.32 2009/08/11 17:04:15 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: brh_machdep.c,v 1.33 2009/11/26 00:19:13 matt Exp $"); #include "opt_ddb.h" #include "opt_pmap_debug.h" @@ -187,8 +187,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -struct user *proc0paddr; - /* Prototypes */ void consinit(void); @@ -671,8 +669,7 @@ initarm(void *arg) * Move from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("done!\n"); diff --git a/sys/arch/evbarm/armadillo/armadillo9_machdep.c b/sys/arch/evbarm/armadillo/armadillo9_machdep.c index bb0bd12d0a4..7a37b18fc0a 100644 --- a/sys/arch/evbarm/armadillo/armadillo9_machdep.c +++ b/sys/arch/evbarm/armadillo/armadillo9_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: armadillo9_machdep.c,v 1.15 2009/08/11 17:04:15 matt Exp $ */ +/* $NetBSD: armadillo9_machdep.c,v 1.16 2009/11/26 00:19:13 matt Exp $ */ /* * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc. @@ -110,7 +110,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: armadillo9_machdep.c,v 1.15 2009/08/11 17:04:15 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: armadillo9_machdep.c,v 1.16 2009/11/26 00:19:13 matt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -253,8 +253,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -struct user *proc0paddr; - /* Prototypes */ void consinit(void); @@ -776,8 +774,7 @@ initarm(void *arg) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("done!\n"); diff --git a/sys/arch/evbarm/beagle/beagle_machdep.c b/sys/arch/evbarm/beagle/beagle_machdep.c index 8d528d728a4..3937468bfb2 100644 --- a/sys/arch/evbarm/beagle/beagle_machdep.c +++ b/sys/arch/evbarm/beagle/beagle_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: beagle_machdep.c,v 1.4 2009/08/11 17:04:15 matt Exp $ */ +/* $NetBSD: beagle_machdep.c,v 1.5 2009/11/26 00:19:14 matt Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.4 2009/08/11 17:04:15 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.5 2009/11/26 00:19:14 matt Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -235,8 +235,6 @@ extern char _end[]; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -extern struct user *proc0paddr; - /* * Macros to translate between physical and virtual for a subset of the * kernel address space. *Not* for general use. @@ -533,8 +531,7 @@ initarm(void *arg) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init. */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("bootstrap done.\n"); diff --git a/sys/arch/evbarm/evbarm/initarm_common.c b/sys/arch/evbarm/evbarm/initarm_common.c index 87fd185abab..ca3fdb5017f 100644 --- a/sys/arch/evbarm/evbarm/initarm_common.c +++ b/sys/arch/evbarm/evbarm/initarm_common.c @@ -1,4 +1,4 @@ -/* $NetBSD: initarm_common.c,v 1.7 2009/08/11 17:04:15 matt Exp $ */ +/* $NetBSD: initarm_common.c,v 1.8 2009/11/26 00:19:14 matt Exp $ */ /* * Copyright 2003 Wasabi Systems, Inc. @@ -69,7 +69,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: initarm_common.c,v 1.7 2009/08/11 17:04:15 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: initarm_common.c,v 1.8 2009/11/26 00:19:14 matt Exp $"); #include <sys/systm.h> #include <sys/param.h> @@ -97,8 +97,6 @@ vm_offset_t physical_start; vm_offset_t physical_end; pv_addr_t systempage; -struct user *proc0paddr; - extern u_int data_abort_handler_address; extern u_int prefetch_abort_handler_address; extern u_int undefined_handler_address; @@ -418,8 +416,7 @@ initarm_common(const struct initarm_config *ic) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("done!\n"); diff --git a/sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c b/sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c index fb17810016b..b86de72fe88 100644 --- a/sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c +++ b/sys/arch/evbarm/g42xxeb/g42xxeb_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: g42xxeb_machdep.c,v 1.16 2009/08/11 17:04:15 matt Exp $ */ +/* $NetBSD: g42xxeb_machdep.c,v 1.17 2009/11/26 00:19:14 matt Exp $ */ /* * Copyright (c) 2002, 2003, 2004, 2005 Genetec Corporation. @@ -220,8 +220,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -struct user *proc0paddr; - /* Prototypes */ #if 0 @@ -804,8 +802,7 @@ initarm(void *arg) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("bootstrap done.\n"); diff --git a/sys/arch/evbarm/gemini/gemini_machdep.c b/sys/arch/evbarm/gemini/gemini_machdep.c index 70f71aef1c1..d4006853c16 100644 --- a/sys/arch/evbarm/gemini/gemini_machdep.c +++ b/sys/arch/evbarm/gemini/gemini_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: gemini_machdep.c,v 1.12 2009/08/11 17:04:15 matt Exp $ */ +/* $NetBSD: gemini_machdep.c,v 1.13 2009/11/26 00:19:14 matt Exp $ */ /* adapted from: * NetBSD: sdp24xx_machdep.c,v 1.4 2008/08/27 11:03:10 matt Exp @@ -129,7 +129,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: gemini_machdep.c,v 1.12 2009/08/11 17:04:15 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: gemini_machdep.c,v 1.13 2009/11/26 00:19:14 matt Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -260,8 +260,6 @@ unsigned long gemini_ipmq_vbase = GEMINI_IPMQ_VBASE; #endif /* NGEMINIIPM > 0 */ -extern struct user *proc0paddr; - /* * Macros to translate between physical and virtual for a subset of the * kernel address space. *Not* for general use. @@ -687,8 +685,7 @@ initarm(void *arg) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init. */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("bootstrap done.\n"); diff --git a/sys/arch/evbarm/gumstix/gumstix_machdep.c b/sys/arch/evbarm/gumstix/gumstix_machdep.c index 2bdacebf937..e802da87d44 100644 --- a/sys/arch/evbarm/gumstix/gumstix_machdep.c +++ b/sys/arch/evbarm/gumstix/gumstix_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: gumstix_machdep.c,v 1.18 2009/11/22 12:05:14 kiyohara Exp $ */ +/* $NetBSD: gumstix_machdep.c,v 1.19 2009/11/26 00:19:14 matt Exp $ */ /* * Copyright (C) 2005, 2006, 2007 WIDE Project and SOUM Corporation. * All rights reserved. @@ -253,8 +253,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -struct user *proc0paddr; - /* Prototypes */ static void read_system_serial(void); static void process_kernel_args(int, char *[]); @@ -800,8 +798,7 @@ initarm(void *arg) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("bootstrap done.\n"); diff --git a/sys/arch/evbarm/hdl_g/hdlg_machdep.c b/sys/arch/evbarm/hdl_g/hdlg_machdep.c index 42957a9c529..278270097c2 100644 --- a/sys/arch/evbarm/hdl_g/hdlg_machdep.c +++ b/sys/arch/evbarm/hdl_g/hdlg_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: hdlg_machdep.c,v 1.10 2009/08/11 17:04:16 matt Exp $ */ +/* $NetBSD: hdlg_machdep.c,v 1.11 2009/11/26 00:19:14 matt Exp $ */ /* * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc. @@ -73,7 +73,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: hdlg_machdep.c,v 1.10 2009/08/11 17:04:16 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hdlg_machdep.c,v 1.11 2009/11/26 00:19:14 matt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -190,8 +190,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -struct user *proc0paddr; - /* Prototypes */ void consinit(void); @@ -565,8 +563,7 @@ initarm(void *arg) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("done!\n"); diff --git a/sys/arch/evbarm/imx31/imx31lk_machdep.c b/sys/arch/evbarm/imx31/imx31lk_machdep.c index 97c13822629..b058c7ec33f 100644 --- a/sys/arch/evbarm/imx31/imx31lk_machdep.c +++ b/sys/arch/evbarm/imx31/imx31lk_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: imx31lk_machdep.c,v 1.5 2009/08/11 17:04:16 matt Exp $ */ +/* $NetBSD: imx31lk_machdep.c,v 1.6 2009/11/26 00:19:14 matt Exp $ */ /* * Startup routines for the ZOOM iMX31 LITEKIT. @@ -110,7 +110,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: imx31lk_machdep.c,v 1.5 2009/08/11 17:04:16 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: imx31lk_machdep.c,v 1.6 2009/11/26 00:19:14 matt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -227,8 +227,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -struct user *proc0paddr; - /* Prototypes */ #if 0 @@ -681,8 +679,7 @@ printf("%s: textsize %#lx, totalsize %#lx\n", * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("bootstrap done.\n"); diff --git a/sys/arch/evbarm/integrator/integrator_machdep.c b/sys/arch/evbarm/integrator/integrator_machdep.c index abaabb2b4e7..4da99885036 100644 --- a/sys/arch/evbarm/integrator/integrator_machdep.c +++ b/sys/arch/evbarm/integrator/integrator_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: integrator_machdep.c,v 1.62 2009/08/11 17:04:16 matt Exp $ */ +/* $NetBSD: integrator_machdep.c,v 1.63 2009/11/26 00:19:14 matt Exp $ */ /* * Copyright (c) 2001,2002 ARM Ltd @@ -68,7 +68,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: integrator_machdep.c,v 1.62 2009/08/11 17:04:16 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: integrator_machdep.c,v 1.63 2009/11/26 00:19:14 matt Exp $"); #include "opt_ddb.h" #include "opt_pmap_debug.h" @@ -171,8 +171,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -struct user *proc0paddr; - /* Prototypes */ static void integrator_sdram_bounds (paddr_t *, psize_t *); @@ -671,8 +669,7 @@ initarm(void *arg) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef PLCONSOLE /* diff --git a/sys/arch/evbarm/iq80310/iq80310_machdep.c b/sys/arch/evbarm/iq80310/iq80310_machdep.c index 99ac72717d0..39b6394fb82 100644 --- a/sys/arch/evbarm/iq80310/iq80310_machdep.c +++ b/sys/arch/evbarm/iq80310/iq80310_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: iq80310_machdep.c,v 1.74 2009/08/11 17:04:16 matt Exp $ */ +/* $NetBSD: iq80310_machdep.c,v 1.75 2009/11/26 00:19:14 matt Exp $ */ /* * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc. @@ -73,7 +73,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: iq80310_machdep.c,v 1.74 2009/08/11 17:04:16 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: iq80310_machdep.c,v 1.75 2009/11/26 00:19:14 matt Exp $"); #include "opt_ddb.h" #include "opt_pmap_debug.h" @@ -187,8 +187,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -struct user *proc0paddr; - /* Prototypes */ void consinit(void); @@ -685,8 +683,7 @@ initarm(void *arg) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("done!\n"); diff --git a/sys/arch/evbarm/iq80321/iq80321_machdep.c b/sys/arch/evbarm/iq80321/iq80321_machdep.c index e72892ded8b..8abf3f80c32 100644 --- a/sys/arch/evbarm/iq80321/iq80321_machdep.c +++ b/sys/arch/evbarm/iq80321/iq80321_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: iq80321_machdep.c,v 1.44 2009/08/11 17:04:16 matt Exp $ */ +/* $NetBSD: iq80321_machdep.c,v 1.45 2009/11/26 00:19:15 matt Exp $ */ /* * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc. @@ -73,7 +73,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: iq80321_machdep.c,v 1.44 2009/08/11 17:04:16 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: iq80321_machdep.c,v 1.45 2009/11/26 00:19:15 matt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -191,8 +191,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -struct user *proc0paddr; - /* Prototypes */ void consinit(void); @@ -711,8 +709,7 @@ initarm(void *arg) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("done!\n"); diff --git a/sys/arch/evbarm/ixdp425/ixdp425_machdep.c b/sys/arch/evbarm/ixdp425/ixdp425_machdep.c index 57256c407d0..96114c1a527 100644 --- a/sys/arch/evbarm/ixdp425/ixdp425_machdep.c +++ b/sys/arch/evbarm/ixdp425/ixdp425_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: ixdp425_machdep.c,v 1.23 2009/10/21 14:15:51 rmind Exp $ */ +/* $NetBSD: ixdp425_machdep.c,v 1.24 2009/11/26 00:19:15 matt Exp $ */ /* * Copyright (c) 2003 * Ichiro FUKUHARA <ichiro@ichiro.org>. @@ -64,7 +64,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ixdp425_machdep.c,v 1.23 2009/10/21 14:15:51 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ixdp425_machdep.c,v 1.24 2009/11/26 00:19:15 matt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -176,8 +176,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -struct user *proc0paddr; - /* Prototypes */ void consinit(void); @@ -680,8 +678,7 @@ initarm(void *arg) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("bootstrap done.\n"); diff --git a/sys/arch/evbarm/ixm1200/ixm1200_machdep.c b/sys/arch/evbarm/ixm1200/ixm1200_machdep.c index 01448339d28..52abba4f9f9 100644 --- a/sys/arch/evbarm/ixm1200/ixm1200_machdep.c +++ b/sys/arch/evbarm/ixm1200/ixm1200_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: ixm1200_machdep.c,v 1.42 2009/10/21 14:15:51 rmind Exp $ */ +/* $NetBSD: ixm1200_machdep.c,v 1.43 2009/11/26 00:19:15 matt Exp $ */ /* * Copyright (c) 2002, 2003 @@ -61,7 +61,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ixm1200_machdep.c,v 1.42 2009/10/21 14:15:51 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ixm1200_machdep.c,v 1.43 2009/11/26 00:19:15 matt Exp $"); #include "opt_ddb.h" #include "opt_modular.h" @@ -198,8 +198,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -struct user *proc0paddr; - #ifdef CPU_IXP12X0 #define CPU_IXP12X0_CACHE_CLEAN_SIZE (0x4000 * 2) extern unsigned int ixp12x0_cache_clean_addr; @@ -623,8 +621,7 @@ initarm(void *arg) * Moved here from cpu_startup() as data_abort_handler() references * this during init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; /* * We must now clean the cache again.... diff --git a/sys/arch/evbarm/lubbock/lubbock_machdep.c b/sys/arch/evbarm/lubbock/lubbock_machdep.c index 520a311f8d5..40115ba8a94 100644 --- a/sys/arch/evbarm/lubbock/lubbock_machdep.c +++ b/sys/arch/evbarm/lubbock/lubbock_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: lubbock_machdep.c,v 1.20 2009/08/11 17:04:16 matt Exp $ */ +/* $NetBSD: lubbock_machdep.c,v 1.21 2009/11/26 00:19:15 matt Exp $ */ /* * Copyright (c) 2002, 2003, 2005 Genetec Corporation. All rights reserved. @@ -112,7 +112,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: lubbock_machdep.c,v 1.20 2009/08/11 17:04:16 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lubbock_machdep.c,v 1.21 2009/11/26 00:19:15 matt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -230,8 +230,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -struct user *proc0paddr; - /* Prototypes */ #if 0 @@ -884,8 +882,7 @@ initarm(void *arg) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("bootstrap done.\n"); diff --git a/sys/arch/evbarm/npwr_fc/npwr_fc_machdep.c b/sys/arch/evbarm/npwr_fc/npwr_fc_machdep.c index 9ddad42bb67..aaacf32a2c1 100644 --- a/sys/arch/evbarm/npwr_fc/npwr_fc_machdep.c +++ b/sys/arch/evbarm/npwr_fc/npwr_fc_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: npwr_fc_machdep.c,v 1.10 2009/08/11 17:04:17 matt Exp $ */ +/* $NetBSD: npwr_fc_machdep.c,v 1.11 2009/11/26 00:19:15 matt Exp $ */ /* * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc. @@ -73,7 +73,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: npwr_fc_machdep.c,v 1.10 2009/08/11 17:04:17 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: npwr_fc_machdep.c,v 1.11 2009/11/26 00:19:15 matt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -191,8 +191,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -struct user *proc0paddr; - /* Prototypes */ void consinit(void); @@ -682,8 +680,7 @@ initarm(void *arg) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("done!\n"); diff --git a/sys/arch/evbarm/nslu2/nslu2_machdep.c b/sys/arch/evbarm/nslu2/nslu2_machdep.c index 745b4feea97..a57fd2bce2c 100644 --- a/sys/arch/evbarm/nslu2/nslu2_machdep.c +++ b/sys/arch/evbarm/nslu2/nslu2_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: nslu2_machdep.c,v 1.13 2009/10/21 14:15:51 rmind Exp $ */ +/* $NetBSD: nslu2_machdep.c,v 1.14 2009/11/26 00:19:15 matt Exp $ */ /*- * Copyright (c) 2006 The NetBSD Foundation, Inc. @@ -94,7 +94,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: nslu2_machdep.c,v 1.13 2009/10/21 14:15:51 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nslu2_machdep.c,v 1.14 2009/11/26 00:19:15 matt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -206,8 +206,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -struct user *proc0paddr; - /* Prototypes */ void consinit(void); @@ -748,8 +746,7 @@ initarm(void *arg) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("bootstrap done.\n"); diff --git a/sys/arch/evbarm/osk5912/osk5912_machdep.c b/sys/arch/evbarm/osk5912/osk5912_machdep.c index 9f08d93ebf5..7e5e3486044 100644 --- a/sys/arch/evbarm/osk5912/osk5912_machdep.c +++ b/sys/arch/evbarm/osk5912/osk5912_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: osk5912_machdep.c,v 1.5 2009/08/11 17:04:17 matt Exp $ */ +/* $NetBSD: osk5912_machdep.c,v 1.6 2009/11/26 00:19:15 matt Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -99,7 +99,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: osk5912_machdep.c,v 1.5 2009/08/11 17:04:17 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: osk5912_machdep.c,v 1.6 2009/11/26 00:19:15 matt Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -204,8 +204,6 @@ extern char _end[]; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -extern struct user *proc0paddr; - /* * Macros to translate between physical and virtual for a subset of the * kernel address space. *Not* for general use. @@ -423,8 +421,7 @@ initarm(void *arg) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init. */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("bootstrap done.\n"); diff --git a/sys/arch/evbarm/smdk2xx0/smdk2410_machdep.c b/sys/arch/evbarm/smdk2xx0/smdk2410_machdep.c index f4d26568052..c5bd729cc47 100644 --- a/sys/arch/evbarm/smdk2xx0/smdk2410_machdep.c +++ b/sys/arch/evbarm/smdk2xx0/smdk2410_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: smdk2410_machdep.c,v 1.23 2009/08/11 17:04:17 matt Exp $ */ +/* $NetBSD: smdk2410_machdep.c,v 1.24 2009/11/26 00:19:15 matt Exp $ */ /* * Copyright (c) 2002, 2003 Fujitsu Component Limited @@ -105,7 +105,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: smdk2410_machdep.c,v 1.23 2009/08/11 17:04:17 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: smdk2410_machdep.c,v 1.24 2009/11/26 00:19:15 matt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -238,8 +238,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -struct user *proc0paddr; - /* Prototypes */ void consinit(void); @@ -808,8 +806,7 @@ initarm(void *arg) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("done!\n"); diff --git a/sys/arch/evbarm/smdk2xx0/smdk2800_machdep.c b/sys/arch/evbarm/smdk2xx0/smdk2800_machdep.c index 96137cc7625..4dcf62309a8 100644 --- a/sys/arch/evbarm/smdk2xx0/smdk2800_machdep.c +++ b/sys/arch/evbarm/smdk2xx0/smdk2800_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: smdk2800_machdep.c,v 1.31 2009/08/11 17:04:17 matt Exp $ */ +/* $NetBSD: smdk2800_machdep.c,v 1.32 2009/11/26 00:19:15 matt Exp $ */ /* * Copyright (c) 2002, 2003, 2005 Fujitsu Component Limited @@ -106,7 +106,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: smdk2800_machdep.c,v 1.31 2009/08/11 17:04:17 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: smdk2800_machdep.c,v 1.32 2009/11/26 00:19:15 matt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -229,8 +229,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -struct user *proc0paddr; - /* Prototypes */ void consinit(void); @@ -712,8 +710,7 @@ initarm(void *arg) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("done!\n"); diff --git a/sys/arch/evbarm/tisdp24xx/sdp24xx_machdep.c b/sys/arch/evbarm/tisdp24xx/sdp24xx_machdep.c index 164fccc5e23..8d867d6fc28 100644 --- a/sys/arch/evbarm/tisdp24xx/sdp24xx_machdep.c +++ b/sys/arch/evbarm/tisdp24xx/sdp24xx_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: sdp24xx_machdep.c,v 1.6 2009/08/11 17:04:17 matt Exp $ */ +/* $NetBSD: sdp24xx_machdep.c,v 1.7 2009/11/26 00:19:15 matt Exp $ */ /* * Machine dependent functions for kernel setup for TI OSK5912 board. @@ -125,7 +125,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sdp24xx_machdep.c,v 1.6 2009/08/11 17:04:17 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sdp24xx_machdep.c,v 1.7 2009/11/26 00:19:15 matt Exp $"); #include "opt_machdep.h" #include "opt_ddb.h" @@ -235,8 +235,6 @@ extern char _end[]; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -extern struct user *proc0paddr; - /* * Macros to translate between physical and virtual for a subset of the * kernel address space. *Not* for general use. @@ -522,8 +520,7 @@ initarm(void *arg) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init. */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("bootstrap done.\n"); diff --git a/sys/arch/evbarm/tsarm/tsarm_machdep.c b/sys/arch/evbarm/tsarm/tsarm_machdep.c index cf8e2b83744..762aa543a6f 100644 --- a/sys/arch/evbarm/tsarm/tsarm_machdep.c +++ b/sys/arch/evbarm/tsarm/tsarm_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: tsarm_machdep.c,v 1.11 2009/08/11 17:04:17 matt Exp $ */ +/* $NetBSD: tsarm_machdep.c,v 1.12 2009/11/26 00:19:15 matt Exp $ */ /* * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc. @@ -73,7 +73,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: tsarm_machdep.c,v 1.11 2009/08/11 17:04:17 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tsarm_machdep.c,v 1.12 2009/11/26 00:19:15 matt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -197,8 +197,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -struct user *proc0paddr; - /* Prototypes */ void consinit(void); @@ -688,8 +686,7 @@ initarm(void *arg) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("done!\n"); diff --git a/sys/arch/evbarm/viper/viper_machdep.c b/sys/arch/evbarm/viper/viper_machdep.c index f413d2a8401..14d14f0a914 100644 --- a/sys/arch/evbarm/viper/viper_machdep.c +++ b/sys/arch/evbarm/viper/viper_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: viper_machdep.c,v 1.12 2009/08/11 17:04:17 matt Exp $ */ +/* $NetBSD: viper_machdep.c,v 1.13 2009/11/26 00:19:16 matt Exp $ */ /* * Startup routines for the Arcom Viper. Below you can trace the @@ -112,7 +112,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: viper_machdep.c,v 1.12 2009/08/11 17:04:17 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: viper_machdep.c,v 1.13 2009/11/26 00:19:16 matt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -228,8 +228,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -struct user *proc0paddr; - /* Prototypes */ #if 0 @@ -730,8 +728,7 @@ initarm(void *arg) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("bootstrap done.\n"); diff --git a/sys/arch/evbmips/adm5120/machdep.c b/sys/arch/evbmips/adm5120/machdep.c index 15216824d99..1bfcb636650 100644 --- a/sys/arch/evbmips/adm5120/machdep.c +++ b/sys/arch/evbmips/adm5120/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.11 2009/08/11 17:04:17 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.12 2009/11/26 00:19:16 matt Exp $ */ /*- * Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko. @@ -107,7 +107,7 @@ */ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.11 2009/08/11 17:04:17 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.12 2009/11/26 00:19:16 matt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -161,8 +161,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.11 2009/08/11 17:04:17 matt Exp $"); #define MEMSIZE 4 * 1024 * 1024 #endif /* !MEMSIZE */ -struct user *proc0paddr; - /* Our exported CPU info; we can have only one. */ struct cpu_info cpu_info_store; @@ -439,9 +437,9 @@ mach_init(int argc, char **argv, void *a2, void *a3) * Init mapping for u page(s) for proc0. */ v = uvm_pageboot_alloc(USPACE); - lwp0.l_addr = proc0paddr = (struct user *)v; + lwp0.l_addr = (struct user *)v; lwp0.l_md.md_regs = (struct frame *)(v + USPACE) - 1; - proc0paddr->u_pcb.pcb_context[11] = + lwp0.l_addr->u_pcb.pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */ /* diff --git a/sys/arch/evbmips/alchemy/machdep.c b/sys/arch/evbmips/alchemy/machdep.c index caec4533eab..1125e307ff4 100644 --- a/sys/arch/evbmips/alchemy/machdep.c +++ b/sys/arch/evbmips/alchemy/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.42 2009/08/11 17:04:18 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.43 2009/11/26 00:19:16 matt Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -107,7 +107,7 @@ */ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.42 2009/08/11 17:04:18 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.43 2009/11/26 00:19:16 matt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -163,8 +163,6 @@ int aucomcnrate = 0; #include "ohci.h" -struct user *proc0paddr; - /* Our exported CPU info; we can have only one. */ struct cpu_info cpu_info_store; @@ -365,9 +363,9 @@ mach_init(int argc, char **argv, yamon_env_var *envp, u_long memsize) * Init mapping for u page(s) for proc0. */ v = (void *) uvm_pageboot_alloc(USPACE); - lwp0.l_addr = proc0paddr = (struct user *)v; + lwp0.l_addr = (struct user *)v; lwp0.l_md.md_regs = (struct frame *)((char *)v + USPACE) - 1; - proc0paddr->u_pcb.pcb_context[11] = + lwp0.l_addr->u_pcb.pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */ /* diff --git a/sys/arch/evbmips/atheros/machdep.c b/sys/arch/evbmips/atheros/machdep.c index 30617841fad..32f86a34d75 100644 --- a/sys/arch/evbmips/atheros/machdep.c +++ b/sys/arch/evbmips/atheros/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.18 2009/08/11 17:04:18 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.19 2009/11/26 00:19:16 matt Exp $ */ /* * Copyright (c) 2006 Urbana-Champaign Independent Media Center. @@ -147,7 +147,7 @@ */ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.18 2009/08/11 17:04:18 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.19 2009/11/26 00:19:16 matt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -184,8 +184,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.18 2009/08/11 17:04:18 matt Exp $"); #include <mips/atheros/include/ar531xvar.h> #include <mips/atheros/include/arbusvar.h> -struct user *proc0paddr; - /* Our exported CPU info; we can have only one. */ struct cpu_info cpu_info_store; @@ -311,9 +309,9 @@ mach_init(void) * Init mapping for u page(s) for proc0. */ v = (void *) uvm_pageboot_alloc(USPACE); - lwp0.l_addr = proc0paddr = (struct user *)v; + lwp0.l_addr = (struct user *)v; lwp0.l_md.md_regs = (struct frame *)((char *)v + USPACE) - 1; - proc0paddr->u_pcb.pcb_context[11] = + lwp0.l_addr->u_pcb.pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */ /* diff --git a/sys/arch/evbmips/gdium/machdep.c b/sys/arch/evbmips/gdium/machdep.c index 906e5c8a8b8..15e96b268b3 100644 --- a/sys/arch/evbmips/gdium/machdep.c +++ b/sys/arch/evbmips/gdium/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.8 2009/08/17 18:57:34 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.9 2009/11/26 00:19:16 matt Exp $ */ /* * Copyright 2001, 2002 Wasabi Systems, Inc. @@ -112,7 +112,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.8 2009/08/17 18:57:34 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.9 2009/11/26 00:19:16 matt Exp $"); #include "opt_ddb.h" #include "opt_execfmt.h" @@ -186,8 +186,6 @@ void mach_init(int, char **, char **, void *); */ int safepri = MIPS1_PSL_LOWIPL; -extern struct user *proc0paddr; - /* * For some reason, PMON doesn't assign a real address to the Ralink's BAR. * So we have to do it. @@ -392,9 +390,9 @@ mach_init(int argc, char **argv, char **envp, void *callvec) * Allocate space for proc0's USPACE. */ v = (void *)uvm_pageboot_alloc(USPACE); - lwp0.l_addr = proc0paddr = (struct user *)v; + lwp0.l_addr = (struct user *)v; lwp0.l_md.md_regs = (struct frame *)((char *)v + USPACE) - 1; - proc0paddr->u_pcb.pcb_context[11] = + lwp0.l_addr->u_pcb.pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */ /* diff --git a/sys/arch/evbmips/malta/machdep.c b/sys/arch/evbmips/malta/machdep.c index 899ff4b1209..059bca88adf 100644 --- a/sys/arch/evbmips/malta/machdep.c +++ b/sys/arch/evbmips/malta/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.34 2009/03/18 10:22:27 cegger Exp $ */ +/* $NetBSD: machdep.c,v 1.35 2009/11/26 00:19:16 matt Exp $ */ /* * Copyright 2001, 2002 Wasabi Systems, Inc. @@ -112,7 +112,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.34 2009/03/18 10:22:27 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.35 2009/11/26 00:19:16 matt Exp $"); #include "opt_ddb.h" #include "opt_execfmt.h" @@ -191,8 +191,6 @@ void mach_init(int, char **, yamon_env_var *, u_long); */ int safepri = MIPS1_PSL_LOWIPL; -extern struct user *proc0paddr; - /* * Do all the stuff that locore normally does before calling main(). */ @@ -322,9 +320,9 @@ mach_init(int argc, char **argv, yamon_env_var *envp, u_long memsize) * Allocate space for proc0's USPACE. */ v = (void *)uvm_pageboot_alloc(USPACE); - lwp0.l_addr = proc0paddr = (struct user *)v; + lwp0.l_addr = (struct user *)v; lwp0.l_md.md_regs = (struct frame *)((char *)v + USPACE) - 1; - proc0paddr->u_pcb.pcb_context[11] = + lwp0.l_addr->u_pcb.pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */ /* diff --git a/sys/arch/evbppc/ev64260/ev64260_locore.S b/sys/arch/evbppc/ev64260/ev64260_locore.S index 8ff70dbaf23..1f66d91aa88 100644 --- a/sys/arch/evbppc/ev64260/ev64260_locore.S +++ b/sys/arch/evbppc/ev64260/ev64260_locore.S @@ -1,4 +1,4 @@ -/* $NetBSD: ev64260_locore.S,v 1.11 2009/02/13 22:41:01 apb Exp $ */ +/* $NetBSD: ev64260_locore.S,v 1.12 2009/11/26 00:19:16 matt Exp $ */ /* $OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $ */ /* @@ -67,8 +67,6 @@ GLOBAL(startsym) .long 0 /* start symbol table */ GLOBAL(endsym) .long 0 /* end symbol table */ -GLOBAL(proc0paddr) - .long 0 /* proc0 p_addr */ GLOBAL(oeacpufeat) .long 0 /* cpu features */ /* diff --git a/sys/arch/evbppc/ev64260/machdep.c b/sys/arch/evbppc/ev64260/machdep.c index fb8219e9400..30cd486894d 100644 --- a/sys/arch/evbppc/ev64260/machdep.c +++ b/sys/arch/evbppc/ev64260/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.25 2009/03/14 21:04:09 dsl Exp $ */ +/* $NetBSD: machdep.c,v 1.26 2009/11/26 00:19:16 matt Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.25 2009/03/14 21:04:09 dsl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.26 2009/11/26 00:19:16 matt Exp $"); #include "opt_marvell.h" #include "opt_modular.h" @@ -114,8 +114,6 @@ void isa_intr_init(void); /* * Global variables used here and there */ -extern struct user *proc0paddr; - #define PMONMEMREGIONS 32 struct mem_region physmemr[PMONMEMREGIONS], availmemr[PMONMEMREGIONS]; diff --git a/sys/arch/evbppc/explora/explora_start.S b/sys/arch/evbppc/explora/explora_start.S index 96a75930cd3..db0bd203078 100644 --- a/sys/arch/evbppc/explora/explora_start.S +++ b/sys/arch/evbppc/explora/explora_start.S @@ -1,4 +1,4 @@ -/* $NetBSD: explora_start.S,v 1.5 2008/04/28 20:23:17 martin Exp $ */ +/* $NetBSD: explora_start.S,v 1.6 2009/11/26 00:19:16 matt Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -55,9 +55,6 @@ #include "opt_ddb.h" #include "opt_ppcparam.h" -GLOBAL(proc0paddr) - .long 0 /* proc0 p_addr */ - /* * Initially the dram starts at 0x01000000. This is way too high. * We relocate dram to 0x00000000. We use the video ram at 0xf0000000 diff --git a/sys/arch/evbppc/explora/machdep.c b/sys/arch/evbppc/explora/machdep.c index 70c97bea8ca..0784c070a45 100644 --- a/sys/arch/evbppc/explora/machdep.c +++ b/sys/arch/evbppc/explora/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.27 2009/02/13 22:41:01 apb Exp $ */ +/* $NetBSD: machdep.c,v 1.28 2009/11/26 00:19:16 matt Exp $ */ /*- * Copyright (c) 2003 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.27 2009/02/13 22:41:01 apb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.28 2009/11/26 00:19:16 matt Exp $"); #include "opt_explora.h" #include "opt_modular.h" @@ -75,8 +75,6 @@ char machine_arch[] = MACHINE_ARCH; /* from <machine/param.h> */ static const unsigned int cpuspeed = 66000000; -extern struct user *proc0paddr; - prop_dictionary_t board_properties; struct vm_map *phys_map = NULL; struct vm_map *mb_map = NULL; @@ -211,10 +209,9 @@ bootstrap(u_int startkernel, u_int endkernel) * Initialize lwp0 and current pcb and pmap pointers. */ lwp0.l_cpu = ci; - lwp0.l_addr = proc0paddr; memset(lwp0.l_addr, 0, sizeof *lwp0.l_addr); - curpcb = &proc0paddr->u_pcb; + curpcb = &lwp0.l_addr->u_pcb; curpcb->pcb_pm = pmap_kernel(); /* diff --git a/sys/arch/evbppc/obs405/obs200_locore.S b/sys/arch/evbppc/obs405/obs200_locore.S index 3722b5a26e5..f384fd2c9b7 100644 --- a/sys/arch/evbppc/obs405/obs200_locore.S +++ b/sys/arch/evbppc/obs405/obs200_locore.S @@ -1,4 +1,4 @@ -/* $NetBSD: obs200_locore.S,v 1.6 2009/02/13 22:41:01 apb Exp $ */ +/* $NetBSD: obs200_locore.S,v 1.7 2009/11/26 00:19:16 matt Exp $ */ /* Original Tag: locore.S,v 1.1 2003/09/23 15:21:58 shige Exp */ /* $OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $ */ @@ -101,12 +101,6 @@ #define bdneq bdnzf 2, /* - * Globals - */ -GLOBAL(proc0paddr) - .long 0 /* proc0 p_addr */ - -/* * This symbol is here for the benefit of kvm_mkdb, and is supposed to * mark the start of kernel text. */ diff --git a/sys/arch/evbppc/pmppc/pmppc_locore.S b/sys/arch/evbppc/pmppc/pmppc_locore.S index 324ea6ab471..47c1789faa6 100644 --- a/sys/arch/evbppc/pmppc/pmppc_locore.S +++ b/sys/arch/evbppc/pmppc/pmppc_locore.S @@ -1,4 +1,4 @@ -/* $NetBSD: pmppc_locore.S,v 1.3 2008/02/05 22:31:49 garbled Exp $ */ +/* $NetBSD: pmppc_locore.S,v 1.4 2009/11/26 00:19:16 matt Exp $ */ /* $OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $ */ /* @@ -68,8 +68,6 @@ GLOBAL(startsym) .long 0 /* start symbol table */ GLOBAL(endsym) .long 0 /* end symbol table */ -GLOBAL(proc0paddr) - .long 0 /* proc0 p_addr */ GLOBAL(oeacpufeat) .long 0 /* cpu features */ /* diff --git a/sys/arch/evbppc/virtex/machdep.c b/sys/arch/evbppc/virtex/machdep.c index f2678f706d8..3ab4d41ac65 100644 --- a/sys/arch/evbppc/virtex/machdep.c +++ b/sys/arch/evbppc/virtex/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.10 2009/02/13 22:41:01 apb Exp $ */ +/* $NetBSD: machdep.c,v 1.11 2009/11/26 00:19:17 matt Exp $ */ /* * Copyright (c) 2006 Jachym Holecek @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.10 2009/02/13 22:41:01 apb Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.11 2009/11/26 00:19:17 matt Exp $"); #include "opt_compat_netbsd.h" #include "opt_ddb.h" @@ -100,8 +100,6 @@ char cpu_model[80]; char machine[] = MACHINE; /* from <machine/param.h> */ char machine_arch[] = MACHINE_ARCH; /* from <machine/param.h> */ -extern struct user *proc0paddr; - char bootpath[256]; paddr_t msgbuf_paddr; vaddr_t msgbuf_vaddr; @@ -209,10 +207,9 @@ initppc(u_int startkernel, u_int endkernel) physmemr, availmemr); lwp0.l_cpu = ci; - lwp0.l_addr = proc0paddr; memset(lwp0.l_addr, 0, sizeof(*lwp0.l_addr)); - curpcb = &proc0paddr->u_pcb; + curpcb = &lwp0.l_addr->u_pcb; curpcb->pcb_pm = pmap_kernel(); for (exc = EXC_RSVD; exc <= EXC_LAST; exc += 0x100) diff --git a/sys/arch/evbppc/virtex/virtex_start.S b/sys/arch/evbppc/virtex/virtex_start.S index 42f788bc111..b303748feea 100644 --- a/sys/arch/evbppc/virtex/virtex_start.S +++ b/sys/arch/evbppc/virtex/virtex_start.S @@ -1,4 +1,4 @@ -/* $NetBSD: virtex_start.S,v 1.3 2009/02/13 22:41:01 apb Exp $ */ +/* $NetBSD: virtex_start.S,v 1.4 2009/11/26 00:19:17 matt Exp $ */ /* * Copyright (c) 2006 Jachym Holecek @@ -64,11 +64,6 @@ /* Set bit (beginning with MSB) for each 128MB of RAM. */ #define PHYSMEM_REGIONS_MASK ~((1 << (32 - MB(PHYSMEM)/MB(128))) - 1) - -/* Initialized by INIT_CPUINFO(), used by machdep.c */ -GLOBAL(proc0paddr) - .long 0 /* proc0 p_addr */ - /* For kvm_mkdb, supposed to mark the start of kernel text. */ .text .globl _C_LABEL(kernel_text) diff --git a/sys/arch/evbppc/walnut/machdep.c b/sys/arch/evbppc/walnut/machdep.c index 8aee9889b2d..195153dd885 100644 --- a/sys/arch/evbppc/walnut/machdep.c +++ b/sys/arch/evbppc/walnut/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.41 2009/11/07 07:27:43 cegger Exp $ */ +/* $NetBSD: machdep.c,v 1.42 2009/11/26 00:19:17 matt Exp $ */ /* * Copyright 2001, 2002 Wasabi Systems, Inc. @@ -67,7 +67,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.41 2009/11/07 07:27:43 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.42 2009/11/26 00:19:17 matt Exp $"); #include "opt_compat_netbsd.h" #include "opt_ddb.h" @@ -131,8 +131,6 @@ char cpu_model[80]; char machine[] = MACHINE; /* from <machine/param.h> */ char machine_arch[] = MACHINE_ARCH; /* from <machine/param.h> */ -extern struct user *proc0paddr; - char bootpath[256]; paddr_t msgbuf_paddr; vaddr_t msgbuf_vaddr; @@ -206,10 +204,9 @@ initppc(u_int startkernel, u_int endkernel, char *args, void *info_block) * Initialize lwp0 and current pcb and pmap pointers. */ lwp0.l_cpu = ci; - lwp0.l_addr = proc0paddr; memset(lwp0.l_addr, 0, sizeof *lwp0.l_addr); - curpcb = &proc0paddr->u_pcb; + curpcb = &lwp0.laddr->u_pcb; curpcb->pcb_pm = pmap_kernel(); /* diff --git a/sys/arch/evbppc/walnut/walnut_start.S b/sys/arch/evbppc/walnut/walnut_start.S index f009e6d3c30..d48c9520286 100644 --- a/sys/arch/evbppc/walnut/walnut_start.S +++ b/sys/arch/evbppc/walnut/walnut_start.S @@ -1,4 +1,4 @@ -/* $NetBSD: walnut_start.S,v 1.16 2009/02/13 22:41:01 apb Exp $ */ +/* $NetBSD: walnut_start.S,v 1.17 2009/11/26 00:19:17 matt Exp $ */ /* $OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $ */ /* @@ -100,12 +100,6 @@ #define bdneq bdnzf 2, /* - * Globals - */ -GLOBAL(proc0paddr) - .long 0 /* proc0 p_addr */ - -/* * This symbol is here for the benefit of kvm_mkdb, and is supposed to * mark the start of kernel text. */ diff --git a/sys/arch/ews4800mips/ews4800mips/machdep.c b/sys/arch/ews4800mips/ews4800mips/machdep.c index 6b2bbd794c9..04ada90b6e5 100644 --- a/sys/arch/ews4800mips/ews4800mips/machdep.c +++ b/sys/arch/ews4800mips/ews4800mips/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.17 2009/08/11 17:04:18 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.18 2009/11/26 00:19:17 matt Exp $ */ /*- * Copyright (c) 2001, 2004, 2005 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.17 2009/08/11 17:04:18 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.18 2009/11/26 00:19:17 matt Exp $"); #include "opt_ddb.h" @@ -90,7 +90,6 @@ void mach_init(int argc, char *argv[], struct bootinfo *bi) { extern char kernel_text[], edata[], end[]; - extern struct user *proc0paddr; void *v; int i; @@ -170,9 +169,9 @@ mach_init(int argc, char *argv[], struct bootinfo *bi) pmap_bootstrap(); v = (void *)uvm_pageboot_alloc(USPACE); /* proc0 USPACE */ - lwp0.l_addr = proc0paddr = (struct user *) v; + lwp0.l_addr = (struct user *) v; lwp0.l_md.md_regs = (struct frame *)((char *)v + USPACE) - 1; - proc0paddr->u_pcb.pcb_context[11] = + lwp0.l_addr->u_pcb.pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */ } diff --git a/sys/arch/hp300/hp300/locore.s b/sys/arch/hp300/hp300/locore.s index a6b58ddbc2f..dd0a7751e29 100644 --- a/sys/arch/hp300/hp300/locore.s +++ b/sys/arch/hp300/hp300/locore.s @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.146 2009/01/11 06:02:18 tsutsui Exp $ */ +/* $NetBSD: locore.s,v 1.147 2009/11/26 00:19:17 matt Exp $ */ /* * Copyright (c) 1980, 1990, 1993 @@ -553,11 +553,10 @@ Lenab1: lea _ASM_LABEL(tmpstk),%sp | temporary stack jbsr _C_LABEL(uvm_setpagesize) | select software page size /* set kernel stack, user SP, and initial pcb */ - movl _C_LABEL(proc0paddr),%a1 | get lwp0 pcb addr - lea %a1@(USPACE-4),%sp | set kernel stack to end of area - lea _C_LABEL(lwp0),%a2 | initialize lwp0.l_addr - movl %a2,_C_LABEL(curlwp) | and curlwp so that - movl %a1,%a2@(L_ADDR) | we don't deref NULL in trap() + lea _C_LABEL(lwp0),%a2 | grab lwp0.l_addr + movl %a2@(L_ADDR),%a1 | set kernel stack to end of area + lea %a1@(USPACE-4),%sp | and curlwp so that we don't + movl %a2,_C_LABEL(curlwp) | deref NULL in trap() movl #USRSTACK-4,%a2 movl %a2,%usp | init user SP movl %a1,_C_LABEL(curpcb) | lwp0 is running @@ -1520,9 +1519,6 @@ GLOBAL(prototc) GLOBAL(internalhpib) .long 1 | has internal HP-IB, default to yes -GLOBAL(proc0paddr) - .long 0 | KVA of lwp0 u-area - GLOBAL(intiobase) .long 0 | KVA of base of internal IO space diff --git a/sys/arch/hp300/hp300/pmap_bootstrap.c b/sys/arch/hp300/hp300/pmap_bootstrap.c index 677d7f385ca..a13df19d1a6 100644 --- a/sys/arch/hp300/hp300/pmap_bootstrap.c +++ b/sys/arch/hp300/hp300/pmap_bootstrap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap_bootstrap.c,v 1.37 2009/01/17 07:17:35 tsutsui Exp $ */ +/* $NetBSD: pmap_bootstrap.c,v 1.38 2009/11/26 00:19:17 matt Exp $ */ /* * Copyright (c) 1991, 1993 @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.37 2009/01/17 07:17:35 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.38 2009/11/26 00:19:17 matt Exp $"); #include <sys/param.h> #include <sys/proc.h> @@ -55,7 +55,6 @@ __KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.37 2009/01/17 07:17:35 tsutsui #define RELOCPTR(v, t) ((t)((uintptr_t)RELOC((v), t) + firstpa)) extern char *etext; -extern char *proc0paddr; extern vaddr_t CLKbase, MMUbase; extern paddr_t bootinfo_pa; extern vaddr_t bootinfo_va; @@ -410,7 +409,7 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) * Remember the u-area address so it can be loaded in the * proc struct p_addr field later. */ - RELOC(proc0paddr, char *) = (char *)(p0upa - firstpa); + RELOC(lwp.l_addr, struct user *) = (struct user *)(p0upa - firstpa); /* * VM data structures are now initialized, set up data for diff --git a/sys/arch/hp700/hp700/locore.S b/sys/arch/hp700/hp700/locore.S index 38587c07b75..96cdcf156f7 100644 --- a/sys/arch/hp700/hp700/locore.S +++ b/sys/arch/hp700/hp700/locore.S @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.35 2009/06/03 21:08:51 skrll Exp $ */ +/* $NetBSD: locore.S,v 1.36 2009/11/26 00:19:17 matt Exp $ */ /* $OpenBSD: locore.S,v 1.158 2008/07/28 19:08:46 miod Exp $ */ /* @@ -148,7 +148,6 @@ .import esym, data .import virtual_avail, data .import lwp0, data - .import proc0paddr, data .import kpsw, data .import panic, code .import fpu_csw, data @@ -262,8 +261,6 @@ L$start_zero_tf: ldil L%USPACE, %r4 add %t3, %r4, %r4 - ldil L%proc0paddr, %t1 - stw %t3, R%proc0paddr(%t1) ldil L%lwp0, %t2 stw %t3, R%lwp0+L_ADDR(%t2) ldo NBPG(%t3), %t1 diff --git a/sys/arch/hp700/hp700/machdep.c b/sys/arch/hp700/hp700/machdep.c index 9a1cba9f74c..72f0c4388f1 100644 --- a/sys/arch/hp700/hp700/machdep.c +++ b/sys/arch/hp700/hp700/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.73 2009/11/21 15:36:33 rmind Exp $ */ +/* $NetBSD: machdep.c,v 1.74 2009/11/26 00:19:17 matt Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -58,7 +58,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.73 2009/11/21 15:36:33 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.74 2009/11/26 00:19:17 matt Exp $"); #include "opt_cputype.h" #include "opt_ddb.h" @@ -242,7 +242,6 @@ u_int hppa_btlb_size_min, hppa_btlb_size_max; /* * Things for MI glue to stick on. */ -struct user *proc0paddr; struct extent *hp700_io_extent; static long hp700_io_extent_store[EXTENT_FIXED_STORAGE_SIZE(64) / sizeof(long)]; diff --git a/sys/arch/hpcarm/hpcarm/hpc_machdep.c b/sys/arch/hpcarm/hpcarm/hpc_machdep.c index a482f37035e..a6d70807961 100644 --- a/sys/arch/hpcarm/hpcarm/hpc_machdep.c +++ b/sys/arch/hpcarm/hpcarm/hpc_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: hpc_machdep.c,v 1.92 2009/08/11 17:04:18 matt Exp $ */ +/* $NetBSD: hpc_machdep.c,v 1.93 2009/11/26 00:19:17 matt Exp $ */ /* * Copyright (c) 1994-1998 Mark Brinicombe. @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: hpc_machdep.c,v 1.92 2009/08/11 17:04:18 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hpc_machdep.c,v 1.93 2009/11/26 00:19:17 matt Exp $"); #include "opt_ddb.h" #include "opt_modular.h" @@ -163,8 +163,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -struct user *proc0paddr; - #define CPU_SA110_CACHE_CLEAN_SIZE (0x4000 * 2) extern unsigned int sa1_cache_clean_addr; extern unsigned int sa1_cache_clean_size; @@ -661,8 +659,7 @@ initarm(int argc, char **argv, struct bootinfo *bi) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init. */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef BOOT_DUMP dumppages((char *)0xc0000000, 16 * PAGE_SIZE); diff --git a/sys/arch/hpcmips/hpcmips/machdep.c b/sys/arch/hpcmips/hpcmips/machdep.c index 60a26485982..7c84699f16d 100644 --- a/sys/arch/hpcmips/hpcmips/machdep.c +++ b/sys/arch/hpcmips/hpcmips/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.103 2009/03/18 16:00:12 cegger Exp $ */ +/* $NetBSD: machdep.c,v 1.104 2009/11/26 00:19:17 matt Exp $ */ /*- * Copyright (c) 1999 Shin Takemura, All rights reserved. @@ -108,7 +108,7 @@ */ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.103 2009/03/18 16:00:12 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.104 2009/11/26 00:19:17 matt Exp $"); #include "opt_vr41xx.h" #include "opt_tx39xx.h" @@ -260,7 +260,6 @@ mach_init(int argc, char *argv[], struct bootinfo *bi) #ifdef KLOADER struct kloader_bootinfo kbi; #endif - extern struct user *proc0paddr; extern char edata[], end[]; #if NKSYMS || defined(DDB) || defined(MODULAR) extern void *esym; @@ -456,14 +455,13 @@ mach_init(int argc, char *argv[], struct bootinfo *bi) /* * Alloc u pages for lwp0 stealing KSEG0 memory. */ - lwp0.l_addr = proc0paddr = (struct user *)kernend; - lwp0.l_md.md_regs = - (struct frame *)((char *)kernend + UPAGES * PAGE_SIZE) - 1; - memset(kernend, 0, UPAGES * PAGE_SIZE); - proc0paddr->u_pcb.pcb_context[11] = + lwp0.l_addr = (struct user *)kernend; + lwp0.l_md.md_regs = (struct frame *)((char *)kernend + USPACE) - 1; + memset(kernend, 0, USPACE); + lwp0.l_addr->u_pcb.pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */ - kernend = (char *)kernend + UPAGES * PAGE_SIZE; + kernend = (char *)kernend + USPACE; /* Initialize console and KGDB serial port. */ (*platform.cons_init)(); diff --git a/sys/arch/hppa/hppa/pmap.c b/sys/arch/hppa/hppa/pmap.c index 7e006365899..a9f7b60b2ff 100644 --- a/sys/arch/hppa/hppa/pmap.c +++ b/sys/arch/hppa/hppa/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.57 2009/11/21 15:36:33 rmind Exp $ */ +/* $NetBSD: pmap.c,v 1.58 2009/11/26 00:19:17 matt Exp $ */ /*- * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.57 2009/11/21 15:36:33 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.58 2009/11/26 00:19:17 matt Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -1015,9 +1015,6 @@ pmap_bootstrap(vaddr_t vstart) /* TODO optimize/inline the kenter */ for (va = PAGE_SIZE; va < ptoa(physmem); va += PAGE_SIZE) { vm_prot_t prot = UVM_PROT_RW; -#ifdef DIAGNOSTIC - extern struct user *proc0paddr; -#endif if (va < resvmem) prot = UVM_PROT_RX; @@ -1026,7 +1023,7 @@ pmap_bootstrap(vaddr_t vstart) else if (va >= ksro && va < kero) prot = UVM_PROT_R; #ifdef DIAGNOSTIC - else if (va == (vaddr_t)proc0paddr + USPACE - PAGE_SIZE) + else if (va == (vaddr_t)lwp0.l_addr + USPACE - PAGE_SIZE) prot = UVM_PROT_NONE; #endif pmap_kenter_pa(va, va, prot, 0); diff --git a/sys/arch/i386/i386/machdep.c b/sys/arch/i386/i386/machdep.c index aabb897a69c..28773f5977b 100644 --- a/sys/arch/i386/i386/machdep.c +++ b/sys/arch/i386/i386/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.677 2009/11/25 14:28:50 rmind Exp $ */ +/* $NetBSD: machdep.c,v 1.678 2009/11/26 00:19:18 matt Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2000, 2004, 2006, 2008, 2009 @@ -67,7 +67,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.677 2009/11/25 14:28:50 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.678 2009/11/26 00:19:18 matt Exp $"); #include "opt_beep.h" #include "opt_compat_ibcs2.h" @@ -1055,7 +1055,6 @@ setregs(struct lwp *l, struct exec_package *pack, u_long stack) union descriptor *gdt, *ldt; union descriptor *pentium_idt; -struct user *proc0paddr; extern vaddr_t proc0uarea; void @@ -1313,9 +1312,8 @@ init386(paddr_t first_avail) cpu_feature2 = cpu_info_primary.ci_feature2_flags; cpu_feature_padlock = cpu_info_primary.ci_padlock_flags; - proc0paddr = UAREA_TO_USER(proc0uarea); - lwp0.l_addr = proc0paddr; - pcb = (void *)proc0paddr; + lwp0.l_addr = UAREA_TO_USER(proc0uarea); + pcb = (void *)lwp0.l_addr; #ifdef XEN /* not on Xen... */ @@ -1323,8 +1321,8 @@ init386(paddr_t first_avail) pcb->pcb_cr3 = PDPpaddr - KERNBASE; __PRINTK(("pcb_cr3 0x%lx cr3 0x%lx\n", PDPpaddr - KERNBASE, xpmap_ptom(PDPpaddr - KERNBASE))); - XENPRINTK(("proc0 pcb %p first_avail %p\n", - pcb, (void *)(long)first_avail)); + XENPRINTK(("lwp0.l_addr %p first_avail %p\n", + lwp0.l_addr, (void *)(long)first_avail)); XENPRINTK(("ptdpaddr %p atdevbase %p\n", (void *)PDPpaddr, (void *)atdevbase)); #endif diff --git a/sys/arch/ia64/ia64/machdep.c b/sys/arch/ia64/ia64/machdep.c index 38c89e2d3cc..5e6c20e014d 100644 --- a/sys/arch/ia64/ia64/machdep.c +++ b/sys/arch/ia64/ia64/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.18 2009/11/21 15:36:34 rmind Exp $ */ +/* $NetBSD: machdep.c,v 1.19 2009/11/26 00:19:18 matt Exp $ */ /*- * Copyright (c) 2003,2004 Marcel Moolenaar @@ -161,8 +161,6 @@ extern vaddr_t kernel_text, end; struct fpswa_iface *fpswa_iface; -struct user *proc0paddr; /* XXX: See: kern/kern_proc.c:proc0_init() */ - #define Mhz 1000000L #define Ghz (1000L*Mhz) @@ -440,6 +438,7 @@ void ia64_init(void) { paddr_t kernstartpfn, kernendpfn, pfn0, pfn1; + struct pcb *pcb0; struct efi_md *md; /* NO OUTPUT ALLOWED UNTIL FURTHER NOTICE */ @@ -661,8 +660,8 @@ ia64_init(void) /* * Init mapping for u page(s) for proc 0 */ - lwp0.l_addr = proc0paddr = - (struct user *)uvm_pageboot_alloc(UPAGES * PAGE_SIZE); + lwp0.l_addr = (struct user *)uvm_pageboot_alloc(UPAGES * PAGE_SIZE); + pcb0 = &lwp0.l_addr->u_pcb; /* @@ -688,19 +687,18 @@ ia64_init(void) */ - lwp0.l_md.md_tf = (struct trapframe *)((uint64_t)proc0paddr + + lwp0.l_md.md_tf = (struct trapframe *)((vaddr_t)lwp0.l_addr + USPACE - sizeof(struct trapframe)); - proc0paddr->u_pcb.pcb_special.sp = - (uint64_t)lwp0.l_md.md_tf - 16; /* 16 bytes is the + pcb0->pcb_special.sp = + (vaddr_t)lwp0.l_md.md_tf - 16; /* 16 bytes is the * scratch area defined * by the ia64 ABI */ - proc0paddr->u_pcb.pcb_special.bspstore = - (uint64_t) proc0paddr + sizeof(struct user); + pcb0->pcb_special.bspstore = (vaddr_t) (lwp0.l_addr + 1); - mutex_init(&proc0paddr->u_pcb.pcb_fpcpu_slock, MUTEX_DEFAULT, 0); + mutex_init(&pcb0.pcb_fpcpu_slock, MUTEX_DEFAULT, 0); /* @@ -727,7 +725,7 @@ ia64_init(void) * MULTIPROCESSOR configuration, each CPU will later get * its own idle PCB when autoconfiguration runs. */ - ci->ci_idle_pcb = &proc0paddr->u_pcb; + ci->ci_idle_pcb = pcb0; /* Indicate that proc0 has a CPU. */ lwp0.l_cpu = ci; diff --git a/sys/arch/ibmnws/ibmnws/locore.S b/sys/arch/ibmnws/ibmnws/locore.S index c01ef5286af..c914114b4c5 100644 --- a/sys/arch/ibmnws/ibmnws/locore.S +++ b/sys/arch/ibmnws/ibmnws/locore.S @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.5 2008/02/05 22:31:49 garbled Exp $ */ +/* $NetBSD: locore.S,v 1.6 2009/11/26 00:19:18 matt Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -64,8 +64,6 @@ GLOBAL(startsym) .long 0 /* start symbol table */ GLOBAL(endsym) .long 0 /* end symbol table */ -GLOBAL(proc0paddr) - .long 0 /* proc0 p_addr */ GLOBAL(oeacpufeat) .long 0 /* cpu features */ /* diff --git a/sys/arch/iyonix/iyonix/iyonix_machdep.c b/sys/arch/iyonix/iyonix/iyonix_machdep.c index 36c6e61cbfd..b646dea2dd7 100644 --- a/sys/arch/iyonix/iyonix/iyonix_machdep.c +++ b/sys/arch/iyonix/iyonix/iyonix_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: iyonix_machdep.c,v 1.13 2009/08/11 17:04:18 matt Exp $ */ +/* $NetBSD: iyonix_machdep.c,v 1.14 2009/11/26 00:19:18 matt Exp $ */ /* * Copyright (c) 2001, 2002, 2003 Wasabi Systems, Inc. @@ -73,7 +73,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: iyonix_machdep.c,v 1.13 2009/08/11 17:04:18 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: iyonix_machdep.c,v 1.14 2009/11/26 00:19:18 matt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -193,8 +193,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -struct user *proc0paddr; - char iyonix_macaddr[ETHER_ADDR_LEN]; char boot_consdev[16]; @@ -749,8 +747,7 @@ initarm(void *arg) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("done!\n"); diff --git a/sys/arch/luna68k/luna68k/locore.s b/sys/arch/luna68k/luna68k/locore.s index 4260d3c54fa..be3c29042cc 100644 --- a/sys/arch/luna68k/luna68k/locore.s +++ b/sys/arch/luna68k/luna68k/locore.s @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.29 2009/01/11 06:02:18 tsutsui Exp $ */ +/* $NetBSD: locore.s,v 1.30 2009/11/26 00:19:18 matt Exp $ */ /* * Copyright (c) 1980, 1990, 1993 @@ -314,11 +314,10 @@ Lenab1: jbsr _C_LABEL(uvm_setpagesize) | select software page size /* set kernel stack, user SP, lwp0, and initial pcb */ - movl _C_LABEL(proc0paddr),%a1 | get lwp0 pcb addr - lea %a1@(USPACE-4),%sp | set kernel stack to end of area - lea _C_LABEL(lwp0),%a2 | initialize lwp0.l_addr - movl %a2,_C_LABEL(curlwp) | and curlwp so that - movl %a1,%a2@(L_ADDR) | we don't deref NULL in trap() + lea _C_LABEL(lwp0),%a2 | get lwp0.l_addr + movl %a2@(L_ADDR),%a1 | set kernel stack to end of area + lea %a1@(USPACE-4),%sp | and curlwp so that we don't + movl %a2,_C_LABEL(curlwp) | deref NULL in trap() movl #USRSTACK-4,%a2 movl %a2,%usp | init user SP movl %a1,_C_LABEL(curpcb) | lwp0 is running @@ -1204,8 +1203,6 @@ nullrp: GLOBAL(memavail) .long 0 -GLOBAL(proc0paddr) - .long 0 GLOBAL(bootdev) .long 0 GLOBAL(hwplanemask) diff --git a/sys/arch/luna68k/luna68k/pmap_bootstrap.c b/sys/arch/luna68k/luna68k/pmap_bootstrap.c index 15a13d55360..51e9a919f3c 100644 --- a/sys/arch/luna68k/luna68k/pmap_bootstrap.c +++ b/sys/arch/luna68k/luna68k/pmap_bootstrap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap_bootstrap.c,v 1.18 2009/03/14 15:36:08 dsl Exp $ */ +/* $NetBSD: pmap_bootstrap.c,v 1.19 2009/11/26 00:19:18 matt Exp $ */ /* * Copyright (c) 1991, 1993 @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.18 2009/03/14 15:36:08 dsl Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.19 2009/11/26 00:19:18 matt Exp $"); #include <sys/param.h> #include <sys/proc.h> @@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.18 2009/03/14 15:36:08 dsl Exp #define RELOCPTR(v, t) ((t)((uintptr_t)RELOC((v), t) + firstpa)) extern char *etext; -extern char *proc0paddr; extern int maxmem, physmem; extern paddr_t avail_start, avail_end; @@ -85,7 +84,7 @@ void *msgbufaddr; void pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) { - paddr_t kstpa, kptpa, kptmpa, p0upa; + paddr_t kstpa, kptpa, kptmpa, l0upa; u_int nptpages, kstsize; st_entry_t protoste, *ste; pt_entry_t protopte, *pte, *epte; @@ -106,7 +105,7 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) * * kptmpa kernel PT map 1 page * - * p0upa proc 0 u-area UPAGES pages + * l0upa lwp 0 u-area UPAGES pages * * The KVA corresponding to any of these PAs is: * (PA - firstpa + KERNBASE). @@ -122,7 +121,7 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) nextpa += kstsize * PAGE_SIZE; kptmpa = nextpa; nextpa += PAGE_SIZE; - p0upa = nextpa; + l0upa = nextpa; nextpa += USPACE; kptpa = nextpa; nptpages = RELOC(Sysptsize, int) + @@ -345,15 +344,15 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) * Zero the u-area. * NOTE: `pte' and `epte' aren't PTEs here. */ - pte = (u_int *)p0upa; - epte = (u_int *)(p0upa + USPACE); + pte = (u_int *)l0upa; + epte = (u_int *)(l0upa + USPACE); while (pte < epte) *pte++ = 0; /* * Remember the u-area address so it can be loaded in the * proc struct p_addr field later. */ - RELOC(proc0paddr, char *) = (char *)(p0upa - firstpa); + RELOC(lwp0.l_addr, struct user *) = (struct user *)(l0upa - firstpa); RELOC(avail_start, paddr_t) = nextpa; RELOC(avail_end, paddr_t) = m68k_ptob(RELOC(maxmem, int)) - diff --git a/sys/arch/mac68k/mac68k/locore.s b/sys/arch/mac68k/mac68k/locore.s index 437b7dc86e0..d7319d4a9de 100644 --- a/sys/arch/mac68k/mac68k/locore.s +++ b/sys/arch/mac68k/mac68k/locore.s @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.155 2009/01/11 06:02:18 tsutsui Exp $ */ +/* $NetBSD: locore.s,v 1.156 2009/11/26 00:19:18 matt Exp $ */ /* * Copyright (c) 1982, 1990 The Regents of the University of California. @@ -338,11 +338,10 @@ Lloaddone: jbsr _C_LABEL(uvm_setpagesize) | select software page size /* set kernel stack, user SP, lwp0, and initial pcb */ - movl _C_LABEL(proc0paddr),%a1 | get proc0 pcb addr - lea %a1@(USPACE-4),%sp | set kernel stack to end of area - lea _C_LABEL(lwp0),%a2 | initialize lwp0.l_addr - movl %a2,_C_LABEL(curlwp) | and curlwp so that - movl %a1,%a2@(L_ADDR) | we don't deref NULL in trap() + lea _C_LABEL(lwp0),%a2 | get lwp0.l_addr + movl %a2@(L_ADDR),%a1 | set kernel stack to end of area + lea %a1@(USPACE-4),%sp | and curlwp so that we don't + movl %a2,_C_LABEL(curlwp) | deref NULL in trap() movl #USRSTACK-4,%a2 movl %a2,%usp | init %USP movl %a1,_C_LABEL(curpcb) | lwp0 is running @@ -1512,9 +1511,6 @@ GLOBAL(fputype) GLOBAL(protorp) .long 0,0 | prototype root pointer -GLOBAL(proc0paddr) - .long 0 | KVA of lwp0 u-area - GLOBAL(intiolimit) .long 0 | KVA of end of internal IO space diff --git a/sys/arch/mac68k/mac68k/pmap_bootstrap.c b/sys/arch/mac68k/mac68k/pmap_bootstrap.c index e699bc87b52..b4015aadd72 100644 --- a/sys/arch/mac68k/mac68k/pmap_bootstrap.c +++ b/sys/arch/mac68k/mac68k/pmap_bootstrap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap_bootstrap.c,v 1.78 2009/08/11 17:04:18 matt Exp $ */ +/* $NetBSD: pmap_bootstrap.c,v 1.79 2009/11/26 00:19:18 matt Exp $ */ /* * Copyright (c) 1991, 1993 @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.78 2009/08/11 17:04:18 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.79 2009/11/26 00:19:18 matt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -60,7 +60,7 @@ __KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.78 2009/08/11 17:04:18 matt Exp #define PA2VA(v, t) (t)((u_int)(v) - firstpa) extern char *etext; -extern char *extiobase, *proc0paddr; +extern char *extiobase; extern paddr_t avail_start; extern paddr_t avail_end; @@ -110,7 +110,7 @@ void bootstrap_mac68k(int); void pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) { - paddr_t kstpa, kptpa, kptmpa, p0upa; + paddr_t kstpa, kptpa, kptmpa, l0upa; u_int nptpages, kstsize; paddr_t avail_next; int avail_remaining; @@ -138,7 +138,7 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) * * kptmpa kernel PT map 1 page * - * p0upa proc 0 u-area UPAGES pages + * l0upa lwp 0 u-area UPAGES pages * */ if (mmutype == MMU_68040) @@ -149,7 +149,7 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) nextpa += kstsize * PAGE_SIZE; kptmpa = nextpa; nextpa += PAGE_SIZE; - p0upa = nextpa; + l0upa = nextpa; nextpa += USPACE; kptpa = nextpa; nptpages = Sysptsize + @@ -405,15 +405,15 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) * Zero the u-area. * NOTE: `pte' and `epte' aren't PTEs here. */ - pte = PA2VA(p0upa, u_int *); - epte = (u_int *)(PA2VA(p0upa, u_int) + USPACE); + pte = PA2VA(l0upa, u_int *); + epte = (u_int *)(PA2VA(l0upa, u_int) + USPACE); while (pte < epte) *pte++ = 0; + /* - * Remember the u-area address so it can be loaded in the - * proc struct p_addr field later. + * Store the u-area address */ - proc0paddr = PA2VA(p0upa, char *); + lwp0.l_addr = PA2VA(l0upa, struct user *); /* * VM data structures are now initialized, set up data for diff --git a/sys/arch/macppc/macppc/locore.S b/sys/arch/macppc/macppc/locore.S index 4e234d22a13..188832b3544 100644 --- a/sys/arch/macppc/macppc/locore.S +++ b/sys/arch/macppc/macppc/locore.S @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.63 2009/02/13 22:41:02 apb Exp $ */ +/* $NetBSD: locore.S,v 1.64 2009/11/26 00:19:18 matt Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -64,8 +64,6 @@ .data GLOBAL(esym) .long 0 /* end of symbol table */ -GLOBAL(proc0paddr) - .long 0 /* proc0 p_addr */ GLOBAL(oeacpufeat) .long 0 /* cpu features */ diff --git a/sys/arch/mips/include/mcontext.h b/sys/arch/mips/include/mcontext.h index 10d469d33db..4bcb6e74081 100644 --- a/sys/arch/mips/include/mcontext.h +++ b/sys/arch/mips/include/mcontext.h @@ -1,4 +1,4 @@ -/* $NetBSD: mcontext.h,v 1.8 2008/04/28 20:23:28 martin Exp $ */ +/* $NetBSD: mcontext.h,v 1.9 2009/11/26 00:19:19 matt Exp $ */ /*- * Copyright (c) 1999, 2002 The NetBSD Foundation, Inc. @@ -81,15 +81,15 @@ /* Make sure this is signed; we need pointers to be sign-extended. */ #if defined(__mips_n32) -typedef long long __greg_t; +typedef long long __greg_t; #else -typedef long __greg_t; +typedef long __greg_t; #endif /* __mips_n32 */ typedef __greg_t __gregset_t[_NGREG]; /* - * For the O32 ABI, there are 16 doubles, one at each even FP reg + * For the O32/O64 ABI, there are 16 doubles, one at each even FP reg * number. The FP registers themselves are 32-bits. * * For 64-bit ABIs (include N32), each FP register is a 64-bit double. @@ -99,45 +99,50 @@ typedef __greg_t __freg_t; /* * Floating point register state */ -#if defined(__mips_n32) || defined(_LP64) -typedef struct { +struct __fpregset_nabi { union { double __fp64_dregs[32]; __freg_t __fp_regs[32]; } __fp_r; unsigned int __fp_csr; unsigned int __fp_pad; -} __fpregset_t; -#else /* !(__mips_n32 || _LP64) */ -typedef struct { +}; +struct __fpregset_oabi { union { double __fp_dregs[16]; float __fp_fregs[32]; - __freg_t __fp_regs[32]; + int32_t __fp_regs[32]; } __fp_r; unsigned int __fp_csr; unsigned int __fp_pad; -} __fpregset_t; -#endif /* !(__mips_n32 || _LP64) */ +}; + +#if __mips_n32 || __mips_n64 +typedef struct __fpregset_nabi __fpregset_t; +#else +typedef struct __fpregset_oabi __fpregset_t; +#else typedef struct { __gregset_t __gregs; __fpregset_t __fpregs; } mcontext_t; -#endif /* !__ASSEMBLER__ */ +#ifdef COMPAT_NETBSD32 +typedef int32_t __greg32_t; +typedef __greg32_t __gregset32_t[_NGREG]; -#define _UC_MACHINE_PAD 16 /* Padding appended to ucontext_t */ +typedef struct { + __gregset32_t __gregs; + __fpregset_oabi_t __fpregs; +} mcontext32_t; -/* - * Offsets relative to ucontext_t; intended to be used by assembly stubs. - */ -#if !defined(_MIPS_BSD_API) || _MIPS_BSD_API == _MIPS_BSD_API_LP32 -#define _OFFSETOF_UC_GREGS 40 -#else -#define _OFFSETOF_UC_GREGS 56 #endif +#endif /* !__ASSEMBLER__ */ + +#define _UC_MACHINE_PAD 16 /* Padding appended to ucontext_t */ + #define _UC_SETSTACK 0x00010000 #define _UC_CLRSTACK 0x00020000 diff --git a/sys/arch/mips/mips/locore.S b/sys/arch/mips/mips/locore.S index 9546c427d24..88ae1d6997b 100644 --- a/sys/arch/mips/mips/locore.S +++ b/sys/arch/mips/mips/locore.S @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.167 2007/10/17 19:55:38 garbled Exp $ */ +/* $NetBSD: locore.S,v 1.168 2009/11/26 00:19:19 matt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -138,7 +138,7 @@ _C_LABEL(kernel_text): jal _C_LABEL(mach_init) # mach_init(a0, a1, a2, a3) nop - lw sp, _C_LABEL(proc0paddr) # switch to proc0 stack + lw sp, L_ADDR(MIPS_CURLWP) # switch to lwp0 stack nop addu sp, sp, USPACE - FRAME_SIZ - CALLFRAME_SIZ jal _C_LABEL(main) # main(void) diff --git a/sys/arch/mips/mips/mips_machdep.c b/sys/arch/mips/mips/mips_machdep.c index 34b1e1c1ba5..b4e1630bc8d 100644 --- a/sys/arch/mips/mips/mips_machdep.c +++ b/sys/arch/mips/mips/mips_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: mips_machdep.c,v 1.218 2009/11/21 17:40:28 rmind Exp $ */ +/* $NetBSD: mips_machdep.c,v 1.219 2009/11/26 00:19:19 matt Exp $ */ /* * Copyright 2002 Wasabi Systems, Inc. @@ -112,7 +112,7 @@ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.218 2009/11/21 17:40:28 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.219 2009/11/26 00:19:19 matt Exp $"); #include "opt_cputype.h" @@ -204,7 +204,6 @@ int mips_has_r4k_mmu; int mips3_pg_cached; u_int mips3_pg_shift; -struct user *proc0paddr; struct segtab *segbase; void * msgbufaddr; @@ -459,12 +458,17 @@ static const struct pridtab fputab[] = { * by pridtab->cpu_cid. */ static const char * const cidnames[] = { - "Prehistoric", - "MIPS", /* or "MIPS Technologies, Inc. */ - "Broadcom", /* or "Broadcom Corp." */ - "Alchemy", /* or "Alchemy Semiconductor" */ - "SiByte", /* or "Broadcom Corp. (SiByte)" */ - "SandCraft", + [MIPS_PRID_CID_PREHISTORIC] = "Prehistoric", + [MIPS_PRID_CID_MIPS] = "MIPS", + /* or "MIPS Technologies, Inc. */ + [MIPS_PRID_CID_BROADCOM] = "Broadcom", + /* or "Broadcom Corp." */ + [MIPS_PRID_CID_ALCHEMY] = "Alchemy", + /* or "Alchemy Semiconductor" */ + [MIPS_PRID_CID_SIBYTE] = "SiByte", + /* or "Broadcom Corp. (SiByte)" */ + [MIPS_PRID_CID_SANDCRAFT] = "SandCraft", + [MIPS_PRID_CID_RMI] = "RMI", }; #define ncidnames (sizeof(cidnames) / sizeof(cidnames[0])) diff --git a/sys/arch/mipsco/mipsco/machdep.c b/sys/arch/mipsco/mipsco/machdep.c index 11b8e31c437..08e6dee20bc 100644 --- a/sys/arch/mipsco/mipsco/machdep.c +++ b/sys/arch/mipsco/mipsco/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.67 2009/03/18 10:22:32 cegger Exp $ */ +/* $NetBSD: machdep.c,v 1.68 2009/11/26 00:19:19 matt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -76,7 +76,7 @@ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.67 2009/03/18 10:22:32 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.68 2009/11/26 00:19:19 matt Exp $"); /* from: Utah Hdr: machdep.c 1.63 91/04/24 */ @@ -181,7 +181,6 @@ extern void stacktrace(void); /*XXX*/ * disables mips1 FPU interrupts. */ int safepri = MIPS3_PSL_LOWIPL; /* XXX */ -extern struct user *proc0paddr; /* locore callback-vector setup */ extern void mips_vector_init(void); @@ -371,9 +370,9 @@ mach_init(int argc, char *argv[], char *envp[], u_int bim, char *bip) * Allocate space for proc0's USPACE. */ v = (void *)uvm_pageboot_alloc(USPACE); - lwp0.l_addr = proc0paddr = (struct user *)v; + lwp0.l_addr = (struct user *)v; lwp0.l_md.md_regs = (struct frame *)(v + USPACE) - 1; - proc0paddr->u_pcb.pcb_context[11] = + lwp0.l_addr->u_pcb.pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */ /* diff --git a/sys/arch/mvme68k/mvme68k/locore.s b/sys/arch/mvme68k/mvme68k/locore.s index 9a31bcd896b..9dc0d0de3a6 100644 --- a/sys/arch/mvme68k/mvme68k/locore.s +++ b/sys/arch/mvme68k/mvme68k/locore.s @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.100 2009/01/11 06:02:19 tsutsui Exp $ */ +/* $NetBSD: locore.s,v 1.101 2009/11/26 00:19:19 matt Exp $ */ /* * Copyright (c) 1980, 1990, 1993 @@ -668,11 +668,10 @@ Lenab1: lea _ASM_LABEL(tmpstk),%sp | temporary stack jbsr _C_LABEL(uvm_setpagesize) | select software page size /* set kernel stack, user SP, and initial pcb */ - movl _C_LABEL(proc0paddr),%a1 | get lwp0 pcb addr - lea %a1@(USPACE-4),%sp | set kernel stack to end of area - lea _C_LABEL(lwp0),%a2 | initialize lwp0.p_addr - movl %a2,_C_LABEL(curlwp) | and curlwp so that - movl %a1,%a2@(L_ADDR) | we don't deref NULL in trap() + lea _C_LABEL(lwp0),%a2 | get lwp0.l_addr + movl %a2@(L_ADDR),%a1 | set kernel stack to end of area + lea %a1@(USPACE-4),%sp | and curlwp so that we don't + movl %a2,_C_LABEL(curlwp) | deref NULL in trap() movl #USRSTACK-4,%a2 movl %a2,%usp | init user SP movl %a1,_C_LABEL(curpcb) | lwp0 is running @@ -1551,9 +1550,6 @@ GLOBAL(bootctrllun) GLOBAL(bootaddr) .long 0 -GLOBAL(proc0paddr) - .long 0 | KVA of proc0 u-area - GLOBAL(intiobase) .long 0 | KVA of base of internal IO space diff --git a/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c b/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c index dead09e0ee2..b15684ef81f 100644 --- a/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c +++ b/sys/arch/mvme68k/mvme68k/pmap_bootstrap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap_bootstrap.c,v 1.31 2009/01/17 07:17:36 tsutsui Exp $ */ +/* $NetBSD: pmap_bootstrap.c,v 1.32 2009/11/26 00:19:19 matt Exp $ */ /* * Copyright (c) 1991, 1993 @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.31 2009/01/17 07:17:36 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.32 2009/11/26 00:19:19 matt Exp $"); #include <sys/param.h> #include <sys/kcore.h> @@ -53,7 +53,6 @@ __KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.31 2009/01/17 07:17:36 tsutsui #define RELOCPTR(v, t) ((t)((uintptr_t)RELOC((v), t) + firstpa)) extern char *kernel_text, *etext; -extern char *proc0paddr; extern int maxmem, physmem; extern paddr_t avail_start, avail_end; @@ -89,7 +88,7 @@ void pmap_bootstrap(paddr_t, paddr_t); void pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) { - paddr_t kstpa, kptpa, kptmpa, lkptpa, p0upa; + paddr_t kstpa, kptpa, kptmpa, lkptpa, l0upa; u_int nptpages, kstsize; st_entry_t protoste, *ste; pt_entry_t protopte, *pte, *epte; @@ -114,7 +113,7 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) * * lkptpa last kernel PT page 1 page * - * p0upa proc 0 u-area UPAGES pages + * l0upa lwp0 0 u-area UPAGES pages * * The KVA corresponding to any of these PAs is: * (PA - firstpa + KERNBASE). @@ -134,7 +133,7 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) nextpa += PAGE_SIZE; lkptpa = nextpa; nextpa += PAGE_SIZE; - p0upa = nextpa; + l0upa = nextpa; nextpa += USPACE; kptpa = nextpa; nptpages = RELOC(Sysptsize, int) + (iiomappages + NPTEPG - 1) / NPTEPG; @@ -398,15 +397,14 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) * Zero the u-area. * NOTE: `pte' and `epte' aren't PTEs here. */ - pte = (u_int *)p0upa; - epte = (u_int *)(p0upa + USPACE); + pte = (u_int *)l0upa; + epte = (u_int *)(l0upa + USPACE); while (pte < epte) *pte++ = 0; /* - * Remember the u-area address so it can be loaded in the - * proc struct p_addr field later. + * Store the u-area into lwp0. */ - RELOC(proc0paddr, char *) = (char *)(p0upa - firstpa); + RELOC(lwp0.l_addr, struct user *) = (struct user *)(l0upa - firstpa); /* * Initialize the mem_clusters[] array for the crash dump diff --git a/sys/arch/mvmeppc/mvmeppc/locore.S b/sys/arch/mvmeppc/mvmeppc/locore.S index 4379d43ba5a..2a08fd385f4 100644 --- a/sys/arch/mvmeppc/mvmeppc/locore.S +++ b/sys/arch/mvmeppc/mvmeppc/locore.S @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.9 2009/02/13 22:41:02 apb Exp $ */ +/* $NetBSD: locore.S,v 1.10 2009/11/26 00:19:19 matt Exp $ */ /* $OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $ */ /* @@ -67,8 +67,6 @@ GLOBAL(startsym) .long 0 /* start symbol table */ GLOBAL(endsym) .long 0 /* end symbol table */ -GLOBAL(proc0paddr) - .long 0 /* proc0 p_addr */ GLOBAL(oeacpufeat) .long 0 /* cpu features */ diff --git a/sys/arch/netwinder/netwinder/netwinder_machdep.c b/sys/arch/netwinder/netwinder/netwinder_machdep.c index 3547ee67cfc..59d2b3d9b15 100644 --- a/sys/arch/netwinder/netwinder/netwinder_machdep.c +++ b/sys/arch/netwinder/netwinder/netwinder_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: netwinder_machdep.c,v 1.71 2009/08/11 17:04:18 matt Exp $ */ +/* $NetBSD: netwinder_machdep.c,v 1.72 2009/11/26 00:19:19 matt Exp $ */ /* * Copyright (c) 1997,1998 Mark Brinicombe. @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: netwinder_machdep.c,v 1.71 2009/08/11 17:04:18 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: netwinder_machdep.c,v 1.72 2009/11/26 00:19:19 matt Exp $"); #include "opt_ddb.h" #include "opt_pmap_debug.h" @@ -179,8 +179,6 @@ pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; #define KERNEL_VM_SIZE 0x0C000000 #endif -extern struct user *proc0paddr; /* in arm32_machdep.c */ - /* Prototypes */ void consinit(void); @@ -704,8 +702,7 @@ initarm(void *arg) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("done!\n"); diff --git a/sys/arch/news68k/news68k/locore.s b/sys/arch/news68k/news68k/locore.s index 2a6dfc120ed..4cdfbd74a77 100644 --- a/sys/arch/news68k/news68k/locore.s +++ b/sys/arch/news68k/news68k/locore.s @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.47 2008/12/21 17:43:32 tsutsui Exp $ */ +/* $NetBSD: locore.s,v 1.48 2009/11/26 00:19:19 matt Exp $ */ /* * Copyright (c) 1980, 1990, 1993 @@ -446,12 +446,10 @@ Lenab1: lea _ASM_LABEL(tmpstk),%sp | temporary stack jbsr _C_LABEL(uvm_setpagesize) | select software page size /* set kernel stack, user SP, and initial pcb */ - movl _C_LABEL(proc0paddr),%a1| get lwp0 pcb addr - lea %a1@(USPACE-4),%sp | set kernel stack to end of area - lea _C_LABEL(lwp0),%a2 | initialize lwp0.l_addr - movl %a2,_C_LABEL(curlwp) | and curlwp so that - movl %a1,%a2@(L_ADDR) | we don't deref NULL in trap() - movl #USRSTACK-4,%a2 + lea _C_LABEL(lwp0),%a2 | get lwp0.l_addr + movl %a2@(L_ADDR),%a1 | set kernel stack to end of area + lea %a1@(USPACE-4),%sp | and curlwp so that we don't + movl %a2,_C_LABEL(curlwp) | deref NULL in trap() movl %a2,%usp | init user SP movl %a1,_C_LABEL(curpcb) | lwp0 is running @@ -1235,9 +1233,6 @@ GLOBAL(bootctrllun) GLOBAL(bootaddr) .long 0 -GLOBAL(proc0paddr) - .long 0 | KVA of lwp0 u-area - GLOBAL(intiobase) .long 0 | KVA of base of internal IO space diff --git a/sys/arch/news68k/news68k/pmap_bootstrap.c b/sys/arch/news68k/news68k/pmap_bootstrap.c index 09ffa957d50..6f64ecec4da 100644 --- a/sys/arch/news68k/news68k/pmap_bootstrap.c +++ b/sys/arch/news68k/news68k/pmap_bootstrap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap_bootstrap.c,v 1.22 2009/01/17 07:17:36 tsutsui Exp $ */ +/* $NetBSD: pmap_bootstrap.c,v 1.23 2009/11/26 00:19:19 matt Exp $ */ /* * Copyright (c) 1991, 1993 @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.22 2009/01/17 07:17:36 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.23 2009/11/26 00:19:19 matt Exp $"); #include <sys/param.h> @@ -52,7 +52,7 @@ __KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.22 2009/01/17 07:17:36 tsutsui #define RELOCPTR(v, t) ((t)((uintptr_t)RELOC((v), t) + firstpa)) extern char *etext; -extern char *extiobase, *proc0paddr; +extern char *extiobase; extern char *cache_ctl, *cache_clr; extern int maxmem, physmem; @@ -89,7 +89,7 @@ void *msgbufaddr; void pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) { - paddr_t kstpa, kptpa, kptmpa, p0upa; + paddr_t kstpa, kptpa, kptmpa, l0upa; u_int nptpages, kstsize; st_entry_t protoste, *ste; pt_entry_t protopte, *pte, *epte; @@ -110,7 +110,7 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) * * kptmpa kernel PT map 1 page * - * p0upa proc 0 u-area UPAGES pages + * l0upa lwp 0 u-area UPAGES pages * * The KVA corresponding to any of these PAs is: * (PA - firstpa + KERNBASE). @@ -136,7 +136,7 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) nextpa += kstsize * PAGE_SIZE; kptmpa = nextpa; nextpa += PAGE_SIZE; - p0upa = nextpa; + l0upa = nextpa; nextpa += USPACE; kptpa = nextpa; nptpages = RELOC(Sysptsize, int) + @@ -367,15 +367,15 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) * Zero the u-area. * NOTE: `pte' and `epte' aren't PTEs here. */ - pte = (u_int *)p0upa; - epte = (u_int *)(p0upa + USPACE); + pte = (u_int *)l0upa; + epte = (u_int *)(l0upa + USPACE); while (pte < epte) *pte++ = 0; /* * Remember the u-area address so it can be loaded in the * proc struct p_addr field later. */ - RELOC(proc0paddr, char *) = (char *)(p0upa - firstpa); + RELOC(lwp0.l_addr, struct user *) = (struct user *)(l0upa - firstpa); /* * VM data structures are now initialized, set up data for diff --git a/sys/arch/newsmips/newsmips/machdep.c b/sys/arch/newsmips/newsmips/machdep.c index 6d886494179..0cda9f639cf 100644 --- a/sys/arch/newsmips/newsmips/machdep.c +++ b/sys/arch/newsmips/newsmips/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.103 2009/08/11 17:04:19 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.104 2009/11/26 00:19:19 matt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -76,7 +76,7 @@ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.103 2009/08/11 17:04:19 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.104 2009/11/26 00:19:19 matt Exp $"); /* from: Utah Hdr: machdep.c 1.63 91/04/24 */ @@ -205,7 +205,6 @@ const uint32_t ipl_sr_bits[_IPL_N] = { MIPS_INT_MASK_2, }; -extern struct user *proc0paddr; extern u_long bootdev; extern char edata[], end[]; @@ -379,9 +378,9 @@ mach_init(int x_boothowto, int x_bootdev, int x_bootname, int x_maxmem) * Allocate space for lwp0's USPACE. */ v = (char *)uvm_pageboot_alloc(USPACE); - lwp0.l_addr = proc0paddr = (struct user *)v; + lwp0.l_addr = (struct user *)v; lwp0.l_md.md_regs = (struct frame *)(v + USPACE) - 1; - proc0paddr->u_pcb.pcb_context[11] = + lwp0.l_addr->u_pcb.pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */ /* diff --git a/sys/arch/next68k/next68k/locore.s b/sys/arch/next68k/next68k/locore.s index f41a2b4b355..3d3c9a5732f 100644 --- a/sys/arch/next68k/next68k/locore.s +++ b/sys/arch/next68k/next68k/locore.s @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.50 2009/01/11 06:02:19 tsutsui Exp $ */ +/* $NetBSD: locore.s,v 1.51 2009/11/26 00:19:20 matt Exp $ */ /* * Copyright (c) 1998 Darrin B. Jewell @@ -460,11 +460,10 @@ Lpushpc: /* set kernel stack, user %SP, and initial pcb */ - movl _C_LABEL(proc0paddr),%a1 | get lwp0 pcb addr - lea %a1@(USPACE-4),%sp | set kernel stack to end of area - lea _C_LABEL(lwp0),%a2 | initialize lwp0.l_addr - movl %a2,_C_LABEL(curlwp) | and curlwp so that - movl %a1,%a2@(L_ADDR) | we don't deref NULL in trap() + lea _C_LABEL(lwp0),%a2 | get lwp0.l_addr + movl %a2@(L_ADDR),%a1 | set kernel stack to end of area + lea %a1@(USPACE-4),%sp | and curlwp so that we don't + movl %a2,_C_LABEL(curlwp) | deref NULL in trap() movl #USRSTACK-4,%a2 movl %a2,%usp | init user SP movl %a1,_C_LABEL(curpcb) | lwp0 is running @@ -1384,9 +1383,6 @@ GLOBAL(protorp) GLOBAL(prototc) .long 0 | prototype translation control -GLOBAL(proc0paddr) - .long 0 | KVA of lwp0 u-area - GLOBAL(intiobase) .long INTIOBASE | KVA of base of internal IO space diff --git a/sys/arch/next68k/next68k/pmap_bootstrap.c b/sys/arch/next68k/next68k/pmap_bootstrap.c index 3ce1f934d01..e1255fc440b 100644 --- a/sys/arch/next68k/next68k/pmap_bootstrap.c +++ b/sys/arch/next68k/next68k/pmap_bootstrap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap_bootstrap.c,v 1.27 2009/01/17 07:17:36 tsutsui Exp $ */ +/* $NetBSD: pmap_bootstrap.c,v 1.28 2009/11/26 00:19:20 matt Exp $ */ /* * This file was taken from mvme68k/mvme68k/pmap_bootstrap.c @@ -45,7 +45,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.27 2009/01/17 07:17:36 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.28 2009/11/26 00:19:20 matt Exp $"); #include <sys/param.h> #include <sys/kcore.h> @@ -65,7 +65,6 @@ __KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.27 2009/01/17 07:17:36 tsutsui #define RELOCPTR(v, t) ((t)((uintptr_t)RELOC((v), t) + firstpa)) extern char *etext; -extern char *proc0paddr; extern int maxmem, physmem; extern paddr_t avail_start, avail_end; @@ -102,7 +101,7 @@ void *msgbufaddr; void pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) { - paddr_t kstpa, kptpa, kptmpa, lkptpa, p0upa; + paddr_t kstpa, kptpa, kptmpa, lkptpa, l0upa; u_int nptpages, kstsize; st_entry_t protoste, *ste; pt_entry_t protopte, *pte, *epte; @@ -126,7 +125,7 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) * * lkptpa last kernel PT page 1 page * - * p0upa proc 0 u-area UPAGES pages + * l0upa lwp 0 u-area UPAGES pages * * The KVA corresponding to any of these PAs is: * (PA - firstpa + KERNBASE). @@ -143,7 +142,7 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) nextpa += PAGE_SIZE; lkptpa = nextpa; nextpa += PAGE_SIZE; - p0upa = nextpa; + l0upa = nextpa; nextpa += USPACE; kptpa = nextpa; nptpages = RELOC(Sysptsize, int) + @@ -361,7 +360,7 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) * map the kernel segment table cache invalidated for * these machines (for the 68040 not strictly necessary, but * recommended by Motorola; for the 68060 mandatory) - * XXX this includes p0upa. why? + * XXX this includes l0upa. why? */ epte = &((u_int *)kptpa)[m68k_btop(nextpa - firstpa)]; protopte = (protopte & ~PG_PROT) | PG_RW; @@ -442,15 +441,15 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) * Zero the u-area. * NOTE: `pte' and `epte' aren't PTEs here. */ - pte = (u_int *)p0upa; - epte = (u_int *)(p0upa + USPACE); + pte = (u_int *)l0upa; + epte = (u_int *)(l0upa + USPACE); while (pte < epte) *pte++ = 0; /* * Remember the u-area address so it can be loaded in the * proc struct p_addr field later. */ - RELOC(proc0paddr, char *) = (char *)(p0upa - firstpa); + RELOC(lwp0.l_addr, struct user *) = (struct user *)(l0upa - firstpa); /* * Initialize the mem_clusters[] array for the crash dump diff --git a/sys/arch/ofppc/ofppc/locore.S b/sys/arch/ofppc/ofppc/locore.S index 789472a9196..40675a5b9ed 100644 --- a/sys/arch/ofppc/ofppc/locore.S +++ b/sys/arch/ofppc/ofppc/locore.S @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.41 2009/02/13 22:41:02 apb Exp $ */ +/* $NetBSD: locore.S,v 1.42 2009/11/26 00:19:20 matt Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -64,8 +64,6 @@ .data GLOBAL(esym) .long 0 /* end of symbol table */ -GLOBAL(proc0paddr) - .long 0 /* proc0 p_addr */ GLOBAL(oeacpufeat) .long 0 /* cpu features */ diff --git a/sys/arch/playstation2/playstation2/machdep.c b/sys/arch/playstation2/playstation2/machdep.c index b99f9a38fef..e38baaf4e60 100644 --- a/sys/arch/playstation2/playstation2/machdep.c +++ b/sys/arch/playstation2/playstation2/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.26 2009/08/11 17:04:19 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.27 2009/11/26 00:19:20 matt Exp $ */ /*- * Copyright (c) 2001 The NetBSD Foundation, Inc. @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.26 2009/08/11 17:04:19 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.27 2009/11/26 00:19:20 matt Exp $"); #include "opt_ddb.h" #include "opt_kloader.h" @@ -90,7 +90,6 @@ void mach_init(void) { extern char kernel_text[], edata[], end[]; - extern struct user *proc0paddr; void *kernend, *v; paddr_t start; size_t size; @@ -155,11 +154,11 @@ mach_init(void) * Allocate space for proc0's USPACE. */ v = (void *)uvm_pageboot_alloc(USPACE); - lwp0.l_addr = proc0paddr = (struct user *) v; + lwp0.l_addr = (struct user *) v; lwp0.l_md.md_regs = (struct frame *)(v + USPACE) - 1; - proc0paddr->u_pcb.pcb_context[11] = PSL_LOWIPL; /* SR */ + lwp0.l_addr->u_pcb.pcb_context[11] = PSL_LOWIPL; /* SR */ #ifdef IPL_ICU_MASK - proc0paddr->u_pcb.pcb_ppl = 0; + lwp0.l_addr->u_pcb.pcb_ppl = 0; #endif } diff --git a/sys/arch/pmax/pmax/machdep.c b/sys/arch/pmax/pmax/machdep.c index 73fb23d5c6a..4dea9fe5ffd 100644 --- a/sys/arch/pmax/pmax/machdep.c +++ b/sys/arch/pmax/pmax/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.235 2009/08/15 23:44:59 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.236 2009/11/26 00:19:20 matt Exp $ */ /* * Copyright (c) 1992, 1993 @@ -77,7 +77,7 @@ */ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.235 2009/08/15 23:44:59 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.236 2009/11/26 00:19:20 matt Exp $"); #include "fs_mfs.h" #include "opt_ddb.h" @@ -181,7 +181,6 @@ struct platform platform = { }; extern void *esym; /* XXX */ -extern struct user *proc0paddr; /* XXX */ extern struct consdev promcd; /* XXX */ /* @@ -340,10 +339,10 @@ mach_init(int argc, char *argv[], int code, int cv, u_int bim, char *bip) /* * Alloc u pages for proc0 stealing KSEG0 memory. */ - lwp0.l_addr = proc0paddr = (struct user *)kernend; + lwp0.l_addr = (struct user *)kernend; lwp0.l_md.md_regs = (struct frame *)(kernend + USPACE) - 1; memset(lwp0.l_addr, 0, USPACE); - proc0paddr->u_pcb.pcb_context[11] = + lwp0.l_addr->u_pcb.pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */ kernend += USPACE; diff --git a/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c b/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c index 67f303d3364..53a28bc188a 100644 --- a/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c +++ b/sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: ibm4xx_machdep.c,v 1.10 2009/11/21 17:40:28 rmind Exp $ */ +/* $NetBSD: ibm4xx_machdep.c,v 1.11 2009/11/26 00:19:20 matt Exp $ */ /* Original: ibm40x_machdep.c,v 1.3 2005/01/17 17:19:36 shige Exp $ */ /* @@ -68,7 +68,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ibm4xx_machdep.c,v 1.10 2009/11/21 17:40:28 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ibm4xx_machdep.c,v 1.11 2009/11/26 00:19:20 matt Exp $"); #include "opt_compat_netbsd.h" #include "opt_ddb.h" @@ -101,7 +101,6 @@ __KERNEL_RCSID(0, "$NetBSD: ibm4xx_machdep.c,v 1.10 2009/11/21 17:40:28 rmind Ex /* * Global variables used here and there */ -extern struct user *proc0paddr; paddr_t msgbuf_paddr; vaddr_t msgbuf_vaddr; char msgbuf[MSGBUFSIZE]; @@ -141,12 +140,10 @@ ibm4xx_init(void (*handler)(void)) KASSERT(ci != NULL); KASSERT(curcpu() == ci); lwp0.l_cpu = ci; - lwp0.l_addr = proc0paddr; + curpcb = lwp_getpcb(&lwp0); memset(lwp0.l_addr, 0, sizeof *lwp0.l_addr); KASSERT(lwp0.l_cpu != NULL); - curpcb = lwp_getpcb(&lwp0); - memset(curpcb, 0, sizeof(*curpcb)); curpcb->pcb_pm = pmap_kernel(); /* diff --git a/sys/arch/powerpc/ibm4xx/openbios/locore.S b/sys/arch/powerpc/ibm4xx/openbios/locore.S index c0e94fa6b75..d46cf68df6b 100644 --- a/sys/arch/powerpc/ibm4xx/openbios/locore.S +++ b/sys/arch/powerpc/ibm4xx/openbios/locore.S @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.5 2009/02/13 22:41:03 apb Exp $ */ +/* $NetBSD: locore.S,v 1.6 2009/11/26 00:19:20 matt Exp $ */ /* $OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $ */ /* @@ -102,9 +102,6 @@ /* * Globals */ -GLOBAL(proc0paddr) - .long 0 /* proc0 p_addr */ - GLOBAL(intrnames) .asciz "clock", "irq1", "irq2", "irq3" .asciz "irq4", "irq5", "irq6", "irq7" diff --git a/sys/arch/powerpc/include/asm.h b/sys/arch/powerpc/include/asm.h index 85de7579e22..5ac25b9d345 100644 --- a/sys/arch/powerpc/include/asm.h +++ b/sys/arch/powerpc/include/asm.h @@ -1,4 +1,4 @@ -/* $NetBSD: asm.h,v 1.26 2008/02/23 19:38:47 matt Exp $ */ +/* $NetBSD: asm.h,v 1.27 2009/11/26 00:19:20 matt Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -175,8 +175,8 @@ y: .quad .y,.TOC.@tocbase,0; \ stint tmp2,CI_INTRDEPTH(tmp1); \ li tmp2,0; \ stptr tmp2,-CALLFRAMELEN(er); /* terminate idle stack chain */\ - lis tmp1,_C_LABEL(proc0paddr)@ha; \ - stptr er,_C_LABEL(proc0paddr)@l(tmp1); \ + lis tmp1,_C_LABEL(lwp0)+L_ADDR@ha; \ + stptr er,_C_LABEL(lwp0)+L_ADDR@l(tmp1); \ addi er,er,USPACE; /* stackpointer for proc0 */ \ addi sp,er,-FRAMELEN; /* stackpointer for proc0 */ \ /* er = end of mem reserved for kernel */ \ diff --git a/sys/arch/powerpc/oea/oea_machdep.c b/sys/arch/powerpc/oea/oea_machdep.c index 63f180a49cc..5d6a755854e 100644 --- a/sys/arch/powerpc/oea/oea_machdep.c +++ b/sys/arch/powerpc/oea/oea_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: oea_machdep.c,v 1.49 2009/11/21 17:40:29 rmind Exp $ */ +/* $NetBSD: oea_machdep.c,v 1.50 2009/11/26 00:19:20 matt Exp $ */ /* * Copyright (C) 2002 Matt Thomas @@ -33,7 +33,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: oea_machdep.c,v 1.49 2009/11/21 17:40:29 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: oea_machdep.c,v 1.50 2009/11/26 00:19:20 matt Exp $"); #include "opt_ppcarch.h" #include "opt_compat_netbsd.h" @@ -94,8 +94,6 @@ struct vm_map *phys_map = NULL; /* * Global variables used here and there */ -extern struct user *proc0paddr; - static void trap0(void *); /* XXXSL: The battable is not initialized to non-zero for PPC_OEA64 and PPC_OEA64_BRIDGE */ @@ -152,12 +150,10 @@ oea_init(void (*handler)(void)) KASSERT(ci != NULL); KASSERT(curcpu() == ci); lwp0.l_cpu = ci; - lwp0.l_addr = proc0paddr; + curpcb = lwp_getpcb(&lwp0); memset(lwp0.l_addr, 0, sizeof *lwp0.l_addr); KASSERT(lwp0.l_cpu != NULL); - curpcb = lwp_getpcb(&lwp0); - memset(curpcb, 0, sizeof(*curpcb)); #ifdef ALTIVEC /* * Initialize the vectors with NaNs diff --git a/sys/arch/prep/prep/locore.S b/sys/arch/prep/prep/locore.S index 85cf825f0e3..bb331222b37 100644 --- a/sys/arch/prep/prep/locore.S +++ b/sys/arch/prep/prep/locore.S @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.12 2009/02/13 22:41:03 apb Exp $ */ +/* $NetBSD: locore.S,v 1.13 2009/11/26 00:19:21 matt Exp $ */ /* $OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $ */ /* @@ -78,8 +78,6 @@ GLOBAL(startsym) .long 0 /* start symbol table */ GLOBAL(endsym) .long 0 /* end symbol table */ -GLOBAL(proc0paddr) - .long 0 /* proc0 p_addr */ GLOBAL(oeacpufeat) .long 0 /* cpu features */ diff --git a/sys/arch/rs6000/rs6000/locore.S b/sys/arch/rs6000/rs6000/locore.S index d679fa29bce..41294e94111 100644 --- a/sys/arch/rs6000/rs6000/locore.S +++ b/sys/arch/rs6000/rs6000/locore.S @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.4 2009/02/13 22:41:03 apb Exp $ */ +/* $NetBSD: locore.S,v 1.5 2009/11/26 00:19:21 matt Exp $ */ /* $OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $ */ /* @@ -82,8 +82,6 @@ GLOBAL(startsym) .long 0 /* start symbol table */ GLOBAL(endsym) .long 0 /* end symbol table */ -GLOBAL(proc0paddr) - .long 0 /* proc0 p_addr */ GLOBAL(oeacpufeat) .long 0 /* cpu features */ /* diff --git a/sys/arch/sandpoint/sandpoint/locore.S b/sys/arch/sandpoint/sandpoint/locore.S index c59f1ea45cc..0bdec2ce87b 100644 --- a/sys/arch/sandpoint/sandpoint/locore.S +++ b/sys/arch/sandpoint/sandpoint/locore.S @@ -1,4 +1,4 @@ -/* $NetBSD: locore.S,v 1.15 2009/02/13 22:41:03 apb Exp $ */ +/* $NetBSD: locore.S,v 1.16 2009/11/26 00:19:21 matt Exp $ */ /* $OpenBSD: locore.S,v 1.4 1997/01/26 09:06:38 rahnds Exp $ */ /* @@ -68,8 +68,6 @@ GLOBAL(startsym) .long 0 /* start symbol table */ GLOBAL(endsym) .long 0 /* end symbol table */ -GLOBAL(proc0paddr) - .long 0 /* proc0 p_addr */ GLOBAL(oeacpufeat) .long 0 /* cpu features */ /* diff --git a/sys/arch/sbmips/sbmips/machdep.c b/sys/arch/sbmips/sbmips/machdep.c index 67f17b57cdf..105dc0cf0a1 100644 --- a/sys/arch/sbmips/sbmips/machdep.c +++ b/sys/arch/sbmips/sbmips/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.43 2009/03/18 16:00:14 cegger Exp $ */ +/* $NetBSD: machdep.c,v 1.44 2009/11/26 00:19:21 matt Exp $ */ /* * Copyright 2000, 2001 @@ -58,7 +58,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.43 2009/03/18 16:00:14 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.44 2009/11/26 00:19:21 matt Exp $"); #include "opt_ddb.h" #include "opt_execfmt.h" @@ -150,7 +150,6 @@ void mach_init(long, long, long, long); int safepri = MIPS_INT_MASK | MIPS_SR_INT_IE; extern void *esym; -extern struct user *proc0paddr; /* * Do all the stuff that locore normally does before calling main(). @@ -321,9 +320,9 @@ mach_init(long fwhandle, long magic, long bootdata, long reserved) * Allocate space for proc0's USPACE */ p0 = (void *)pmap_steal_memory(USPACE, NULL, NULL); - lwp0.l_addr = proc0paddr = (struct user *)p0; + lwp0.l_addr = (struct user *)p0; lwp0.l_md.md_regs = (struct frame *)((char *)p0 + USPACE) - 1; - proc0paddr->u_pcb.pcb_context[11] = + lwp0.l_addr->u_pcb.pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */ pmap_bootstrap(); diff --git a/sys/arch/sgimips/sgimips/machdep.c b/sys/arch/sgimips/sgimips/machdep.c index b3d6dec88bd..46fb8aabdbc 100644 --- a/sys/arch/sgimips/sgimips/machdep.c +++ b/sys/arch/sgimips/sgimips/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.128 2009/08/11 17:04:19 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.129 2009/11/26 00:19:21 matt Exp $ */ /* * Copyright (c) 2000 Soren S. Jorvang @@ -34,7 +34,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.128 2009/08/11 17:04:19 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.129 2009/11/26 00:19:21 matt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -265,7 +265,6 @@ struct platform platform = { int safepri = MIPS1_PSL_LOWIPL; extern u_int32_t ssir; -extern struct user *proc0paddr; extern char kernel_text[], edata[], end[]; uint8_t *bootinfo; /* pointer to bootinfo structure */ @@ -736,9 +735,9 @@ mach_init(int argc, char *argv[], u_int magic, void *bip) * Allocate space for proc0's USPACE. */ v = (void *)uvm_pageboot_alloc(USPACE); - lwp0.l_addr = proc0paddr = (struct user *)v; + lwp0.l_addr = (struct user *)v; lwp0.l_md.md_regs = (struct frame *)((char *)v + USPACE) - 1; - proc0paddr->u_pcb.pcb_context[11] = + lwp0.l_addr->u_pcb.pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */ } diff --git a/sys/arch/sh3/sh3/sh3_machdep.c b/sys/arch/sh3/sh3/sh3_machdep.c index 75651453d28..78ebde15539 100644 --- a/sys/arch/sh3/sh3/sh3_machdep.c +++ b/sys/arch/sh3/sh3/sh3_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: sh3_machdep.c,v 1.82 2009/11/21 17:40:28 rmind Exp $ */ +/* $NetBSD: sh3_machdep.c,v 1.83 2009/11/26 00:19:21 matt Exp $ */ /*- * Copyright (c) 1996, 1997, 1998, 2002 The NetBSD Foundation, Inc. @@ -65,7 +65,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sh3_machdep.c,v 1.82 2009/11/21 17:40:28 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sh3_machdep.c,v 1.83 2009/11/26 00:19:21 matt Exp $"); #include "opt_kgdb.h" #include "opt_memsize.h" @@ -114,7 +114,6 @@ char cpu_model[120]; struct vm_map *mb_map; struct vm_map *phys_map; -struct user *proc0paddr; /* init_main.c use this. */ struct pcb *curpcb; #if !defined(IOM_RAM_BEGIN) @@ -209,9 +208,9 @@ sh_proc0_init() u = uvm_pageboot_alloc(USPACE); memset((void *)u, 0, USPACE); - /* Setup proc0 */ - proc0paddr = (struct user *)u; - lwp0.l_addr = proc0paddr; + /* Setup lwp0 */ + lwp0.l_addr = (struct user *)u; + /* * u-area map: * |user| .... | .................. | diff --git a/sys/arch/shark/ofw/ofw.c b/sys/arch/shark/ofw/ofw.c index 31fb6b49543..9bc7658d835 100644 --- a/sys/arch/shark/ofw/ofw.c +++ b/sys/arch/shark/ofw/ofw.c @@ -1,4 +1,4 @@ -/* $NetBSD: ofw.c,v 1.50 2009/08/11 17:04:19 matt Exp $ */ +/* $NetBSD: ofw.c,v 1.51 2009/11/26 00:19:22 matt Exp $ */ /* * Copyright 1997 @@ -41,7 +41,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: ofw.c,v 1.50 2009/08/11 17:04:19 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ofw.c,v 1.51 2009/11/26 00:19:22 matt Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -788,13 +788,9 @@ ofw_configmem(void) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - { - extern struct user *proc0paddr; - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; - } + lwp0.l_addr = (struct user *)kernelstack.pv_va; - /* Aaaaaaaah, running in the proc0 address space! */ + /* Aaaaaaaah, running in the lwp0 address space! */ /* I feel good... */ /* Set-up the various globals which describe physical memory for pmap. */ diff --git a/sys/arch/sparc/sparc/autoconf.c b/sys/arch/sparc/sparc/autoconf.c index 5660c80bf6a..847aa7f9487 100644 --- a/sys/arch/sparc/sparc/autoconf.c +++ b/sys/arch/sparc/sparc/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.235 2009/11/07 07:27:46 cegger Exp $ */ +/* $NetBSD: autoconf.c,v 1.236 2009/11/26 00:19:22 matt Exp $ */ /* * Copyright (c) 1996 @@ -48,7 +48,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.235 2009/11/07 07:27:46 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.236 2009/11/26 00:19:22 matt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -263,7 +263,7 @@ static void bootstrapIIep(void); void bootstrap(void) { - extern struct user *proc0paddr; + extern struct user u0; #if NKSYMS || defined(DDB) || defined(MODULAR) struct btinfo_symtab *bi_sym; #else @@ -275,8 +275,7 @@ bootstrap(void) /* Find the number of CPUs as early as possible */ sparc_ncpus = find_cpus(); - /* Attach user structure to proc0 */ - lwp0.l_addr = proc0paddr; + lwp0.l_addr = &u0; cpuinfo.master = 1; getcpuinfo(&cpuinfo, 0); @@ -970,14 +969,11 @@ cpu_configure(void) panic("mainbus not configured"); /* - * XXX Re-zero proc0's user area, to nullify the effect of the + * XXX Re-zero lwp0's user area, to nullify the effect of the * XXX stack running into it during auto-configuration. * XXX - should fix stack usage. */ - { - extern struct user *proc0paddr; - memset(proc0paddr, 0, sizeof(struct user)); - } + memset(lwp0.l_addr, 0, sizeof(struct user)); spl0(); } diff --git a/sys/arch/sparc/sparc/locore.s b/sys/arch/sparc/sparc/locore.s index 08893865d91..97aac502280 100644 --- a/sys/arch/sparc/sparc/locore.s +++ b/sys/arch/sparc/sparc/locore.s @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.247 2009/06/05 01:36:07 mrg Exp $ */ +/* $NetBSD: locore.s,v 1.248 2009/11/26 00:19:22 matt Exp $ */ /* * Copyright (c) 1996 Paul Kranenburg @@ -6331,9 +6331,5 @@ _C_LABEL(kernel_top): _C_LABEL(bootinfo): .word 0 - .globl _C_LABEL(proc0paddr) -_C_LABEL(proc0paddr): - .word _C_LABEL(u0) ! KVA of proc0 uarea - .comm _C_LABEL(nwindows), 4 .comm _C_LABEL(romp), 4 diff --git a/sys/arch/sparc/sparc/machdep.c b/sys/arch/sparc/sparc/machdep.c index 90ddee985d4..0c039e15817 100644 --- a/sys/arch/sparc/sparc/machdep.c +++ b/sys/arch/sparc/sparc/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.297 2009/11/21 04:16:51 rmind Exp $ */ +/* $NetBSD: machdep.c,v 1.298 2009/11/26 00:19:22 matt Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -71,7 +71,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.297 2009/11/21 04:16:51 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.298 2009/11/26 00:19:22 matt Exp $"); #include "opt_compat_netbsd.h" #include "opt_compat_sunos.h" @@ -1192,10 +1192,7 @@ ldcontrolb(void *addr) } s = splhigh(); - if (curlwp == NULL) - xpcb = lwp_getpcb(&lwp0); - else - xpcb = lwp_getpcb(curlwp); + xpcb = lwp_getpcb(curlwp); saveonfault = (u_long)xpcb->pcb_onfault; res = xldcontrolb(addr, xpcb); diff --git a/sys/arch/sparc64/sparc64/locore.s b/sys/arch/sparc64/sparc64/locore.s index 380fb74b6fa..1fdfab8dded 100644 --- a/sys/arch/sparc64/sparc64/locore.s +++ b/sys/arch/sparc64/sparc64/locore.s @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.293 2009/11/25 02:34:34 mrg Exp $ */ +/* $NetBSD: locore.s,v 1.294 2009/11/26 00:19:22 matt Exp $ */ /* * Copyright (c) 1996-2002 Eduardo Horvath @@ -10122,11 +10122,6 @@ _C_LABEL(esym): _C_LABEL(ssym): POINTER 0 #endif - ! XXX should it called lwp0paddr - .globl _C_LABEL(proc0paddr) -_C_LABEL(proc0paddr): - POINTER 0 - .comm _C_LABEL(promvec), PTRSZ #ifdef DEBUG diff --git a/sys/arch/sparc64/sparc64/pmap.c b/sys/arch/sparc64/sparc64/pmap.c index e0cff0ed8b5..1ffa4c16f0d 100644 --- a/sys/arch/sparc64/sparc64/pmap.c +++ b/sys/arch/sparc64/sparc64/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.242 2009/11/07 07:27:47 cegger Exp $ */ +/* $NetBSD: pmap.c,v 1.243 2009/11/26 00:19:22 matt Exp $ */ /* * * Copyright (C) 1996-1999 Eduardo Horvath. @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.242 2009/11/07 07:27:47 cegger Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.243 2009/11/26 00:19:22 matt Exp $"); #undef NO_VCACHE /* Don't forget the locked TLB in dostart */ #define HWREF @@ -1044,7 +1044,6 @@ pmap_bootstrap(u_long kernelstart, u_long kernelend) /* Let's keep 1 page of redzone after the kernel */ vmmap += PAGE_SIZE; { - extern struct pcb *proc0paddr; extern void main(void); vaddr_t u0va; paddr_t pa; @@ -1052,7 +1051,7 @@ pmap_bootstrap(u_long kernelstart, u_long kernelend) u0va = vmmap; BDPRINTF(PDB_BOOT1, - ("Inserting proc0 USPACE into pmap_kernel() at %p\n", + ("Inserting lwp0 USPACE into pmap_kernel() at %p\n", vmmap)); while (vmmap < u0va + 2*USPACE) { @@ -1129,7 +1128,6 @@ pmap_bootstrap(u_long kernelstart, u_long kernelend) cpus->ci_spinup = main; /* Call main when we're running. */ cpus->ci_paddr = cpu0paddr; cpus->ci_cpcb = (struct pcb *)u0va; - proc0paddr = cpus->ci_cpcb; cpus->ci_idepth = -1; memset(cpus->ci_intrpending, -1, sizeof(cpus->ci_intrpending)); diff --git a/sys/arch/sun2/sun2/locore.s b/sys/arch/sun2/sun2/locore.s index 594f68c2419..28d48462daf 100644 --- a/sys/arch/sun2/sun2/locore.s +++ b/sys/arch/sun2/sun2/locore.s @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.20 2007/10/17 19:57:43 garbled Exp $ */ +/* $NetBSD: locore.s,v 1.21 2009/11/26 00:19:22 matt Exp $ */ /* * Copyright (c) 1980, 1990, 1993 @@ -154,7 +154,8 @@ L_high_code: movc %d0,%dfc | Setup process zero user/kernel stacks. - movl _C_LABEL(proc0paddr),%a1 | get proc0 pcb addr + lea _C_LABEL(lwp0),%a0 | lwp0 + movl %a0@(L_ADDR),%a1 | get lwp0 pcb addr lea %a1@(USPACE-4),%sp | set SSP to last word movl #USRSTACK-4,%a2 movl %a2,%usp | init user SP @@ -175,8 +176,7 @@ L_high_code: movw #PSL_USER,%sp@- | tf_sr for user mode clrl %sp@- | tf_stackadj lea %sp@(-64),%sp | tf_regs[16] - lea _C_LABEL(lwp0),%a0 | proc0.p_md.md_regs = - movl %a1,%a0@(L_MD_REGS) | trapframe + movl %a1,%a0@(L_MD_REGS) | lwp0.p_md.md_regs = trapframe jbsr _C_LABEL(main) | main(&trapframe) PANIC("main() returned") diff --git a/sys/arch/sun2/sun2/locore2.c b/sys/arch/sun2/sun2/locore2.c index ad0d38c5d13..7949de901ab 100644 --- a/sys/arch/sun2/sun2/locore2.c +++ b/sys/arch/sun2/sun2/locore2.c @@ -1,4 +1,4 @@ -/* $NetBSD: locore2.c,v 1.21 2009/08/11 17:04:19 matt Exp $ */ +/* $NetBSD: locore2.c,v 1.22 2009/11/26 00:19:22 matt Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: locore2.c,v 1.21 2009/08/11 17:04:19 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: locore2.c,v 1.22 2009/11/26 00:19:22 matt Exp $"); #include "opt_ddb.h" #include "opt_modular.h" @@ -94,7 +94,6 @@ int cpu_has_vme = 0; */ int delay_divisor = 82; /* assume the fastest (3/260) */ -struct user *proc0paddr; /* proc[0] pcb address (u-area VA) */ extern struct pcb *curpcb; /* First C code called by locore.s */ @@ -188,16 +187,15 @@ _vm_init(void) * fault handler works in case we hit an early bug. * (The fault handler may reference lwp0 stuff.) */ - proc0paddr = (struct user *) nextva; + lwp0.l_addr = (struct user *) nextva; nextva += USPACE; - memset((void *)proc0paddr, 0, USPACE); - lwp0.l_addr = proc0paddr; + memset(lwp0.l_addr, 0, USPACE); /* * Now that lwp0 exists, make it the "current" one. */ curlwp = &lwp0; - curpcb = &proc0paddr->u_pcb; + curpcb = &lwp0.l_addr->u_pcb; /* This does most of the real work. */ pmap_bootstrap(nextva); diff --git a/sys/arch/sun3/sun3/locore.s b/sys/arch/sun3/sun3/locore.s index a3505b8e992..6937085c096 100644 --- a/sys/arch/sun3/sun3/locore.s +++ b/sys/arch/sun3/sun3/locore.s @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.89 2007/10/17 19:57:46 garbled Exp $ */ +/* $NetBSD: locore.s,v 1.90 2009/11/26 00:19:22 matt Exp $ */ /* * Copyright (c) 1980, 1990, 1993 @@ -152,7 +152,8 @@ L_high_code: movc %d0,%dfc | Setup process zero user/kernel stacks. - movl _C_LABEL(proc0paddr),%a1 | get lwp0 pcb addr + lea _C_LABEL(lwp0),%a0 | lwp0 + movl %a0@(L_ADDR),%a1 | get lwp0 pcb addr lea %a1@(USPACE-4),%sp | set SSP to last word movl #USRSTACK-4,%a2 movl %a2,%usp | init user SP @@ -173,8 +174,7 @@ L_high_code: movw #PSL_USER,%sp@- | tf_sr for user mode clrl %sp@- | tf_stackadj lea %sp@(-64),%sp | tf_regs[16] - lea _C_LABEL(lwp0),%a0 | proc0.p_md.md_regs = - movl %a1,%a0@(L_MD_REGS) | trapframe + movl %a1,%a0@(L_MD_REGS) | lwp0.p_md.md_regs = trapframe jbsr _C_LABEL(main) | main(&trapframe) PANIC("main() returned") diff --git a/sys/arch/sun3/sun3/locore2.c b/sys/arch/sun3/sun3/locore2.c index 36a513feb42..05ff6cd04e9 100644 --- a/sys/arch/sun3/sun3/locore2.c +++ b/sys/arch/sun3/sun3/locore2.c @@ -1,4 +1,4 @@ -/* $NetBSD: locore2.c,v 1.94 2009/08/11 17:04:20 matt Exp $ */ +/* $NetBSD: locore2.c,v 1.95 2009/11/26 00:19:23 matt Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: locore2.c,v 1.94 2009/08/11 17:04:20 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: locore2.c,v 1.95 2009/11/26 00:19:23 matt Exp $"); #include "opt_ddb.h" #include "opt_modular.h" @@ -96,7 +96,6 @@ int cpu_has_vme = 0; */ int delay_divisor = 82; /* assume the fastest (3/260) */ -struct user *proc0paddr; /* proc[0] pcb address (u-area VA) */ extern struct pcb *curpcb; /* First C code called by locore.s */ @@ -203,16 +202,15 @@ _vm_init(void) * fault handler works in case we hit an early bug. * (The fault handler may reference lwp0 stuff.) */ - proc0paddr = (struct user *) nextva; + lwp0.l_addr = (struct user *) nextva; nextva += USPACE; - memset((void *)proc0paddr, 0, USPACE); - lwp0.l_addr = proc0paddr; + memset(lwp0.l_addr, 0, USPACE); /* * Now that lwp0 exists, make it the "current" one. */ curlwp = &lwp0; - curpcb = &proc0paddr->u_pcb; + curpcb = &lwp0.l_addr->u_pcb; /* This does most of the real work. */ pmap_bootstrap(nextva); diff --git a/sys/arch/sun3/sun3x/locore.s b/sys/arch/sun3/sun3x/locore.s index a72303b5536..b21f3326790 100644 --- a/sys/arch/sun3/sun3x/locore.s +++ b/sys/arch/sun3/sun3x/locore.s @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.57 2007/10/17 19:57:47 garbled Exp $ */ +/* $NetBSD: locore.s,v 1.58 2009/11/26 00:19:23 matt Exp $ */ /* * Copyright (c) 1980, 1990, 1993 @@ -166,7 +166,8 @@ L_high_code: movc %d0,%dfc | Setup process zero user/kernel stacks. - movl _C_LABEL(proc0paddr),%a1| get lwp0 pcb addr + lea _C_LABEL(lwp0),%a0 | get lwp0 + movl %a0@(L_ADDR),%a1 | get lwp0 pcb addr lea %a1@(USPACE-4),%sp | set SSP to last word movl #USRSTACK-4,%a2 movl %a2,%usp | init user SP @@ -187,8 +188,7 @@ L_high_code: movw #PSL_USER,%sp@- | tf_sr for user mode clrl %sp@- | tf_stackadj lea %sp@(-64),%sp | tf_regs[16] - lea _C_LABEL(lwp0),%a0 | proc0.p_md.md_regs = - movl %a1,%a0@(L_MD_REGS) | trapframe + movl %a1,%a0@(L_MD_REGS) | lwp0.l_md.md_regs = trapframe jbsr _C_LABEL(main) | main(&trapframe) PANIC("main() returned") diff --git a/sys/arch/sun3/sun3x/locore2.c b/sys/arch/sun3/sun3x/locore2.c index 4a4e910cef7..2859ac93d92 100644 --- a/sys/arch/sun3/sun3x/locore2.c +++ b/sys/arch/sun3/sun3x/locore2.c @@ -1,4 +1,4 @@ -/* $NetBSD: locore2.c,v 1.35 2009/11/21 04:16:53 rmind Exp $ */ +/* $NetBSD: locore2.c,v 1.36 2009/11/26 00:19:23 matt Exp $ */ /*- * Copyright (c) 1996 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: locore2.c,v 1.35 2009/11/21 04:16:53 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: locore2.c,v 1.36 2009/11/26 00:19:23 matt Exp $"); #include "opt_ddb.h" @@ -76,7 +76,6 @@ int mmutype = MMU_68030; * Now our own stuff. */ -struct user *proc0paddr; /* proc[0] pcb address (u-area VA) */ extern struct pcb *curpcb; /* First C code called by locore.s */ @@ -168,16 +167,15 @@ _vm_init(void) * fault handler works in case we hit an early bug. * (The fault handler may reference lwp0 stuff.) */ - proc0paddr = (struct user *) nextva; + lwp0.l_addr = (struct user *) nextva; nextva += USPACE; - memset((void *)proc0paddr, 0, USPACE); - lwp0.l_addr = proc0paddr; + memset(lwp0.l_addr, 0, USPACE); /* * Now that lwp0 exists, make it the "current" one. */ curlwp = &lwp0; - curpcb = &proc0paddr->u_pcb; + curpcb = &lwp0.l_addr->u_pcb; /* This does most of the real work. */ pmap_bootstrap(nextva); diff --git a/sys/arch/sun3/sun3x/pmap.c b/sys/arch/sun3/sun3x/pmap.c index aff0eb19523..546163aa6e6 100644 --- a/sys/arch/sun3/sun3x/pmap.c +++ b/sys/arch/sun3/sun3x/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.109 2009/11/21 04:16:53 rmind Exp $ */ +/* $NetBSD: pmap.c,v 1.110 2009/11/26 00:19:23 matt Exp $ */ /*- * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. @@ -105,7 +105,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.109 2009/11/21 04:16:53 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.110 2009/11/26 00:19:23 matt Exp $"); #include "opt_ddb.h" #include "opt_pmap_debug.h" @@ -1120,7 +1120,7 @@ pmap_init_a_tables(void) a_tbl->at_dtbl = &mmuAbase[i * MMU_A_TBL_SIZE]; /* - * Initialize the MMU A table with the table in the `proc0', + * Initialize the MMU A table with the table in the `lwp0', * or kernel, mapping. This ensures that every process has * the kernel mapped in the top part of its address space. */ diff --git a/sys/arch/usermode/usermode/machdep.c b/sys/arch/usermode/usermode/machdep.c index 042a598514e..02d1cb8ea05 100644 --- a/sys/arch/usermode/usermode/machdep.c +++ b/sys/arch/usermode/usermode/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.6 2009/10/21 16:07:00 snj Exp $ */ +/* $NetBSD: machdep.c,v 1.7 2009/11/26 00:19:23 matt Exp $ */ /*- * Copyright (c) 2007 Jared D. McNeill <jmcneill@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.6 2009/10/21 16:07:00 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.7 2009/11/26 00:19:23 matt Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -44,7 +44,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.6 2009/10/21 16:07:00 snj Exp $"); char machine[] = "usermode"; char machine_arch[] = "usermode"; -paddr_t proc0paddr = 0; int usermode_x = IPL_NONE; /* XXX */ int physmem = MEMSIZE * 1024 / PAGE_SIZE; diff --git a/sys/arch/vax/vax/db_machdep.c b/sys/arch/vax/vax/db_machdep.c index bde3e5ca98e..09b35b8fcf2 100644 --- a/sys/arch/vax/vax/db_machdep.c +++ b/sys/arch/vax/vax/db_machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: db_machdep.c,v 1.53 2009/11/21 04:45:39 rmind Exp $ */ +/* $NetBSD: db_machdep.c,v 1.54 2009/11/26 00:19:23 matt Exp $ */ /* * :set tabs=4 @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.53 2009/11/21 04:45:39 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.54 2009/11/26 00:19:23 matt Exp $"); #include "opt_ddb.h" #include "opt_multiprocessor.h" @@ -481,13 +481,9 @@ db_stack_trace_print( } #endif } - if (p == NULL) { - pcb = lwp_getpcb(&lwp0); - curpid = 0; - } else { - pcb = lwp_getpcb(l); - curpid = p->p_pid; - } + KASSERT(l != NULL); + pcb = lwp_getpcb(l); + curpid = p->p_pid; (*pr)("Process %d.%d\n", curpid, l->l_lid); (*pr)(" PCB contents:\n"); (*pr)(" KSP = 0x%x\n", (unsigned int)(pcb->KSP)); diff --git a/sys/arch/vax/vax/locore.c b/sys/arch/vax/vax/locore.c index a4b52a38cbf..2c8d13e992a 100644 --- a/sys/arch/vax/vax/locore.c +++ b/sys/arch/vax/vax/locore.c @@ -1,4 +1,4 @@ -/* $NetBSD: locore.c,v 1.76 2009/01/22 18:49:03 christos Exp $ */ +/* $NetBSD: locore.c,v 1.77 2009/11/26 00:19:23 matt Exp $ */ /* * Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden. * All rights reserved. @@ -32,7 +32,7 @@ /* All bugs are subject to removal without further notice */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: locore.c,v 1.76 2009/01/22 18:49:03 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: locore.c,v 1.77 2009/11/26 00:19:23 matt Exp $"); #include "opt_compat_netbsd.h" @@ -62,7 +62,6 @@ void main(void); extern paddr_t avail_end; paddr_t esym; -struct user *proc0paddr; /* * The strict CPU-dependent information is set up here, in @@ -321,13 +320,13 @@ _start(struct rpb *prpb) */ #if defined(COMPAT_14) if (prpb == 0) { - memset((char *)proc0paddr + REDZONEADDR, 0, sizeof(struct rpb)); - prpb = (struct rpb *)(proc0paddr + REDZONEADDR); + memset((char *)lwp0.l_addr + REDZONEADDR, 0, sizeof(struct rpb)); + prpb = (struct rpb *)((char *)lwp0.l_addr + REDZONEADDR); prpb->pfncnt = avail_end >> VAX_PGSHIFT; prpb->rpb_base = (void *)-1; /* RPB is fake */ } else #endif - memcpy((char *)proc0paddr + REDZONEADDR, prpb, sizeof(struct rpb)); + memcpy((char *)lwp0.l_addr + REDZONEADDR, prpb, sizeof(struct rpb)); if (prpb->pfncnt) avail_end = prpb->pfncnt << VAX_PGSHIFT; else @@ -337,15 +336,13 @@ _start(struct rpb *prpb) avail_end &= ~PGOFSET; /* be sure */ - lwp0.l_addr = (void *)proc0paddr; /* XXX */ - pmap_bootstrap(); /* Now running virtual. set red zone for proc0 */ pt = kvtopte((u_int)lwp0.l_addr + REDZONEADDR); pt->pg_v = 0; - ((struct pcb *)proc0paddr)->framep = (void *)scratch; + lwp0.l_addr->u_pcb.framep = (void *)scratch; /* * Change mode down to userspace is done by faking a stack diff --git a/sys/arch/vax/vax/multicpu.c b/sys/arch/vax/vax/multicpu.c index c47d9abe6b9..21899789927 100644 --- a/sys/arch/vax/vax/multicpu.c +++ b/sys/arch/vax/vax/multicpu.c @@ -1,4 +1,4 @@ -/* $NetBSD: multicpu.c,v 1.27 2009/11/21 04:45:39 rmind Exp $ */ +/* $NetBSD: multicpu.c,v 1.28 2009/11/26 00:19:23 matt Exp $ */ /* * Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved. @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: multicpu.c,v 1.27 2009/11/21 04:45:39 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: multicpu.c,v 1.28 2009/11/26 00:19:23 matt Exp $"); #include "opt_multiprocessor.h" @@ -62,7 +62,7 @@ struct cpuq { SIMPLEQ_HEAD(, cpuq) cpuq = SIMPLEQ_HEAD_INITIALIZER(cpuq); -extern long avail_start, avail_end, proc0paddr; +extern long avail_start, avail_end; struct cpu_info_qh cpus = SIMPLEQ_HEAD_INITIALIZER(cpus); void diff --git a/sys/arch/vax/vax/pmap.c b/sys/arch/vax/vax/pmap.c index 2329e177d14..28b97998172 100644 --- a/sys/arch/vax/vax/pmap.c +++ b/sys/arch/vax/vax/pmap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.c,v 1.173 2009/11/21 04:45:39 rmind Exp $ */ +/* $NetBSD: pmap.c,v 1.174 2009/11/26 00:19:23 matt Exp $ */ /* * Copyright (c) 1994, 1998, 1999, 2003 Ludd, University of Lule}, Sweden. * All rights reserved. @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.173 2009/11/21 04:45:39 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.174 2009/11/26 00:19:23 matt Exp $"); #include "opt_ddb.h" #include "opt_cputype.h" @@ -259,8 +259,6 @@ calc_kvmsize(vsize_t usrptsize) return kvmsize; } -extern struct user *proc0paddr; - /* * pmap_bootstrap(). * Called as part of vm bootstrap, allocates internal pmap structures. @@ -270,7 +268,7 @@ extern struct user *proc0paddr; void pmap_bootstrap(void) { - struct pcb * const pcb = &proc0paddr->u_pcb; + struct pcb * const pcb = &lwp0.l_addr->u_pcb; struct pmap * const pmap = pmap_kernel(); struct cpu_info *ci; extern unsigned int etext; @@ -354,7 +352,7 @@ pmap_bootstrap(void) /* Init SCB and set up stray vectors. */ avail_start = scb_init(avail_start); - *(struct rpb *) 0 = *(struct rpb *) ((char *)proc0paddr + REDZONEADDR); + *(struct rpb *) 0 = *(struct rpb *) ((char *)lwp0.l_addr + REDZONEADDR); if (dep_call->cpu_steal_pages) (*dep_call->cpu_steal_pages)(); diff --git a/sys/arch/vax/vax/subr.S b/sys/arch/vax/vax/subr.S index 3538224e487..29c7e6a6f62 100644 --- a/sys/arch/vax/vax/subr.S +++ b/sys/arch/vax/vax/subr.S @@ -1,4 +1,4 @@ -/* $NetBSD: subr.S,v 1.26 2009/04/10 13:40:38 tsutsui Exp $ */ +/* $NetBSD: subr.S,v 1.27 2009/11/26 00:19:23 matt Exp $ */ /* * Copyright (c) 1994 Ludd, University of Lule}, Sweden. @@ -122,19 +122,20 @@ to: movw $0xfff,_C_LABEL(panic) # Save all regs in panic bisl3 $0x80000000,%r9,_C_LABEL(symtab_end) # save end of symtab 3: addl3 _C_LABEL(esym),$0x3ff,%r0 # Round symbol table end - bicl3 $0x3ff,%r0,_C_LABEL(proc0paddr) # save proc0 uarea pointer - bicl3 $0x80000000,_C_LABEL(proc0paddr),%r0 # get phys proc0 uarea addr + bicl3 $0x3ff,%r0,%r1 # + movl %r1,_C_LABEL(lwp0)+L_ADDR # save lwp0 uarea pointer + bicl2 $0x80000000,%r1 # get phys lwp0 uarea addr mtpr %r0,$PR_PCBB # Save in IPR PCBB - addl3 $USPACE,_C_LABEL(proc0paddr),%r0 # Get kernel stack top + addl3 $USPACE,%r1,%r0 # Get kernel stack top mtpr %r0,$PR_KSP # put in IPR KSP movl %r0,_C_LABEL(Sysmap) # SPT start addr after KSP - movl _C_LABEL(proc0paddr),%r0 # get PCB virtual address + movl _C_LABEL(lwp0)+L_ADDR,%r0 # get PCB virtual address mfpr $PR_PCBB,PCB_PADDR(%r0) # save PCB physical address movab IFTRAP(%r0),ESP(%r0) # Save trap address in ESP mtpr 4(%r0),$PR_ESP # Put it in ESP also # Set some registers in known state - movl _C_LABEL(proc0paddr),%r0 + movl %r1,%r0 # get lwp0.l_addr clrl P0LR(%r0) clrl P1LR(%r0) mtpr $0,$PR_P0LR diff --git a/sys/arch/x68k/x68k/kgdb_stub.c b/sys/arch/x68k/x68k/kgdb_stub.c index 4952b5fb6d8..85a1fbd9f7d 100644 --- a/sys/arch/x68k/x68k/kgdb_stub.c +++ b/sys/arch/x68k/x68k/kgdb_stub.c @@ -1,4 +1,4 @@ -/* $NetBSD: kgdb_stub.c,v 1.16 2007/10/17 19:58:04 garbled Exp $ */ +/* $NetBSD: kgdb_stub.c,v 1.17 2009/11/26 00:19:23 matt Exp $ */ /* * Copyright (c) 1990, 1993 @@ -45,13 +45,13 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kgdb_stub.c,v 1.16 2007/10/17 19:58:04 garbled Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kgdb_stub.c,v 1.17 2009/11/26 00:19:23 matt Exp $"); #include "opt_kgdb.h" #ifdef KGDB #ifndef lint -static char rcsid[] = "$NetBSD: kgdb_stub.c,v 1.16 2007/10/17 19:58:04 garbled Exp $"; +static char rcsid[] = "$NetBSD: kgdb_stub.c,v 1.17 2009/11/26 00:19:23 matt Exp $"; #endif #include <sys/param.h> @@ -521,12 +521,12 @@ kgdb_trap(int type, struct frame *frame) int kgdb_acc(void *addr, int len, int rw) { - extern char proc0paddr[], kstack[]; /* XXX */ + extern char kstack[]; /* XXX */ extern char *kernel_map; /* XXX! */ if (kernel_map != NULL) return (kernacc(addr, len, rw)); - if (addr < proc0paddr + USPACE || + if (addr < (char *)lwp0.l_addr + USPACE || kstack <= addr && addr < kstack + USPACE) return (1); return (0); diff --git a/sys/arch/x68k/x68k/locore.s b/sys/arch/x68k/x68k/locore.s index 752886ea16e..2ea1e15cf6d 100644 --- a/sys/arch/x68k/x68k/locore.s +++ b/sys/arch/x68k/x68k/locore.s @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.92 2009/01/18 04:48:53 isaki Exp $ */ +/* $NetBSD: locore.s,v 1.93 2009/11/26 00:19:23 matt Exp $ */ /* * Copyright (c) 1980, 1990, 1993 @@ -942,11 +942,10 @@ Lenab1: jbsr _C_LABEL(fpu_probe) movl %d0,_C_LABEL(fputype) /* set kernel stack, user SP, and initial pcb */ - movl _C_LABEL(proc0paddr),%a1 | get lwp0 pcb addr - lea %a1@(USPACE-4),%sp | set kernel stack to end of area - lea _C_LABEL(lwp0),%a2 | initialize lwp0.l_addr - movl %a2,_C_LABEL(curlwp) | and curlwp so that - movl %a1,%a2@(L_ADDR) | we don't deref NULL in trap() + lea _C_LABEL(lwp0),%a2 | grab lwp0.l_addr, and + movl %a2@(L_ADDR),%a1 | set kernel stack to end of area + lea %a1@(USPACE-4),%sp | and curlwp so that we don't + movl %a2,_C_LABEL(curlwp) | deref NULL in trap() movl #USRSTACK-4,%a2 movl %a2,%usp | init user SP movl %a1,_C_LABEL(curpcb) | lwp0 is running @@ -1268,9 +1267,6 @@ GLOBAL(fputype) GLOBAL(protorp) .long 0,0 | prototype root pointer -GLOBAL(proc0paddr) - .long 0 | KVA of lwp0 u-area - GLOBAL(intiobase) .long 0 | KVA of base of internal IO space diff --git a/sys/arch/x68k/x68k/pmap_bootstrap.c b/sys/arch/x68k/x68k/pmap_bootstrap.c index 6b2847eb5ad..a01d5c00c8f 100644 --- a/sys/arch/x68k/x68k/pmap_bootstrap.c +++ b/sys/arch/x68k/x68k/pmap_bootstrap.c @@ -1,4 +1,4 @@ -/* $NetBSD: pmap_bootstrap.c,v 1.41 2009/01/17 07:17:36 tsutsui Exp $ */ +/* $NetBSD: pmap_bootstrap.c,v 1.42 2009/11/26 00:19:23 matt Exp $ */ /* * Copyright (c) 1991, 1993 @@ -36,7 +36,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.41 2009/01/17 07:17:36 tsutsui Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.42 2009/11/26 00:19:23 matt Exp $"); #include "opt_m680x0.h" @@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.41 2009/01/17 07:17:36 tsutsui #define RELOCPTR(v, t) ((t)((uintptr_t)RELOC((v), t) + firstpa)) extern char *etext; -extern char *proc0paddr; extern int maxmem, physmem; extern paddr_t avail_start, avail_end; @@ -366,7 +365,7 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa) * Remember the u-area address so it can be loaded in the * proc struct p_addr field later. */ - RELOC(proc0paddr, char *) = (char *)(p0upa - firstpa); + RELOC(lwp0.l_addr, struct user *) = (struct user *)(p0upa - firstpa); /* * VM data structures are now initialized, set up data for diff --git a/sys/arch/zaurus/zaurus/machdep.c b/sys/arch/zaurus/zaurus/machdep.c index f84a043bb6a..df5bec1f2b6 100644 --- a/sys/arch/zaurus/zaurus/machdep.c +++ b/sys/arch/zaurus/zaurus/machdep.c @@ -1,4 +1,4 @@ -/* $NetBSD: machdep.c,v 1.17 2009/08/11 17:04:20 matt Exp $ */ +/* $NetBSD: machdep.c,v 1.18 2009/11/26 00:19:23 matt Exp $ */ /* $OpenBSD: zaurus_machdep.c,v 1.25 2006/06/20 18:24:04 todd Exp $ */ /* @@ -107,7 +107,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.17 2009/08/11 17:04:20 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.18 2009/11/26 00:19:23 matt Exp $"); #include "opt_ddb.h" #include "opt_kgdb.h" @@ -243,8 +243,6 @@ extern int pmap_debug_level; pv_addr_t kernel_pt_table[NUM_KERNEL_PTS]; -extern struct user *proc0paddr; - const char *console = "glass"; int glass_console = 0; @@ -994,8 +992,7 @@ initarm(void *arg) * Moved from cpu_startup() as data_abort_handler() references * this during uvm init */ - proc0paddr = (struct user *)kernelstack.pv_va; - lwp0.l_addr = proc0paddr; + lwp0.l_addr = (struct user *)kernelstack.pv_va; #ifdef VERBOSE_INIT_ARM printf("bootstrap done.\n"); diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 9f7d1eb8877..abcff2ab467 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -1,4 +1,4 @@ -/* $NetBSD: kern_proc.c,v 1.157 2009/11/04 15:35:09 pooka Exp $ */ +/* $NetBSD: kern_proc.c,v 1.158 2009/11/26 00:19:11 matt Exp $ */ /*- * Copyright (c) 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc. @@ -62,7 +62,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.157 2009/11/04 15:35:09 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_proc.c,v 1.158 2009/11/26 00:19:11 matt Exp $"); #include "opt_kstack.h" #include "opt_maxuprc.h" @@ -207,8 +207,6 @@ struct lwp lwp0 __aligned(MIN_LWP_ALIGNMENT) = { }; kauth_cred_t cred0; -extern struct user *proc0paddr; - int nofile = NOFILE; int maxuprc = MAXUPRC; int cmask = CMASK; @@ -367,6 +365,7 @@ proc0_init(void) pg = &pgrp0; l = &lwp0; + KASSERT(l->l_addr != NULL); KASSERT(l->l_lid == p->p_nlwpid); mutex_init(&p->p_stmutex, MUTEX_DEFAULT, IPL_HIGH); @@ -439,8 +438,6 @@ proc0_init(void) uvmspace_init(&vmspace0, pmap_kernel(), round_page(VM_MIN_ADDRESS), trunc_page(VM_MAX_ADDRESS)); - l->l_addr = proc0paddr; /* XXX */ - /* Initialize signal state for proc0. XXX IPL_SCHED */ mutex_init(&p->p_sigacts->sa_mutex, MUTEX_DEFAULT, IPL_SCHED); siginit(p); |
