- Use uvm_lwp_setuarea() instead of directly setting address to lwp_t::l_addr.

- Replace most remaining uses of l_addr with uvm_lwp_getuarea() or lwp_getpcb().
- Amend assembly in ports where it accesses PCB via struct user.
- Rename L_ADDR to L_PCB in few places.  Reduce sys/user.h inclusions.
This commit is contained in:
rmind 2009-11-27 03:23:03 +00:00
parent 72ec821622
commit 3f18fe8123
139 changed files with 823 additions and 824 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: genassym.cf,v 1.10 2008/06/23 17:58:17 matt Exp $
# $NetBSD: genassym.cf,v 1.11 2009/11/27 03:23:03 rmind Exp $
#
# Copyright (c) 1999 Ben Harris
# All rights reserved.
@ -46,7 +46,6 @@ endif
define __PROG26 1
define U_PCB offsetof(struct user, u_pcb)
define PCB_SF offsetof(struct pcb, pcb_sf)
define PCB_ONFAULT offsetof(struct pcb, pcb_onfault)
define L_ADDR offsetof(struct lwp, l_addr)

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.S,v 1.20 2009/01/18 15:14:34 bjh21 Exp $ */
/* $NetBSD: locore.S,v 1.21 2009/11/27 03:23:03 rmind Exp $ */
/*
* Copyright (c) 1998, 1999, 2000 Ben Harris
* Copyright (C) 1994-1997 Mark Brinicombe
@ -392,7 +392,7 @@ ENTRY(cpu_loswitch)
beq Lswitch_exited
ldr r3, [r0, #(L_ADDR)]
add r3, r3, #PCB_SF /* r3 = &old->l_addr->u_pcb.pcb_sf */
add r3, r3, #PCB_SF /* r3 = oldpcb->pcb_sf */
mov r2, sp /* Temporary stack pointer */
stmfd r2!, {r4-r11, r13-r14} /* Save all relevant registers */
@ -401,7 +401,7 @@ ENTRY(cpu_loswitch)
Lswitch_exited:
ldr r2, [r1, #(L_ADDR)]
ldr r3, [r2, #(PCB_SF)] /* r3 = new->l_addr->u_pcb.pcb_sf; */
ldr r3, [r2, #(PCB_SF)] /* r3 = newpcb->pcb_sf */
ldmfd r3, {r4-r11, r13-r14} /* Restore from old switchframe */
mov pc, r14 /* and return */
@ -452,4 +452,4 @@ ENTRY(cpu_Debugger)
ldmfd r13!, {pc}
#endif
RCSID("$NetBSD: locore.S,v 1.20 2009/01/18 15:14:34 bjh21 Exp $")
RCSID("$NetBSD: locore.S,v 1.21 2009/11/27 03:23:03 rmind Exp $")

View File

@ -1,4 +1,4 @@
/* $NetBSD: start.c,v 1.16 2009/11/26 00:19:11 matt Exp $ */
/* $NetBSD: start.c,v 1.17 2009/11/27 03:23:03 rmind 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.16 2009/11/26 00:19:11 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: start.c,v 1.17 2009/11/27 03:23:03 rmind Exp $");
#include "opt_modular.h"
@ -92,6 +92,7 @@ void
start(struct bootconfig *initbootconfig)
{
int onstack;
vaddr_t v;
/*
* State of the world as of BBBB 0.02:
@ -185,11 +186,12 @@ start(struct bootconfig *initbootconfig)
fiq_off();
/*
* Locate process 0's user structure, in the bottom of its kernel
* stack page. That's our current stack page too.
* Locate lwp0's uarea, in the bottom of its kernel stack page.
* That is our current stack page too.
*/
lwp0.l_addr = (struct user *)(round_page((vaddr_t)&onstack) - USPACE);
memset(lwp0.l_addr, 0, sizeof(*lwp0.l_addr));
v = round_page((vaddr_t)&onstack) - USPACE;
uvm_lwp_setuarea(&lwp0, v);
memset((void *)v, 0, sizeof(struct pcb));
/* TODO: anything else? */

View File

@ -1,4 +1,4 @@
/* $NetBSD: vm_machdep.c,v 1.24 2009/11/26 00:19:11 matt Exp $ */
/* $NetBSD: vm_machdep.c,v 1.25 2009/11/27 03:23:03 rmind Exp $ */
/*-
* Copyright (c) 2000, 2001 Ben Harris
@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.24 2009/11/26 00:19:11 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.25 2009/11/27 03:23:03 rmind Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@ -95,11 +95,8 @@ __KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.24 2009/11/26 00:19:11 matt Exp $")
*/
/*
* Note:
*
* 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.
* Note: the pcb structure has to be at the start of the uarea -- we start
* the kernel stack from the end.
*/
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: rpc_machdep.c,v 1.78 2009/11/26 00:19:11 matt Exp $ */
/* $NetBSD: rpc_machdep.c,v 1.79 2009/11/27 03:23:03 rmind Exp $ */
/*
* Copyright (c) 2000-2002 Reinoud Zandijk.
@ -55,7 +55,7 @@
#include <sys/param.h>
__KERNEL_RCSID(0, "$NetBSD: rpc_machdep.c,v 1.78 2009/11/26 00:19:11 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: rpc_machdep.c,v 1.79 2009/11/27 03:23:03 rmind Exp $");
#include <sys/systm.h>
#include <sys/kernel.h>
@ -841,7 +841,7 @@ initarm(void *cookie)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
/*
* if there is support for a serial console ...we should now

View File

@ -1,4 +1,4 @@
/* $NetBSD: eb7500atx_machdep.c,v 1.17 2009/11/26 00:19:11 matt Exp $ */
/* $NetBSD: eb7500atx_machdep.c,v 1.18 2009/11/27 03:23:03 rmind Exp $ */
/*
* Copyright (c) 2000-2002 Reinoud Zandijk.
@ -55,7 +55,7 @@
#include <sys/param.h>
__KERNEL_RCSID(0, "$NetBSD: eb7500atx_machdep.c,v 1.17 2009/11/26 00:19:11 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: eb7500atx_machdep.c,v 1.18 2009/11/27 03:23:03 rmind Exp $");
#include <sys/systm.h>
#include <sys/kernel.h>
@ -781,7 +781,7 @@ initarm(void *cookie)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
/*
* if there is support for a serial console ...we should now

View File

@ -1,4 +1,4 @@
/* $NetBSD: amps.c,v 1.16 2009/03/14 21:04:01 dsl Exp $ */
/* $NetBSD: amps.c,v 1.17 2009/11/27 03:23:03 rmind Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: amps.c,v 1.16 2009/03/14 21:04:01 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: amps.c,v 1.17 2009/11/27 03:23:03 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -45,7 +45,6 @@ __KERNEL_RCSID(0, "$NetBSD: amps.c,v 1.16 2009/03/14 21:04:01 dsl Exp $");
#include <sys/select.h>
#include <sys/tty.h>
#include <sys/proc.h>
#include <sys/user.h>
#include <sys/conf.h>
#include <sys/file.h>
#include <sys/uio.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.42 2009/11/26 00:19:11 matt Exp $ */
/* $NetBSD: machdep.c,v 1.43 2009/11/27 03:23:03 rmind Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -106,7 +106,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.42 2009/11/26 00:19:11 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.43 2009/11/27 03:23:03 rmind Exp $");
#include "opt_algor_p4032.h"
#include "opt_algor_p5064.h"
@ -123,8 +123,7 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.42 2009/11/26 00:19:11 matt Exp $");
#include <sys/kernel.h>
#include <sys/buf.h>
#include <sys/reboot.h>
#include <sys/user.h>
#include <sys/mount.h>
#include <sys/mount.h>
#include <sys/kcore.h>
#include <sys/boot_flag.h>
#include <sys/termios.h>
@ -210,9 +209,10 @@ mach_init(int argc, char *argv[], char *envp[])
vaddr_t kernstart, kernend;
paddr_t kernstartpfn, kernendpfn, pfn0, pfn1;
vsize_t size;
struct pcb *pcb0;
vaddr_t v;
const char *cp;
char *cp0;
void *v;
int i;
/* Disable interrupts. */
@ -560,14 +560,17 @@ mach_init(int argc, char *argv[], char *envp[])
pmap_bootstrap();
/*
* Init mapping for u page(s) for lwp0.
* Allocate uarea page for lwp0 and set it.
*/
led_display('u', 's', 'p', 'c');
v = (void *) uvm_pageboot_alloc(USPACE);
lwp0.l_addr = (struct user *) v;
lwp0.l_md.md_regs = (struct frame *)((char*)v + USPACE) - 1;
lwp0.l_addr->u_pcb.pcb_context[11] =
MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
v = uvm_pageboot_alloc(USPACE);
uvm_lwp_setuarea(&lwp0, v);
pcb0 = lwp_getpcb(&lwp0);
pcb0->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
lwp0.l_md.md_regs = (struct frame *)(v + USPACE) - 1;
/*
* Initialize debuggers, and break into them, if appropriate.
@ -656,7 +659,7 @@ cpu_startup(void)
}
int waittime = -1;
struct user dumppcb; /* Actually, struct pcb would do. */
struct pcb dumppcb;
void
cpu_reboot(int howto, char *bootstr)
@ -665,7 +668,7 @@ cpu_reboot(int howto, char *bootstr)
/* Take a snapshot before clobbering any registers. */
if (curlwp)
savectx((struct user *) curpcb);
savectx(curpcb);
/* If "always halt" was specified as a boot flag, obey. */
if (boothowto & RB_HALT)

View File

@ -1,4 +1,4 @@
/* $NetBSD: com_mainbus.c,v 1.11 2008/04/28 20:23:10 martin Exp $ */
/* $NetBSD: com_mainbus.c,v 1.12 2009/11/27 03:23:03 rmind Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -33,7 +33,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: com_mainbus.c,v 1.11 2008/04/28 20:23:10 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: com_mainbus.c,v 1.12 2009/11/27 03:23:03 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -41,7 +41,6 @@ __KERNEL_RCSID(0, "$NetBSD: com_mainbus.c,v 1.11 2008/04/28 20:23:10 martin Exp
#include <sys/select.h>
#include <sys/tty.h>
#include <sys/proc.h>
#include <sys/user.h>
#include <sys/conf.h>
#include <sys/file.h>
#include <sys/uio.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: lpt_mainbus.c,v 1.9 2008/04/28 20:23:10 martin Exp $ */
/* $NetBSD: lpt_mainbus.c,v 1.10 2009/11/27 03:23:04 rmind Exp $ */
/*-
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -31,7 +31,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
__KERNEL_RCSID(0, "$NetBSD: lpt_mainbus.c,v 1.9 2008/04/28 20:23:10 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: lpt_mainbus.c,v 1.10 2009/11/27 03:23:04 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -39,7 +39,6 @@ __KERNEL_RCSID(0, "$NetBSD: lpt_mainbus.c,v 1.9 2008/04/28 20:23:10 martin Exp $
#include <sys/select.h>
#include <sys/tty.h>
#include <sys/proc.h>
#include <sys/user.h>
#include <sys/conf.h>
#include <sys/file.h>
#include <sys/uio.h>

View File

@ -1,4 +1,4 @@
# $NetBSD: genassym.cf,v 1.16 2008/09/20 18:29:04 tsutsui Exp $
# $NetBSD: genassym.cf,v 1.17 2009/11/27 03:23:04 rmind Exp $
#
# Copyright (c) 1982, 1990, 1993
@ -160,12 +160,10 @@ define VM_MAP_PMAP offsetof(struct vmspace, vm_map.pmap)
# Important offsets into the user struct & associated constants
define UPAGES UPAGES
define U_PCB offsetof(struct user, u_pcb)
define U_PCB_HWPCB offsetof(struct user, u_pcb.pcb_hw)
define U_PCB_HWPCB_KSP offsetof(struct user, u_pcb.pcb_hw.apcb_ksp)
define U_PCB_CONTEXT offsetof(struct user, u_pcb.pcb_context[0])
define U_PCB_ONFAULT offsetof(struct user, u_pcb.pcb_onfault)
define U_PCB_ACCESSADDR offsetof(struct user, u_pcb.pcb_accessaddr)
define PCB_HWPCB_KSP offsetof(struct pcb, pcb_hw.apcb_ksp)
define PCB_CONTEXT offsetof(struct pcb, pcb_context[0])
define PCB_ONFAULT offsetof(struct pcb, pcb_onfault)
define PCB_ACCESSADDR offsetof(struct pcb, pcb_accessaddr)
# Offsets into struct fpstate, for save, restore
define FPREG_FPR_REGS offsetof(struct fpreg, fpr_regs[0])

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.116 2009/11/05 04:19:47 thorpej Exp $ */
/* $NetBSD: locore.s,v 1.117 2009/11/27 03:23:04 rmind Exp $ */
/*-
* Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@ -67,7 +67,7 @@
#include <machine/asm.h>
__KERNEL_RCSID(0, "$NetBSD: locore.s,v 1.116 2009/11/05 04:19:47 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: locore.s,v 1.117 2009/11/27 03:23:04 rmind Exp $");
#include "assym.h"
@ -625,7 +625,7 @@ LEAF(restorefpstate, 1)
* if called from boot().)
*
* Arguments:
* a0 'struct user *' of the process that needs its context saved
* a0 'struct pcb *' of the process that needs its context saved
*
* Return:
* v0 0. (note that for child processes, it seems
@ -636,17 +636,17 @@ LEAF(restorefpstate, 1)
LEAF(savectx, 1)
br pv, 1f
1: LDGP(pv)
stq sp, U_PCB_HWPCB_KSP(a0) /* store sp */
stq s0, U_PCB_CONTEXT+(0 * 8)(a0) /* store s0 - s6 */
stq s1, U_PCB_CONTEXT+(1 * 8)(a0)
stq s2, U_PCB_CONTEXT+(2 * 8)(a0)
stq s3, U_PCB_CONTEXT+(3 * 8)(a0)
stq s4, U_PCB_CONTEXT+(4 * 8)(a0)
stq s5, U_PCB_CONTEXT+(5 * 8)(a0)
stq s6, U_PCB_CONTEXT+(6 * 8)(a0)
stq ra, U_PCB_CONTEXT+(7 * 8)(a0) /* store ra */
stq sp, PCB_HWPCB_KSP(a0) /* store sp */
stq s0, PCB_CONTEXT+(0 * 8)(a0) /* store s0 - s6 */
stq s1, PCB_CONTEXT+(1 * 8)(a0)
stq s2, PCB_CONTEXT+(2 * 8)(a0)
stq s3, PCB_CONTEXT+(3 * 8)(a0)
stq s4, PCB_CONTEXT+(4 * 8)(a0)
stq s5, PCB_CONTEXT+(5 * 8)(a0)
stq s6, PCB_CONTEXT+(6 * 8)(a0)
stq ra, PCB_CONTEXT+(7 * 8)(a0) /* store ra */
call_pal PAL_OSF1_rdps /* NOTE: doesn't kill a0 */
stq v0, U_PCB_CONTEXT+(8 * 8)(a0) /* store ps, for ipl */
stq v0, PCB_CONTEXT+(8 * 8)(a0) /* store ps, for ipl */
mov zero, v0
RET
@ -672,14 +672,14 @@ LEAF(cpu_switchto, 0)
*/
ldq a2, L_ADDR(a0)
/* NOTE: ksp is stored by the swpctx */
stq s0, U_PCB_CONTEXT+(0 * 8)(a2) /* store s0 - s6 */
stq s1, U_PCB_CONTEXT+(1 * 8)(a2)
stq s2, U_PCB_CONTEXT+(2 * 8)(a2)
stq s3, U_PCB_CONTEXT+(3 * 8)(a2)
stq s4, U_PCB_CONTEXT+(4 * 8)(a2)
stq s5, U_PCB_CONTEXT+(5 * 8)(a2)
stq s6, U_PCB_CONTEXT+(6 * 8)(a2)
stq ra, U_PCB_CONTEXT+(7 * 8)(a2) /* store ra */
stq s0, PCB_CONTEXT+(0 * 8)(a2) /* store s0 - s6 */
stq s1, PCB_CONTEXT+(1 * 8)(a2)
stq s2, PCB_CONTEXT+(2 * 8)(a2)
stq s3, PCB_CONTEXT+(3 * 8)(a2)
stq s4, PCB_CONTEXT+(4 * 8)(a2)
stq s5, PCB_CONTEXT+(5 * 8)(a2)
stq s6, PCB_CONTEXT+(6 * 8)(a2)
stq ra, PCB_CONTEXT+(7 * 8)(a2) /* store ra */
1:
mov a0, s4 /* save old curlwp */
@ -715,14 +715,14 @@ LEAF(cpu_switchto, 0)
* Restore registers and return.
* NOTE: ksp is restored by the swpctx.
*/
ldq s1, U_PCB_CONTEXT+(1 * 8)(s0) /* restore s1-s6 */
ldq s2, U_PCB_CONTEXT+(2 * 8)(s0)
ldq s3, U_PCB_CONTEXT+(3 * 8)(s0)
ldq s4, U_PCB_CONTEXT+(4 * 8)(s0)
ldq s5, U_PCB_CONTEXT+(5 * 8)(s0)
ldq s6, U_PCB_CONTEXT+(6 * 8)(s0)
ldq ra, U_PCB_CONTEXT+(7 * 8)(s0) /* restore ra */
ldq s0, U_PCB_CONTEXT+(0 * 8)(s0) /* restore s0 */
ldq s1, PCB_CONTEXT+(1 * 8)(s0) /* restore s1-s6 */
ldq s2, PCB_CONTEXT+(2 * 8)(s0)
ldq s3, PCB_CONTEXT+(3 * 8)(s0)
ldq s4, PCB_CONTEXT+(4 * 8)(s0)
ldq s5, PCB_CONTEXT+(5 * 8)(s0)
ldq s6, PCB_CONTEXT+(6 * 8)(s0)
ldq ra, PCB_CONTEXT+(7 * 8)(s0) /* restore ra */
ldq s0, PCB_CONTEXT+(0 * 8)(s0) /* restore s0 */
RET
END(cpu_switchto)
@ -813,13 +813,13 @@ NESTED(copyinstr, 4, 16, ra, IM_RA|IM_S0, 0)
.set noat
ldq at_reg, 0(s0)
ldq at_reg, L_ADDR(at_reg)
stq v0, U_PCB_ONFAULT(at_reg)
stq v0, PCB_ONFAULT(at_reg)
.set at
CALL(copystr) /* do the copy. */
.set noat
ldq at_reg, 0(s0) /* kill the fault handler. */
ldq at_reg, L_ADDR(at_reg)
stq zero, U_PCB_ONFAULT(at_reg)
stq zero, PCB_ONFAULT(at_reg)
.set at
ldq ra, (16-8)(sp) /* restore ra. */
ldq s0, (16-16)(sp) /* restore s0. */
@ -842,13 +842,13 @@ NESTED(copyoutstr, 4, 16, ra, IM_RA|IM_S0, 0)
.set noat
ldq at_reg, 0(s0)
ldq at_reg, L_ADDR(at_reg)
stq v0, U_PCB_ONFAULT(at_reg)
stq v0, PCB_ONFAULT(at_reg)
.set at
CALL(copystr) /* do the copy. */
.set noat
ldq at_reg, 0(s0) /* kill the fault handler. */
ldq at_reg, L_ADDR(at_reg)
stq zero, U_PCB_ONFAULT(at_reg)
stq zero, PCB_ONFAULT(at_reg)
.set at
ldq ra, (16-8)(sp) /* restore ra. */
ldq s0, (16-16)(sp) /* restore s0. */
@ -882,13 +882,13 @@ NESTED(kcopy, 3, 32, ra, IM_RA|IM_S0|IM_S1, 0)
lda v0, kcopyerr /* set up fault handler. */
.set noat
ldq at_reg, L_ADDR(s1)
ldq s0, U_PCB_ONFAULT(at_reg) /* save old handler. */
stq v0, U_PCB_ONFAULT(at_reg)
ldq s0, PCB_ONFAULT(at_reg) /* save old handler. */
stq v0, PCB_ONFAULT(at_reg)
.set at
CALL(memcpy) /* do the copy. */
.set noat
ldq at_reg, L_ADDR(s1) /* restore the old handler. */
stq s0, U_PCB_ONFAULT(at_reg)
stq s0, PCB_ONFAULT(at_reg)
.set at
ldq ra, (32-8)(sp) /* restore ra. */
ldq s0, (32-16)(sp) /* restore s0. */
@ -902,7 +902,7 @@ LEAF(kcopyerr, 0)
LDGP(pv)
.set noat
ldq at_reg, L_ADDR(s1) /* restore the old handler. */
stq s0, U_PCB_ONFAULT(at_reg)
stq s0, PCB_ONFAULT(at_reg)
.set at
ldq ra, (32-8)(sp) /* restore ra. */
ldq s0, (32-16)(sp) /* restore s0. */
@ -929,12 +929,12 @@ NESTED(copyin, 3, 16, ra, IM_RA|IM_S0, 0)
lda v0, copyerr /* set up fault handler. */
.set noat
ldq at_reg, L_ADDR(s0)
stq v0, U_PCB_ONFAULT(at_reg)
stq v0, PCB_ONFAULT(at_reg)
.set at
CALL(memcpy) /* do the copy. */
.set noat
ldq at_reg, L_ADDR(s0) /* kill the fault handler. */
stq zero, U_PCB_ONFAULT(at_reg)
stq zero, PCB_ONFAULT(at_reg)
.set at
ldq ra, (16-8)(sp) /* restore ra. */
ldq s0, (16-16)(sp) /* restore s0. */
@ -961,12 +961,12 @@ NESTED(copyout, 3, 16, ra, IM_RA|IM_S0, 0)
lda v0, copyerr /* set up fault handler. */
.set noat
ldq at_reg, L_ADDR(s0)
stq v0, U_PCB_ONFAULT(at_reg)
stq v0, PCB_ONFAULT(at_reg)
.set at
CALL(memcpy) /* do the copy. */
.set noat
ldq at_reg, L_ADDR(s0) /* kill the fault handler. */
stq zero, U_PCB_ONFAULT(at_reg)
stq zero, PCB_ONFAULT(at_reg)
.set at
ldq ra, (16-8)(sp) /* restore ra. */
ldq s0, (16-16)(sp) /* restore s0. */
@ -1005,13 +1005,13 @@ XLEAF(fuiword, 1)
lda t0, fswberr
.set noat
ldq at_reg, L_ADDR(t1)
stq t0, U_PCB_ONFAULT(at_reg)
stq t0, PCB_ONFAULT(at_reg)
.set at
ldq v0, 0(a0)
zap v0, 0xf0, v0
.set noat
ldq at_reg, L_ADDR(t1)
stq zero, U_PCB_ONFAULT(at_reg)
stq zero, PCB_ONFAULT(at_reg)
.set at
RET
END(fuword)
@ -1028,12 +1028,12 @@ XLEAF(fuisword, 1)
lda t0, fswberr
.set noat
ldq at_reg, L_ADDR(t1)
stq t0, U_PCB_ONFAULT(at_reg)
stq t0, PCB_ONFAULT(at_reg)
.set at
/* XXX FETCH IT */
.set noat
ldq at_reg, L_ADDR(t1)
stq zero, U_PCB_ONFAULT(at_reg)
stq zero, PCB_ONFAULT(at_reg)
.set at
RET
END(fusword)
@ -1050,12 +1050,12 @@ XLEAF(fuibyte, 1)
lda t0, fswberr
.set noat
ldq at_reg, L_ADDR(t1)
stq t0, U_PCB_ONFAULT(at_reg)
stq t0, PCB_ONFAULT(at_reg)
.set at
/* XXX FETCH IT */
.set noat
ldq at_reg, L_ADDR(t1)
stq zero, U_PCB_ONFAULT(at_reg)
stq zero, PCB_ONFAULT(at_reg)
.set at
RET
END(fubyte)
@ -1071,12 +1071,12 @@ LEAF(suword, 2)
lda t0, fswberr
.set noat
ldq at_reg, L_ADDR(t1)
stq t0, U_PCB_ONFAULT(at_reg)
stq t0, PCB_ONFAULT(at_reg)
.set at
stq a1, 0(a0) /* do the store. */
.set noat
ldq at_reg, L_ADDR(t1)
stq zero, U_PCB_ONFAULT(at_reg)
stq zero, PCB_ONFAULT(at_reg)
.set at
mov zero, v0
RET
@ -1094,12 +1094,12 @@ LEAF(suiword, 2)
lda t0, fswberr
.set noat
ldq at_reg, L_ADDR(t1)
stq t0, U_PCB_ONFAULT(at_reg)
stq t0, PCB_ONFAULT(at_reg)
.set at
/* XXX STORE IT */
.set noat
ldq at_reg, L_ADDR(t1)
stq zero, U_PCB_ONFAULT(at_reg)
stq zero, PCB_ONFAULT(at_reg)
.set at
call_pal PAL_OSF1_imb /* sync instruction stream */
mov zero, v0
@ -1117,12 +1117,12 @@ LEAF(susword, 2)
lda t0, fswberr
.set noat
ldq at_reg, L_ADDR(t1)
stq t0, U_PCB_ONFAULT(at_reg)
stq t0, PCB_ONFAULT(at_reg)
.set at
/* XXX STORE IT */
.set noat
ldq at_reg, L_ADDR(t1)
stq zero, U_PCB_ONFAULT(at_reg)
stq zero, PCB_ONFAULT(at_reg)
.set at
mov zero, v0
RET
@ -1139,12 +1139,12 @@ LEAF(suisword, 2)
lda t0, fswberr
.set noat
ldq at_reg, L_ADDR(t1)
stq t0, U_PCB_ONFAULT(at_reg)
stq t0, PCB_ONFAULT(at_reg)
.set at
/* XXX STORE IT */
.set noat
ldq at_reg, L_ADDR(t1)
stq zero, U_PCB_ONFAULT(at_reg)
stq zero, PCB_ONFAULT(at_reg)
.set at
call_pal PAL_OSF1_imb /* sync instruction stream */
mov zero, v0
@ -1163,7 +1163,7 @@ LEAF(subyte, 2)
lda t0, fswberr
.set noat
ldq at_reg, L_ADDR(t1)
stq t0, U_PCB_ONFAULT(at_reg)
stq t0, PCB_ONFAULT(at_reg)
.set at
zap a1, 0xfe, a1 /* kill arg's high bytes */
insbl a1, a0, a1 /* move it to the right byte */
@ -1173,7 +1173,7 @@ LEAF(subyte, 2)
stq_u a1, 0(a0) /* and store it. */
.set noat
ldq at_reg, L_ADDR(t1)
stq zero, U_PCB_ONFAULT(at_reg)
stq zero, PCB_ONFAULT(at_reg)
.set at
mov zero, v0
RET
@ -1190,7 +1190,7 @@ LEAF(suibyte, 2)
lda t0, fswberr
.set noat
ldq at_reg, L_ADDR(t1)
stq t0, U_PCB_ONFAULT(at_reg)
stq t0, PCB_ONFAULT(at_reg)
.set at
zap a1, 0xfe, a1 /* kill arg's high bytes */
insbl a1, a0, a1 /* move it to the right byte */
@ -1200,7 +1200,7 @@ LEAF(suibyte, 2)
stq_u a1, 0(a0) /* and store it. */
.set noat
ldq at_reg, L_ADDR(t1)
stq zero, U_PCB_ONFAULT(at_reg)
stq zero, PCB_ONFAULT(at_reg)
.set at
call_pal PAL_OSF1_imb /* sync instruction stream */
mov zero, v0
@ -1233,13 +1233,13 @@ LEAF(fuswintr, 2)
lda t0, fswintrberr
.set noat
ldq at_reg, L_ADDR(t1)
stq t0, U_PCB_ONFAULT(at_reg)
stq a0, U_PCB_ACCESSADDR(at_reg)
stq t0, PCB_ONFAULT(at_reg)
stq a0, PCB_ACCESSADDR(at_reg)
.set at
/* XXX FETCH IT */
.set noat
ldq at_reg, L_ADDR(t1)
stq zero, U_PCB_ONFAULT(at_reg)
stq zero, PCB_ONFAULT(at_reg)
.set at
RET
END(fuswintr)
@ -1255,13 +1255,13 @@ LEAF(suswintr, 2)
lda t0, fswintrberr
.set noat
ldq at_reg, L_ADDR(t1)
stq t0, U_PCB_ONFAULT(at_reg)
stq a0, U_PCB_ACCESSADDR(at_reg)
stq t0, PCB_ONFAULT(at_reg)
stq a0, PCB_ACCESSADDR(at_reg)
.set at
/* XXX STORE IT */
.set noat
ldq at_reg, L_ADDR(t1)
stq zero, U_PCB_ONFAULT(at_reg)
stq zero, PCB_ONFAULT(at_reg)
.set at
mov zero, v0
RET

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.323 2009/11/26 00:19:11 matt Exp $ */
/* $NetBSD: machdep.c,v 1.324 2009/11/27 03:23:04 rmind 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.323 2009/11/26 00:19:11 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.324 2009/11/27 03:23:04 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -87,7 +87,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.323 2009/11/26 00:19:11 matt Exp $");
#include <sys/msgbuf.h>
#include <sys/ioctl.h>
#include <sys/tty.h>
#include <sys/user.h>
#include <sys/exec.h>
#include <sys/exec_aout.h> /* for MID_* */
#include <sys/exec_ecoff.h>
@ -220,7 +219,8 @@ alpha_init(u_long pfn, u_long ptb, u_long bim, u_long bip, u_long biv)
struct mddt_cluster *memc;
int i, mddtweird;
struct vm_physseg *vps;
vaddr_t kernstart, kernend;
struct pcb *pcb0;
vaddr_t kernstart, kernend, v;
paddr_t kernstartpfn, kernendpfn, pfn0, pfn1;
cpuid_t cpu_id;
struct cpu_info *ci;
@ -634,9 +634,10 @@ nobootinfo:
*/
/*
* Init mapping for u page(s) for proc 0
* Allocate uarea page for lwp0 and set it.
*/
lwp0.l_addr = (struct user *)uvm_pageboot_alloc(UPAGES * PAGE_SIZE);
v = uvm_pageboot_alloc(UPAGES * PAGE_SIZE);
uvm_lwp_setuarea(&lwp0, v);
/*
* Initialize the virtual memory system, and set the
@ -646,21 +647,18 @@ nobootinfo:
hwrpb->rpb_max_asn, hwrpb->rpb_pcs_cnt);
/*
* Initialize the rest of proc 0's PCB, and cache its physical
* address.
* Initialize the rest of lwp0's PCB and cache its physical address.
*/
lwp0.l_md.md_pcbpaddr =
(struct pcb *)ALPHA_K0SEG_TO_PHYS((vaddr_t)&lwp0.l_addr->u_pcb);
pcb0 = lwp_getpcb(&lwp0);
lwp0.l_md.md_pcbpaddr = (void *)ALPHA_K0SEG_TO_PHYS((vaddr_t)pcb0);
/*
* Set the kernel sp, reserving space for an (empty) trapframe,
* and make lwp0's trapframe pointer point to it for sanity.
*/
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 *)lwp0.l_addr->u_pcb.pcb_hw.apcb_ksp;
simple_lock_init(&lwp0.l_addr->u_pcb.pcb_fpcpu_slock);
pcb0->pcb_hw.apcb_ksp = v + USPACE - sizeof(struct trapframe);
lwp0.l_md.md_tf = (struct trapframe *)pcb0->pcb_hw.apcb_ksp;
simple_lock_init(&pcb0->pcb_fpcpu_slock);
/* Indicate that lwp0 has a CPU. */
lwp0.l_cpu = ci;

View File

@ -1,4 +1,4 @@
/* $NetBSD: copy.S,v 1.15 2009/11/13 22:49:46 dsl Exp $ */
/* $NetBSD: copy.S,v 1.16 2009/11/27 03:23:04 rmind Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@ -45,7 +45,7 @@
#define GET_CURPCB(reg) \
movq CPUVAR(CURLWP), reg; \
movq L_ADDR(reg), reg
movq L_PCB(reg), reg
/*
* These are arranged so that the abnormal case is a forwards

View File

@ -1,4 +1,4 @@
# $NetBSD: genassym.cf,v 1.42 2009/11/25 14:28:50 rmind Exp $
# $NetBSD: genassym.cf,v 1.43 2009/11/27 03:23:04 rmind Exp $
#
# Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@ -147,7 +147,7 @@ define PDIR_SLOT_PTE PDIR_SLOT_PTE
define VM_MAXUSER_ADDRESS (unsigned long long)VM_MAXUSER_ADDRESS
define L_ADDR offsetof(struct lwp, l_addr)
define L_PCB offsetof(struct lwp, l_addr)
define L_FLAG offsetof(struct lwp, l_flag)
define L_PROC offsetof(struct lwp, l_proc)
define L_CTXSWTCH offsetof(struct lwp, l_ctxswtch)

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.S,v 1.54 2009/11/26 00:19:12 matt Exp $ */
/* $NetBSD: locore.S,v 1.55 2009/11/27 03:23:04 rmind Exp $ */
/*
* Copyright-o-rama!
@ -695,7 +695,7 @@ longmode_hi:
/* Set up bootstrap stack. */
leaq (PROC0_STK_OFF)(%rsi),%rax
addq %r8,%rax
movq %rax,(_C_LABEL(lwp0)+L_ADDR)(%rip)
movq %rax,(_C_LABEL(lwp0)+L_PCB)(%rip) /* XXX L_PCB != uarea */
leaq (USPACE-FRAMESIZE)(%rax),%rsp
movq %rsi,PCB_CR3(%rax) # pcb->pcb_cr3
xorq %rbp,%rbp # mark end of frames
@ -775,7 +775,7 @@ start:
* First avail returned by xen_pmap_bootstrap in %rax
*/
movq %rax, %rsi
movq %rsi,(_C_LABEL(lwp0)+L_ADDR)
movq %rsi,(_C_LABEL(lwp0)+L_PCB) /* XXX L_PCB != uarea */
xorq %rax,%rax
movq %rsi,%rdi
@ -902,12 +902,12 @@ ENTRY(cpu_switchto)
jz 1f
/* Save old context. */
movq L_ADDR(%r13),%rax
movq L_PCB(%r13),%rax
movq %rsp,PCB_RSP(%rax)
movq %rbp,PCB_RBP(%rax)
/* Switch to newlwp's stack. */
1: movq L_ADDR(%r12),%r14
1: movq L_PCB(%r12),%r14
#ifdef XEN /* XXX debug code */
cmpq $0, PCB_RSP(%r14)
jne 999f
@ -1014,7 +1014,7 @@ IDTVEC(syscall)
swapgs
movq %r15,CPUVAR(SCRATCH)
movq CPUVAR(CURLWP),%r15
movq L_ADDR(%r15),%r15
movq L_PCB(%r15),%r15
movq PCB_RSP0(%r15),%r15
xchgq %r15,%rsp

View File

@ -1,4 +1,4 @@
/* $NetBSD: mptramp.S,v 1.9 2008/05/13 22:39:17 ad Exp $ */
/* $NetBSD: mptramp.S,v 1.10 2009/11/27 03:23:04 rmind Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -233,7 +233,7 @@ _C_LABEL(cpu_spinup_trampoline_end): #end of code copied to MP_TRAMPOLINE
1:
movq CPU_INFO_IDLELWP(%rdi),%rsi
movq L_ADDR(%rsi),%rsi
movq L_PCB(%rsi),%rsi
movq PCB_RSP(%rsi),%rsp
movq PCB_RBP(%rsi),%rbp

View File

@ -1,4 +1,4 @@
/* $NetBSD: spl.S,v 1.22 2009/11/25 14:28:50 rmind Exp $ */
/* $NetBSD: spl.S,v 1.23 2009/11/27 03:23:04 rmind Exp $ */
/*
* Copyright (c) 2003 Wasabi Systems, Inc.
@ -99,8 +99,8 @@ IDTVEC(softintr)
movl $IPL_HIGH,CPUVAR(ILEVEL)
movq CPUVAR(CURLWP),%r15
movq IS_LWP(%rax),%rdi /* switch to handler LWP */
movq L_ADDR(%rdi),%rdx
movq L_ADDR(%r15),%rcx
movq L_PCB(%rdi),%rdx
movq L_PCB(%r15),%rcx
movq %rdi,CPUVAR(CURLWP)
movq %rsp,PCB_RSP(%rcx)
movq %rbp,PCB_RBP(%rcx)
@ -110,7 +110,7 @@ IDTVEC(softintr)
movl IS_MAXLEVEL(%rax),%esi /* ipl to run at */
call _C_LABEL(softint_dispatch)/* run handlers */
cli
movq L_ADDR(%r15),%rcx
movq L_PCB(%r15),%rcx
movq PCB_RSP(%rcx),%rsp
xchgq %r15,CPUVAR(CURLWP) /* must be globally visible */
popq %r15 /* unwind switchframe */

View File

@ -1,4 +1,4 @@
/* $NetBSD: arcbios.c,v 1.16 2005/12/24 23:23:59 perry Exp $ */
/* $NetBSD: arcbios.c,v 1.17 2009/11/27 03:23:04 rmind Exp $ */
/* $OpenBSD: arcbios.c,v 1.3 1998/06/06 06:33:33 mickey Exp $ */
/*-
@ -31,12 +31,11 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: arcbios.c,v 1.16 2005/12/24 23:23:59 perry Exp $");
__KERNEL_RCSID(0, "$NetBSD: arcbios.c,v 1.17 2009/11/27 03:23:04 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/user.h>
#include <sys/kcore.h>
#include <uvm/uvm_extern.h>
#include <dev/cons.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.c,v 1.16 2008/07/05 08:46:25 tsutsui Exp $ */
/* $NetBSD: cpu.c,v 1.17 2009/11/27 03:23:04 rmind Exp $ */
/* $OpenBSD: cpu.c,v 1.8 1997/04/19 17:19:41 pefo Exp $ */
/*
@ -34,12 +34,11 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.16 2008/07/05 08:46:25 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.17 2009/11/27 03:23:04 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/user.h>
#include <sys/device.h>
#include <uvm/uvm_extern.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore_machdep.S,v 1.15 2005/12/11 12:16:37 christos Exp $ */
/* $NetBSD: locore_machdep.S,v 1.16 2009/11/27 03:23:04 rmind Exp $ */
/* $OpenBSD: locore.S,v 1.12 1997/04/19 17:19:43 pefo Exp $ */
/*
@ -211,7 +211,7 @@ L* }
*/
LEAF(mdbpeek)
li v0, MDBERR
sw v0, UADDR+U_PCB_ONFAULT
sw v0, UADDR+PCB_ONFAULT
and v0, a0, 3 # unaligned address?
bne v0, zero, 1f
nop
@ -222,7 +222,7 @@ LEAF(mdbpeek)
LWLO v0, 3(a0)
2:
j ra # made it w/o errors
sw zero, UADDR+U_PCB_ONFAULT
sw zero, UADDR+PCB_ONFAULT
mdberr:
li v0, 1 # trap sends us here
sw v0, mdbmkfault
@ -244,7 +244,7 @@ L* }
*/
LEAF(mdbpoke)
li v0, MDBERR
sw v0, UADDR+U_PCB_ONFAULT
sw v0, UADDR+PCB_ONFAULT
and v0, a0, 3 # unaligned address?
bne v0, zero, 1f
nop
@ -255,7 +255,7 @@ LEAF(mdbpoke)
SWLO a1, 3(a0)
and a0, a0, ~3 # align address for cache flush
2:
sw zero, UADDR+U_PCB_ONFAULT
sw zero, UADDR+PCB_ONFAULT
b R4K_FlushICache # flush instruction cache
li a1, 8
END(mdbpoke)

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.117 2009/11/26 00:19:12 matt Exp $ */
/* $NetBSD: machdep.c,v 1.118 2009/11/27 03:23:04 rmind 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.117 2009/11/26 00:19:12 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.118 2009/11/27 03:23:04 rmind Exp $");
#include "fs_mfs.h"
#include "opt_ddb.h"
@ -101,7 +101,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.117 2009/11/26 00:19:12 matt Exp $");
#include <sys/ioctl.h>
#include <sys/time.h>
#include <sys/tty.h>
#include <sys/user.h>
#include <sys/exec.h>
#include <uvm/uvm_extern.h>
#include <sys/mount.h>
@ -232,6 +231,7 @@ mach_init(int argc, char *argv[], u_int bim, void *bip)
int i;
paddr_t kernstartpfn, kernendpfn, first, last;
char *kernend;
struct pcb *pcb0;
vaddr_t v;
#if NKSYMS > 0 || defined(DDB) || defined(MODULAR)
char *ssym = NULL;
@ -489,13 +489,15 @@ mach_init(int argc, char *argv[], u_int bim, void *bip)
pmap_bootstrap();
/*
* Allocate space for lwp0's USPACE.
* Allocate uarea page for lwp0 and set it.
*/
v = uvm_pageboot_alloc(USPACE);
lwp0.l_addr = (struct user *)v;
uvm_lwp_setuarea(&lwp0, v);
pcb0 = lwp_getpcb(&lwp0);
pcb0->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
lwp0.l_md.md_regs = (struct frame *)(v + USPACE) - 1;
lwp0.l_addr->u_pcb.pcb_context[11] =
MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
}
void
@ -625,7 +627,7 @@ cpu_reboot(int howto, char *bootstr)
/* take a snap shot before clobbering any registers */
if (curlwp)
savectx((struct user *)curpcb);
savectx(curpcb);
#ifdef DEBUG
if (panicstr)

View File

@ -1,4 +1,4 @@
/* $NetBSD: minidebug.c,v 1.19 2009/03/14 21:04:04 dsl Exp $ */
/* $NetBSD: minidebug.c,v 1.20 2009/11/27 03:23:04 rmind Exp $ */
/* $OpenBSD: minidebug.c,v 1.2 1998/03/16 09:03:36 pefo Exp $ */
/*-
@ -40,12 +40,11 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: minidebug.c,v 1.19 2009/03/14 21:04:04 dsl Exp $");
__KERNEL_RCSID(0, "$NetBSD: minidebug.c,v 1.20 2009/11/27 03:23:04 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/user.h>
#include <dev/cons.h>
#include <uvm/uvm_extern.h>
#undef SP

View File

@ -1,4 +1,4 @@
/* $NetBSD: btl.c,v 1.22 2009/10/26 19:16:54 cegger Exp $ */
/* $NetBSD: btl.c,v 1.23 2009/11/27 03:23:04 rmind Exp $ */
/* NetBSD: bt.c,v 1.10 1996/05/12 23:51:54 mycroft Exp */
#undef BTDIAG
@ -51,7 +51,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: btl.c,v 1.22 2009/10/26 19:16:54 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: btl.c,v 1.23 2009/11/27 03:23:04 rmind Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -63,7 +63,6 @@ __KERNEL_RCSID(0, "$NetBSD: btl.c,v 1.22 2009/10/26 19:16:54 cegger Exp $");
#include <sys/device.h>
#include <sys/buf.h>
#include <sys/proc.h>
#include <sys/user.h>
#include <machine/intr.h>
#include <machine/pio.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: isabus.c,v 1.45 2009/08/19 15:16:09 dyoung Exp $ */
/* $NetBSD: isabus.c,v 1.46 2009/11/27 03:23:04 rmind Exp $ */
/* $OpenBSD: isabus.c,v 1.15 1998/03/16 09:38:46 pefo Exp $ */
/* NetBSD: isa.c,v 1.33 1995/06/28 04:30:51 cgd Exp */
@ -120,11 +120,10 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: isabus.c,v 1.45 2009/08/19 15:16:09 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: isabus.c,v 1.46 2009/11/27 03:23:04 rmind Exp $");
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/user.h>
#include <sys/systm.h>
#include <sys/callout.h>
#include <sys/time.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: undefined.c,v 1.38 2009/11/21 20:32:17 rmind Exp $ */
/* $NetBSD: undefined.c,v 1.39 2009/11/27 03:23:04 rmind Exp $ */
/*
* Copyright (c) 2001 Ben Harris.
@ -54,7 +54,7 @@
#include <sys/kgdb.h>
#endif
__KERNEL_RCSID(0, "$NetBSD: undefined.c,v 1.38 2009/11/21 20:32:17 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: undefined.c,v 1.39 2009/11/27 03:23:04 rmind Exp $");
#include <sys/malloc.h>
#include <sys/queue.h>
@ -300,12 +300,13 @@ undefinedinstruction(trapframe_t *frame)
}
if (user) {
struct pcb *pcb = lwp_getpcb(l);
/*
* Modify the fault_code to reflect the USR/SVC state at
* time of fault.
*/
fault_code = FAULT_USER;
l->l_addr->u_pcb.pcb_tf = frame;
pcb->pcb_tf = frame;
} else
fault_code = 0;

View File

@ -1,4 +1,4 @@
/* $NetBSD: arm32_machdep.c,v 1.69 2009/11/26 00:19:12 matt Exp $ */
/* $NetBSD: arm32_machdep.c,v 1.70 2009/11/27 03:23:05 rmind Exp $ */
/*
* Copyright (c) 1994-1998 Mark Brinicombe.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: arm32_machdep.c,v 1.69 2009/11/26 00:19:12 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: arm32_machdep.c,v 1.70 2009/11/27 03:23:05 rmind Exp $");
#include "opt_md.h"
#include "opt_pmap_debug.h"
@ -51,7 +51,6 @@ __KERNEL_RCSID(0, "$NetBSD: arm32_machdep.c,v 1.69 2009/11/26 00:19:12 matt Exp
#include <sys/systm.h>
#include <sys/reboot.h>
#include <sys/proc.h>
#include <sys/user.h>
#include <sys/kernel.h>
#include <sys/mbuf.h>
#include <sys/mount.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: at91bus.c,v 1.8 2009/11/26 00:19:12 matt Exp $ */
/* $NetBSD: at91bus.c,v 1.9 2009/11/27 03:23:05 rmind Exp $ */
/*
* Copyright (c) 2007 Embedtronics Oy
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: at91bus.c,v 1.8 2009/11/26 00:19:12 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: at91bus.c,v 1.9 2009/11/27 03:23:05 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -458,7 +458,7 @@ at91bus_setup(BootConfig *mem)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef VERBOSE_INIT_ARM
printf("done!\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: atari_init.c,v 1.87 2009/11/26 00:19:13 matt Exp $ */
/* $NetBSD: atari_init.c,v 1.88 2009/11/27 03:23:05 rmind Exp $ */
/*
* Copyright (c) 1995 Leo Weppelman
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: atari_init.c,v 1.87 2009/11/26 00:19:13 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: atari_init.c,v 1.88 2009/11/27 03:23:05 rmind Exp $");
#include "opt_ddb.h"
#include "opt_mbtype.h"
@ -42,7 +42,6 @@ __KERNEL_RCSID(0, "$NetBSD: atari_init.c,v 1.87 2009/11/26 00:19:13 matt Exp $")
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/user.h>
#include <sys/ioctl.h>
#include <sys/select.h>
#include <sys/tty.h>
@ -274,9 +273,9 @@ start_c(int id, u_int ttphystart, u_int ttphysize, u_int stphysize,
avail = stphysize - pstart;
/*
* Save KVA of lwp0 user-area and allocate it
* Save KVA of lwp0 uarea and allocate it.
*/
lwp.l_addr = (struct user *)vstart;
uvm_lwp_setuarea(&lwp0, vstart);
pstart += USPACE;
vstart += USPACE;
avail -= USPACE;
@ -569,12 +568,13 @@ start_c(int id, u_int ttphystart, u_int ttphysize, u_int stphysize,
/*
* Initialize the "u-area" pages.
* Must initialize p_addr before autoconfig or the
* fault handler will get a NULL reference.
*
* Must initialize uarea before autoconfig or the fault handler
* will get a NULL reference.
*/
memset(lwp0.l_addr, 0, USPACE);
memset((void*)uvm_lwp_getuarea(&lwp0), 0, USPACE);
curlwp = &lwp0;
curpcb = &lwp0.l_addr->u_pcb;
curpcb = lwp_getpcb(&lwp0);
/*
* Get the hardware into a defined state

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.97 2009/03/18 10:22:26 cegger Exp $ */
/* $NetBSD: machdep.c,v 1.98 2009/11/27 03:23:05 rmind Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.97 2009/03/18 10:22:26 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.98 2009/11/27 03:23:05 rmind Exp $");
#include "opt_compat_netbsd.h"
#include "opt_ddb.h"
@ -54,7 +54,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.97 2009/03/18 10:22:26 cegger Exp $");
#include <sys/syscallargs.h>
#include <sys/syslog.h>
#include <sys/systm.h>
#include <sys/user.h>
#include <sys/ksyms.h>
#include <uvm/uvm_extern.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: cats_machdep.c,v 1.67 2009/11/26 00:19:13 matt Exp $ */
/* $NetBSD: cats_machdep.c,v 1.68 2009/11/27 03:23:05 rmind Exp $ */
/*
* Copyright (c) 1997,1998 Mark Brinicombe.
@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.67 2009/11/26 00:19:13 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: cats_machdep.c,v 1.68 2009/11/27 03:23:05 rmind Exp $");
#include "opt_ddb.h"
#include "opt_modular.h"
@ -739,7 +739,8 @@ initarm(void *arm_bootargs)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
/*
* XXX this should only be done in main() but it useful to
* have output earlier ...

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.103 2009/11/26 00:19:13 matt Exp $ */
/* $NetBSD: machdep.c,v 1.104 2009/11/27 03:23:05 rmind 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.103 2009/11/26 00:19:13 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.104 2009/11/27 03:23:05 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -62,7 +62,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.103 2009/11/26 00:19:13 matt Exp $");
#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/reboot.h>
#include <sys/user.h>
#include <sys/mount.h>
#include <sys/kcore.h>
#include <sys/boot_flag.h>
@ -146,8 +145,10 @@ extern char *esym;
void
mach_init(unsigned int memsize, u_int bim, char *bip)
{
char *kernend, *v;
char *kernend;
u_long first, last;
struct pcb *pcb0;
vaddr_t v;
extern char edata[], end[];
const char *bi_msg;
#if NKSYMS || defined(DDB) || defined(MODULAR)
@ -312,13 +313,15 @@ mach_init(unsigned int memsize, u_int bim, char *bip)
pmap_bootstrap();
/*
* Allocate space for proc0's USPACE.
* Allocate uarea page for lwp0 and set it.
*/
v = (char *)uvm_pageboot_alloc(USPACE);
lwp0.l_addr = (struct user *)v;
v = uvm_pageboot_alloc(USPACE);
uvm_lwp_setuarea(&lwp0, v);
pcb0 = lwp_getpcb(&lwp0);
pcb0->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
lwp0.l_md.md_regs = (struct frame *)(v + USPACE) - 1;
lwp0.l_addr->u_pcb.pcb_context[11] =
MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
}
/*
@ -363,7 +366,7 @@ cpu_reboot(int howto, char *bootstr)
/* Take a snapshot before clobbering any registers. */
if (curlwp)
savectx((struct user *)curpcb);
savectx(curpcb);
if (cold) {
howto |= RB_HALT;

View File

@ -1,4 +1,4 @@
/* $NetBSD: gt.c,v 1.21 2008/05/09 10:59:55 tsutsui Exp $ */
/* $NetBSD: gt.c,v 1.22 2009/11/27 03:23:05 rmind Exp $ */
/*
* Copyright (c) 2000 Soren S. Jorvang. All rights reserved.
@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: gt.c,v 1.21 2008/05/09 10:59:55 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: gt.c,v 1.22 2009/11/27 03:23:05 rmind Exp $");
#include "opt_pci.h"
#include "pci.h"
@ -37,7 +37,6 @@ __KERNEL_RCSID(0, "$NetBSD: gt.c,v 1.21 2008/05/09 10:59:55 tsutsui Exp $");
#include <sys/select.h>
#include <sys/tty.h>
#include <sys/proc.h>
#include <sys/user.h>
#include <sys/conf.h>
#include <sys/file.h>
#include <sys/uio.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.39 2008/11/30 18:21:32 martin Exp $ */
/* $NetBSD: machdep.c,v 1.40 2009/11/27 03:23:06 rmind Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2002 The NetBSD Foundation, Inc.
@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.39 2008/11/30 18:21:32 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.40 2009/11/27 03:23:06 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -76,7 +76,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.39 2008/11/30 18:21:32 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/user.h>
#include <sys/mount.h>
#include <sys/reboot.h>
#include <sys/sysctl.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: brh_machdep.c,v 1.33 2009/11/26 00:19:13 matt Exp $ */
/* $NetBSD: brh_machdep.c,v 1.34 2009/11/27 03:23:06 rmind 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.33 2009/11/26 00:19:13 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: brh_machdep.c,v 1.34 2009/11/27 03:23:06 rmind Exp $");
#include "opt_ddb.h"
#include "opt_pmap_debug.h"
@ -669,7 +669,7 @@ initarm(void *arg)
* Move from cpu_startup() as data_abort_handler() references
* this during uvm init
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef VERBOSE_INIT_ARM
printf("done!\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: armadillo9_machdep.c,v 1.16 2009/11/26 00:19:13 matt Exp $ */
/* $NetBSD: armadillo9_machdep.c,v 1.17 2009/11/27 03:23:06 rmind 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.16 2009/11/26 00:19:13 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: armadillo9_machdep.c,v 1.17 2009/11/27 03:23:06 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -774,7 +774,7 @@ initarm(void *arg)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef VERBOSE_INIT_ARM
printf("done!\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: beagle_machdep.c,v 1.5 2009/11/26 00:19:14 matt Exp $ */
/* $NetBSD: beagle_machdep.c,v 1.6 2009/11/27 03:23:06 rmind 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.5 2009/11/26 00:19:14 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: beagle_machdep.c,v 1.6 2009/11/27 03:23:06 rmind Exp $");
#include "opt_machdep.h"
#include "opt_ddb.h"
@ -531,7 +531,7 @@ initarm(void *arg)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init.
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef VERBOSE_INIT_ARM
printf("bootstrap done.\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: initarm_common.c,v 1.8 2009/11/26 00:19:14 matt Exp $ */
/* $NetBSD: initarm_common.c,v 1.9 2009/11/27 03:23:06 rmind Exp $ */
/*
* Copyright 2003 Wasabi Systems, Inc.
@ -69,13 +69,13 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: initarm_common.c,v 1.8 2009/11/26 00:19:14 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: initarm_common.c,v 1.9 2009/11/27 03:23:06 rmind Exp $");
#include <sys/systm.h>
#include <sys/param.h>
#include <sys/kernel.h>
#include <uvm/uvm.h>
#include <uvm/uvm_extern.h>
#include <machine/bootconfig.h>
#include <machine/cpu.h>
@ -416,7 +416,7 @@ initarm_common(const struct initarm_config *ic)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef VERBOSE_INIT_ARM
printf("done!\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: g42xxeb_machdep.c,v 1.17 2009/11/26 00:19:14 matt Exp $ */
/* $NetBSD: g42xxeb_machdep.c,v 1.18 2009/11/27 03:23:06 rmind Exp $ */
/*
* Copyright (c) 2002, 2003, 2004, 2005 Genetec Corporation.
@ -802,7 +802,7 @@ initarm(void *arg)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef VERBOSE_INIT_ARM
printf("bootstrap done.\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: gemini_machdep.c,v 1.13 2009/11/26 00:19:14 matt Exp $ */
/* $NetBSD: gemini_machdep.c,v 1.14 2009/11/27 03:23:06 rmind 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.13 2009/11/26 00:19:14 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: gemini_machdep.c,v 1.14 2009/11/27 03:23:06 rmind Exp $");
#include "opt_machdep.h"
#include "opt_ddb.h"
@ -685,7 +685,7 @@ initarm(void *arg)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init.
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef VERBOSE_INIT_ARM
printf("bootstrap done.\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: gumstix_machdep.c,v 1.19 2009/11/26 00:19:14 matt Exp $ */
/* $NetBSD: gumstix_machdep.c,v 1.20 2009/11/27 03:23:06 rmind Exp $ */
/*
* Copyright (C) 2005, 2006, 2007 WIDE Project and SOUM Corporation.
* All rights reserved.
@ -798,7 +798,7 @@ initarm(void *arg)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef VERBOSE_INIT_ARM
printf("bootstrap done.\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: hdlg_machdep.c,v 1.11 2009/11/26 00:19:14 matt Exp $ */
/* $NetBSD: hdlg_machdep.c,v 1.12 2009/11/27 03:23:06 rmind 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.11 2009/11/26 00:19:14 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: hdlg_machdep.c,v 1.12 2009/11/27 03:23:06 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -563,7 +563,7 @@ initarm(void *arg)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef VERBOSE_INIT_ARM
printf("done!\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: imx31lk_machdep.c,v 1.6 2009/11/26 00:19:14 matt Exp $ */
/* $NetBSD: imx31lk_machdep.c,v 1.7 2009/11/27 03:23:06 rmind 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.6 2009/11/26 00:19:14 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: imx31lk_machdep.c,v 1.7 2009/11/27 03:23:06 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -679,7 +679,7 @@ printf("%s: textsize %#lx, totalsize %#lx\n",
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef VERBOSE_INIT_ARM
printf("bootstrap done.\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: integrator_machdep.c,v 1.63 2009/11/26 00:19:14 matt Exp $ */
/* $NetBSD: integrator_machdep.c,v 1.64 2009/11/27 03:23:07 rmind Exp $ */
/*
* Copyright (c) 2001,2002 ARM Ltd
@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: integrator_machdep.c,v 1.63 2009/11/26 00:19:14 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: integrator_machdep.c,v 1.64 2009/11/27 03:23:07 rmind Exp $");
#include "opt_ddb.h"
#include "opt_pmap_debug.h"
@ -669,7 +669,7 @@ initarm(void *arg)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef PLCONSOLE
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: iq80310_machdep.c,v 1.75 2009/11/26 00:19:14 matt Exp $ */
/* $NetBSD: iq80310_machdep.c,v 1.76 2009/11/27 03:23:07 rmind 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.75 2009/11/26 00:19:14 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: iq80310_machdep.c,v 1.76 2009/11/27 03:23:07 rmind Exp $");
#include "opt_ddb.h"
#include "opt_pmap_debug.h"
@ -683,7 +683,7 @@ initarm(void *arg)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef VERBOSE_INIT_ARM
printf("done!\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: iq80321_machdep.c,v 1.45 2009/11/26 00:19:15 matt Exp $ */
/* $NetBSD: iq80321_machdep.c,v 1.46 2009/11/27 03:23:07 rmind 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.45 2009/11/26 00:19:15 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: iq80321_machdep.c,v 1.46 2009/11/27 03:23:07 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -709,7 +709,7 @@ initarm(void *arg)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef VERBOSE_INIT_ARM
printf("done!\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixdp425_machdep.c,v 1.24 2009/11/26 00:19:15 matt Exp $ */
/* $NetBSD: ixdp425_machdep.c,v 1.25 2009/11/27 03:23:07 rmind 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.24 2009/11/26 00:19:15 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: ixdp425_machdep.c,v 1.25 2009/11/27 03:23:07 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -678,7 +678,7 @@ initarm(void *arg)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef VERBOSE_INIT_ARM
printf("bootstrap done.\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: ixm1200_machdep.c,v 1.43 2009/11/26 00:19:15 matt Exp $ */
/* $NetBSD: ixm1200_machdep.c,v 1.44 2009/11/27 03:23:07 rmind Exp $ */
/*
* Copyright (c) 2002, 2003
@ -61,7 +61,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ixm1200_machdep.c,v 1.43 2009/11/26 00:19:15 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: ixm1200_machdep.c,v 1.44 2009/11/27 03:23:07 rmind Exp $");
#include "opt_ddb.h"
#include "opt_modular.h"
@ -621,7 +621,7 @@ initarm(void *arg)
* Moved here from cpu_startup() as data_abort_handler() references
* this during init
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
/*
* We must now clean the cache again....

View File

@ -1,4 +1,4 @@
/* $NetBSD: lubbock_machdep.c,v 1.21 2009/11/26 00:19:15 matt Exp $ */
/* $NetBSD: lubbock_machdep.c,v 1.22 2009/11/27 03:23:07 rmind 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.21 2009/11/26 00:19:15 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: lubbock_machdep.c,v 1.22 2009/11/27 03:23:07 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -882,7 +882,7 @@ initarm(void *arg)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef VERBOSE_INIT_ARM
printf("bootstrap done.\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: npwr_fc_machdep.c,v 1.11 2009/11/26 00:19:15 matt Exp $ */
/* $NetBSD: npwr_fc_machdep.c,v 1.12 2009/11/27 03:23:07 rmind 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.11 2009/11/26 00:19:15 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: npwr_fc_machdep.c,v 1.12 2009/11/27 03:23:07 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -680,7 +680,7 @@ initarm(void *arg)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef VERBOSE_INIT_ARM
printf("done!\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: nslu2_machdep.c,v 1.14 2009/11/26 00:19:15 matt Exp $ */
/* $NetBSD: nslu2_machdep.c,v 1.15 2009/11/27 03:23:07 rmind 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.14 2009/11/26 00:19:15 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: nslu2_machdep.c,v 1.15 2009/11/27 03:23:07 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -746,7 +746,7 @@ initarm(void *arg)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef VERBOSE_INIT_ARM
printf("bootstrap done.\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: osk5912_machdep.c,v 1.6 2009/11/26 00:19:15 matt Exp $ */
/* $NetBSD: osk5912_machdep.c,v 1.7 2009/11/27 03:23:07 rmind 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.6 2009/11/26 00:19:15 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: osk5912_machdep.c,v 1.7 2009/11/27 03:23:07 rmind Exp $");
#include "opt_machdep.h"
#include "opt_ddb.h"
@ -421,7 +421,7 @@ initarm(void *arg)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init.
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef VERBOSE_INIT_ARM
printf("bootstrap done.\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: smdk2410_machdep.c,v 1.24 2009/11/26 00:19:15 matt Exp $ */
/* $NetBSD: smdk2410_machdep.c,v 1.25 2009/11/27 03:23:07 rmind 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.24 2009/11/26 00:19:15 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: smdk2410_machdep.c,v 1.25 2009/11/27 03:23:07 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -806,7 +806,7 @@ initarm(void *arg)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef VERBOSE_INIT_ARM
printf("done!\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: smdk2800_machdep.c,v 1.32 2009/11/26 00:19:15 matt Exp $ */
/* $NetBSD: smdk2800_machdep.c,v 1.33 2009/11/27 03:23:07 rmind 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.32 2009/11/26 00:19:15 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: smdk2800_machdep.c,v 1.33 2009/11/27 03:23:07 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -710,7 +710,7 @@ initarm(void *arg)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef VERBOSE_INIT_ARM
printf("done!\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: sdp24xx_machdep.c,v 1.7 2009/11/26 00:19:15 matt Exp $ */
/* $NetBSD: sdp24xx_machdep.c,v 1.8 2009/11/27 03:23:07 rmind 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.7 2009/11/26 00:19:15 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: sdp24xx_machdep.c,v 1.8 2009/11/27 03:23:07 rmind Exp $");
#include "opt_machdep.h"
#include "opt_ddb.h"
@ -520,7 +520,7 @@ initarm(void *arg)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init.
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef VERBOSE_INIT_ARM
printf("bootstrap done.\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: tsarm_machdep.c,v 1.12 2009/11/26 00:19:15 matt Exp $ */
/* $NetBSD: tsarm_machdep.c,v 1.13 2009/11/27 03:23:08 rmind 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.12 2009/11/26 00:19:15 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: tsarm_machdep.c,v 1.13 2009/11/27 03:23:08 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -686,7 +686,7 @@ initarm(void *arg)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef VERBOSE_INIT_ARM
printf("done!\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: viper_machdep.c,v 1.13 2009/11/26 00:19:16 matt Exp $ */
/* $NetBSD: viper_machdep.c,v 1.14 2009/11/27 03:23:08 rmind 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.13 2009/11/26 00:19:16 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: viper_machdep.c,v 1.14 2009/11/27 03:23:08 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -728,7 +728,7 @@ initarm(void *arg)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef VERBOSE_INIT_ARM
printf("bootstrap done.\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.12 2009/11/26 00:19:16 matt Exp $ */
/* $NetBSD: machdep.c,v 1.13 2009/11/27 03:23:08 rmind 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.12 2009/11/26 00:19:16 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.13 2009/11/27 03:23:08 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -124,7 +124,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.12 2009/11/26 00:19:16 matt Exp $");
#include <sys/kernel.h>
#include <sys/buf.h>
#include <sys/reboot.h>
#include <sys/user.h>
#include <sys/mount.h>
#include <sys/kcore.h>
#include <sys/boot_flag.h>
@ -310,6 +309,7 @@ void
mach_init(int argc, char **argv, void *a2, void *a3)
{
struct adm5120_config *admc = &adm5120_configuration;
struct pcb *pcb0;
uint32_t memsize;
vaddr_t kernend;
u_long first, last;
@ -434,13 +434,15 @@ mach_init(int argc, char **argv, void *a2, void *a3)
pmap_bootstrap();
/*
* Init mapping for u page(s) for proc0.
* Allocate uarea page for lwp0 and set it.
*/
v = uvm_pageboot_alloc(USPACE);
lwp0.l_addr = (struct user *)v;
uvm_lwp_setuarea(&lwp0, v);
pcb0 = lwp_getpcb(&lwp0);
pcb0->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
lwp0.l_md.md_regs = (struct frame *)(v + USPACE) - 1;
lwp0.l_addr->u_pcb.pcb_context[11] =
MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
/*
* Initialize debuggers, and break into them, if appropriate.
@ -516,7 +518,7 @@ cpu_reboot(int howto, char *bootstr)
/* Take a snapshot before clobbering any registers. */
if (curproc)
savectx((struct user *)curpcb);
savectx(curpcb);
/* If "always halt" was specified as a boot flag, obey. */
if (boothowto & RB_HALT)

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.43 2009/11/26 00:19:16 matt Exp $ */
/* $NetBSD: machdep.c,v 1.44 2009/11/27 03:23:08 rmind 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.43 2009/11/26 00:19:16 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.44 2009/11/27 03:23:08 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -121,7 +121,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.43 2009/11/26 00:19:16 matt Exp $");
#include <sys/kernel.h>
#include <sys/buf.h>
#include <sys/reboot.h>
#include <sys/user.h>
#include <sys/mount.h>
#include <sys/kcore.h>
#include <sys/boot_flag.h>
@ -187,7 +186,8 @@ mach_init(int argc, char **argv, yamon_env_var *envp, u_long memsize)
void *kernend;
const char *cp;
u_long first, last;
void *v;
struct pcb *pcb0;
vaddr_t v;
int freqok, howto, i;
const struct alchemy_board *board;
@ -360,13 +360,15 @@ mach_init(int argc, char **argv, yamon_env_var *envp, u_long memsize)
pmap_bootstrap();
/*
* Init mapping for u page(s) for proc0.
* Allocate uarea page for lwp0 and set it.
*/
v = (void *) uvm_pageboot_alloc(USPACE);
lwp0.l_addr = (struct user *)v;
lwp0.l_md.md_regs = (struct frame *)((char *)v + USPACE) - 1;
lwp0.l_addr->u_pcb.pcb_context[11] =
MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
v = uvm_pageboot_alloc(USPACE);
uvm_lwp_setuarea(&lwp0, v);
pcb0 = lwp_getpcb(&lwp0);
pcb0->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
lwp0.l_md.md_regs = (struct frame *)(v + USPACE) - 1;
/*
* Initialize debuggers, and break into them, if appropriate.
@ -436,7 +438,7 @@ cpu_reboot(int howto, char *bootstr)
/* Take a snapshot before clobbering any registers. */
if (curproc)
savectx((struct user *)curpcb);
savectx(curpcb);
board = board_info();
KASSERT(board != NULL);

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.19 2009/11/26 00:19:16 matt Exp $ */
/* $NetBSD: machdep.c,v 1.20 2009/11/27 03:23:08 rmind 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.19 2009/11/26 00:19:16 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.20 2009/11/27 03:23:08 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -158,7 +158,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.19 2009/11/26 00:19:16 matt Exp $");
#include <sys/kernel.h>
#include <sys/buf.h>
#include <sys/reboot.h>
#include <sys/user.h>
#include <sys/mount.h>
#include <sys/kcore.h>
#include <sys/boot_flag.h>
@ -220,8 +219,9 @@ mach_init(void)
{
void *kernend;
u_long first, last;
void * v;
uint32_t memsize;
struct pcb *pcb0;
vaddr_t v;
uint32_t memsize;
extern char edata[], end[]; /* XXX */
@ -306,13 +306,15 @@ mach_init(void)
pmap_bootstrap();
/*
* Init mapping for u page(s) for proc0.
* Allocate uarea page for lwp0 and set it.
*/
v = (void *) uvm_pageboot_alloc(USPACE);
lwp0.l_addr = (struct user *)v;
lwp0.l_md.md_regs = (struct frame *)((char *)v + USPACE) - 1;
lwp0.l_addr->u_pcb.pcb_context[11] =
MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
v = uvm_pageboot_alloc(USPACE);
uvm_lwp_setuarea(&lwp0, v);
pcb0 = lwp_getpcb(&lwp0);
pcb0->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
lwp0.l_md.md_regs = (struct frame *)(v + USPACE) - 1;
/*
* Initialize busses.
@ -401,7 +403,7 @@ cpu_reboot(int howto, char *bootstr)
/* Take a snapshot before clobbering any registers. */
if (curproc)
savectx((struct user *)curpcb);
savectx(curpcb);
/* If "always halt" was specified as a boot flag, obey. */
if (boothowto & RB_HALT)

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.9 2009/11/26 00:19:16 matt Exp $ */
/* $NetBSD: machdep.c,v 1.10 2009/11/27 03:23:08 rmind Exp $ */
/*
* Copyright 2001, 2002 Wasabi Systems, Inc.
@ -112,7 +112,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.9 2009/11/26 00:19:16 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.10 2009/11/27 03:23:08 rmind Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@ -123,7 +123,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.9 2009/11/26 00:19:16 matt Exp $");
#include <sys/kernel.h>
#include <sys/buf.h>
#include <sys/reboot.h>
#include <sys/user.h>
#include <sys/mount.h>
#include <sys/kcore.h>
#include <sys/boot_flag.h>
@ -245,8 +244,10 @@ void
mach_init(int argc, char **argv, char **envp, void *callvec)
{
struct gdium_config *gc = &gdium_configuration;
void *kernend, *v;
u_long first, last;
void *kernend;
u_long first, last;
struct pcb *pcb0;
vaddr_t v;
#ifdef NOTYET
char *cp;
int howto;
@ -387,13 +388,15 @@ mach_init(int argc, char **argv, char **envp, void *callvec)
pmap_bootstrap();
/*
* Allocate space for proc0's USPACE.
* Allocate uarea page for lwp0 and set it.
*/
v = (void *)uvm_pageboot_alloc(USPACE);
lwp0.l_addr = (struct user *)v;
lwp0.l_md.md_regs = (struct frame *)((char *)v + USPACE) - 1;
lwp0.l_addr->u_pcb.pcb_context[11] =
MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
v = uvm_pageboot_alloc(USPACE);
uvm_lwp_setuarea(&lwp0, v);
pcb0 = lwp_getpcb(&lwp0);
pcb0->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
lwp0.l_md.md_regs = (struct frame *)(v + USPACE) - 1;
/*
* Initialize debuggers, and break into them, if appropriate.
@ -461,7 +464,7 @@ cpu_reboot(int howto, char *bootstr)
/* Take a snapshot before clobbering any registers. */
if (curproc)
savectx((struct user *)curpcb);
savectx(curpcb);
if (cold) {
howto |= RB_HALT;

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.35 2009/11/26 00:19:16 matt Exp $ */
/* $NetBSD: machdep.c,v 1.36 2009/11/27 03:23:08 rmind Exp $ */
/*
* Copyright 2001, 2002 Wasabi Systems, Inc.
@ -112,7 +112,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.35 2009/11/26 00:19:16 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.36 2009/11/27 03:23:08 rmind Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@ -123,7 +123,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.35 2009/11/26 00:19:16 matt Exp $");
#include <sys/kernel.h>
#include <sys/buf.h>
#include <sys/reboot.h>
#include <sys/user.h>
#include <sys/mount.h>
#include <sys/kcore.h>
#include <sys/boot_flag.h>
@ -199,8 +198,10 @@ mach_init(int argc, char **argv, yamon_env_var *envp, u_long memsize)
{
struct malta_config *mcp = &malta_configuration;
bus_space_handle_t sh;
void *kernend, *v;
u_long first, last;
void *kernend;
u_long first, last;
struct pcb *pcb0;
vaddr_t v;
char *cp;
int freqok, i, howto;
uint8_t *brkres = (uint8_t *)MIPS_PHYS_TO_KSEG1(MALTA_BRKRES);
@ -317,13 +318,15 @@ mach_init(int argc, char **argv, yamon_env_var *envp, u_long memsize)
pmap_bootstrap();
/*
* Allocate space for proc0's USPACE.
* Allocate uarea page for lwp0 and set it.
*/
v = (void *)uvm_pageboot_alloc(USPACE);
lwp0.l_addr = (struct user *)v;
lwp0.l_md.md_regs = (struct frame *)((char *)v + USPACE) - 1;
lwp0.l_addr->u_pcb.pcb_context[11] =
MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
v = uvm_pageboot_alloc(USPACE);
uvm_lwp_setuarea(&lwp0, v);
pcb0 = lwp_getpcb(&lwp0);
pcb0->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
lwp0.l_md.md_regs = (struct frame *)(v + USPACE) - 1;
/*
* Initialize debuggers, and break into them, if appropriate.
@ -391,7 +394,7 @@ cpu_reboot(int howto, char *bootstr)
/* Take a snapshot before clobbering any registers. */
if (curproc)
savectx((struct user *)curpcb);
savectx(curpcb);
if (cold) {
howto |= RB_HALT;

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.28 2009/11/26 00:19:16 matt Exp $ */
/* $NetBSD: machdep.c,v 1.29 2009/11/27 03:23:08 rmind Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.28 2009/11/26 00:19:16 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.29 2009/11/27 03:23:08 rmind Exp $");
#include "opt_explora.h"
#include "opt_modular.h"
@ -43,7 +43,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.28 2009/11/26 00:19:16 matt Exp $");
#include <sys/kernel.h>
#include <sys/mount.h>
#include <sys/proc.h>
#include <sys/user.h>
#include <sys/reboot.h>
#include <sys/ksyms.h>
#include <sys/device.h>
@ -209,9 +208,9 @@ bootstrap(u_int startkernel, u_int endkernel)
* Initialize lwp0 and current pcb and pmap pointers.
*/
lwp0.l_cpu = ci;
memset(lwp0.l_addr, 0, sizeof *lwp0.l_addr);
curpcb = &lwp0.l_addr->u_pcb;
curpcb = lwp_getpcb(&lwp0);
memset(curpcb, 0, sizeof(struct pcb)); /* XXX why? */
curpcb->pcb_pm = pmap_kernel();
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.11 2009/11/26 00:19:17 matt Exp $ */
/* $NetBSD: machdep.c,v 1.12 2009/11/27 03:23:08 rmind Exp $ */
/*
* Copyright (c) 2006 Jachym Holecek
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.11 2009/11/26 00:19:17 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.12 2009/11/27 03:23:08 rmind Exp $");
#include "opt_compat_netbsd.h"
#include "opt_ddb.h"
@ -56,7 +56,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.11 2009/11/26 00:19:17 matt Exp $");
#include <sys/syslog.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/user.h>
#include <sys/boot_flag.h>
#include <sys/ksyms.h>
#include <sys/device.h>
@ -207,9 +206,9 @@ initppc(u_int startkernel, u_int endkernel)
physmemr, availmemr);
lwp0.l_cpu = ci;
memset(lwp0.l_addr, 0, sizeof(*lwp0.l_addr));
curpcb = &lwp0.l_addr->u_pcb;
curpcb = lwp_getpcb(&lwp0);
memset(curpcb, 0, sizeof(struct pcb));
curpcb->pcb_pm = pmap_kernel();
for (exc = EXC_RSVD; exc <= EXC_LAST; exc += 0x100)

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.42 2009/11/26 00:19:17 matt Exp $ */
/* $NetBSD: machdep.c,v 1.43 2009/11/27 03:23:08 rmind Exp $ */
/*
* Copyright 2001, 2002 Wasabi Systems, Inc.
@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.42 2009/11/26 00:19:17 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.43 2009/11/27 03:23:08 rmind Exp $");
#include "opt_compat_netbsd.h"
#include "opt_ddb.h"
@ -87,7 +87,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.42 2009/11/26 00:19:17 matt Exp $");
#include <sys/syslog.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/user.h>
#include <sys/boot_flag.h>
#include <sys/ksyms.h>
#include <sys/device.h>
@ -204,9 +203,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;
memset(lwp0.l_addr, 0, sizeof *lwp0.l_addr);
curpcb = &lwp0.laddr->u_pcb;
curpcb = lwp_getpcb(&lwp0);
memset(curpcb, 0, sizeof(struct pcb));
curpcb->pcb_pm = pmap_kernel();
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.69 2009/11/07 07:27:43 cegger Exp $ */
/* $NetBSD: machdep.c,v 1.70 2009/11/27 03:23:09 rmind Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.69 2009/11/07 07:27:43 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.70 2009/11/27 03:23:09 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -75,7 +75,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.69 2009/11/07 07:27:43 cegger Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/user.h>
#include <sys/mount.h>
#include <sys/reboot.h>
#include <sys/sysctl.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.18 2009/11/26 00:19:17 matt Exp $ */
/* $NetBSD: machdep.c,v 1.19 2009/11/27 03:23:09 rmind 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.18 2009/11/26 00:19:17 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.19 2009/11/27 03:23:09 rmind Exp $");
#include "opt_ddb.h"
@ -35,7 +35,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.18 2009/11/26 00:19:17 matt Exp $");
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/user.h>
#include <sys/buf.h>
#include <sys/reboot.h>
#include <sys/mount.h>
@ -90,7 +89,8 @@ void
mach_init(int argc, char *argv[], struct bootinfo *bi)
{
extern char kernel_text[], edata[], end[];
void *v;
struct pcb *pcb0;
vaddr_t v;
int i;
/* Clear BSS */
@ -168,11 +168,13 @@ mach_init(int argc, char *argv[], struct bootinfo *bi)
pmap_bootstrap();
v = (void *)uvm_pageboot_alloc(USPACE); /* proc0 USPACE */
lwp0.l_addr = (struct user *) v;
lwp0.l_md.md_regs = (struct frame *)((char *)v + USPACE) - 1;
lwp0.l_addr->u_pcb.pcb_context[11] =
MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
v = uvm_pageboot_alloc(USPACE);
uvm_lwp_setuarea(&lwp0, v);
pcb0 = lwp_getpcb(&lwp0);
pcb0->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
lwp0.l_md.md_regs = (struct frame *)(v + USPACE) - 1;
}
void
@ -261,7 +263,7 @@ cpu_reboot(int howto, char *bootstr)
/* Take a snapshot before clobbering any registers. */
if (curlwp)
savectx((struct user *)curpcb);
savectx(curpcb);
if (cold) {
howto |= RB_HALT;

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap_bootstrap.c,v 1.38 2009/11/26 00:19:17 matt Exp $ */
/* $NetBSD: pmap_bootstrap.c,v 1.39 2009/11/27 03:23:09 rmind Exp $ */
/*
* Copyright (c) 1991, 1993
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.38 2009/11/26 00:19:17 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.39 2009/11/27 03:23:09 rmind Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@ -409,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(lwp.l_addr, struct user *) = (struct user *)(p0upa - firstpa);
RELOC(lwp0.l_addr, struct user *) = (struct user *)(p0upa - firstpa);
/*
* VM data structures are now initialized, set up data for

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.S,v 1.36 2009/11/26 00:19:17 matt Exp $ */
/* $NetBSD: locore.S,v 1.37 2009/11/27 03:23:09 rmind Exp $ */
/* $OpenBSD: locore.S,v 1.158 2008/07/28 19:08:46 miod Exp $ */
/*
@ -242,7 +242,7 @@ L$start_zero_tf:
stws,ma %r0, 4(%t2) /* XXX could use ,bc here, but gas is broken */
/*
* kernel stack starts a page and a trapframe above l_addr.
* kernel stack starts a page and a trapframe above uarea address.
*/
ldo NBPG+TRAPFRAME_SIZEOF(%t3), %sp
mtctl %t3, CR_UPADDR
@ -802,7 +802,7 @@ switch_diag:
comb,=,n %arg0, %arg1, kstack_ok
/*
* cpu_lwp_fork sets the initial stack to a page above l_addr.
* cpu_lwp_fork sets the initial stack to a page above uarea address.
* Check that the stack is above this value for curl.
*/
ldw L_ADDR(%arg1), %arg2

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.74 2009/11/26 00:19:17 matt Exp $ */
/* $NetBSD: machdep.c,v 1.75 2009/11/27 03:23:09 rmind 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.74 2009/11/26 00:19:17 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.75 2009/11/27 03:23:09 rmind Exp $");
#include "opt_cputype.h"
#include "opt_ddb.h"
@ -82,7 +82,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.74 2009/11/26 00:19:17 matt Exp $");
#include <sys/msgbuf.h>
#include <sys/ioctl.h>
#include <sys/tty.h>
#include <sys/user.h>
#include <sys/exec.h>
#include <sys/exec_aout.h> /* for MID_* */
#include <sys/sysctl.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: hpc_machdep.c,v 1.93 2009/11/26 00:19:17 matt Exp $ */
/* $NetBSD: hpc_machdep.c,v 1.94 2009/11/27 03:23:09 rmind Exp $ */
/*
* Copyright (c) 1994-1998 Mark Brinicombe.
@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: hpc_machdep.c,v 1.93 2009/11/26 00:19:17 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: hpc_machdep.c,v 1.94 2009/11/27 03:23:09 rmind Exp $");
#include "opt_ddb.h"
#include "opt_modular.h"
@ -659,7 +659,7 @@ initarm(int argc, char **argv, struct bootinfo *bi)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init.
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef BOOT_DUMP
dumppages((char *)0xc0000000, 16 * PAGE_SIZE);

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.104 2009/11/26 00:19:17 matt Exp $ */
/* $NetBSD: machdep.c,v 1.105 2009/11/27 03:23:09 rmind 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.104 2009/11/26 00:19:17 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.105 2009/11/27 03:23:09 rmind Exp $");
#include "opt_vr41xx.h"
#include "opt_tx39xx.h"
@ -131,7 +131,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.104 2009/11/26 00:19:17 matt Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/user.h>
#include <sys/buf.h>
#include <sys/reboot.h>
#include <sys/mount.h>
@ -264,6 +263,7 @@ mach_init(int argc, char *argv[], struct bootinfo *bi)
#if NKSYMS || defined(DDB) || defined(MODULAR)
extern void *esym;
#endif
struct pcb *pcb0;
void *kernend;
char *cp;
int i;
@ -453,13 +453,15 @@ mach_init(int argc, char *argv[], struct bootinfo *bi)
ksyms_addsyms_elf(symbolsz, &end, esym);
#endif /* DDB */
/*
* Alloc u pages for lwp0 stealing KSEG0 memory.
* Alloc uarea for lwp0 stealing KSEG0 memory.
*/
lwp0.l_addr = (struct user *)kernend;
lwp0.l_md.md_regs = (struct frame *)((char *)kernend + USPACE) - 1;
uvm_lwp_setuarea(&lwp0, (vaddr_t)kernend);
memset(kernend, 0, USPACE);
lwp0.l_addr->u_pcb.pcb_context[11] =
MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
pcb0 = lwp_getpcb(&lwp0);
pcb0->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
lwp0.l_md.md_regs = (struct frame *)((char *)kernend + USPACE) - 1;
kernend = (char *)kernend + USPACE;
@ -598,7 +600,7 @@ cpu_reboot(int howto, char *bootstr)
/* take a snap shot before clobbering any registers */
if (curlwp)
savectx((struct user *)curpcb);
savectx(curpcb);
#ifdef DEBUG
if (panicstr)

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.69 2009/03/21 04:58:32 uwe Exp $ */
/* $NetBSD: machdep.c,v 1.70 2009/11/27 03:23:09 rmind Exp $ */
/*-
* Copyright (c) 2001, 2002, 2004 The NetBSD Foundation, Inc.
@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.69 2009/03/21 04:58:32 uwe Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.70 2009/11/27 03:23:09 rmind Exp $");
#include "opt_md.h"
#include "opt_ddb.h"
@ -49,7 +49,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.69 2009/03/21 04:58:32 uwe Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/user.h>
#include <sys/device.h>
#include <sys/reboot.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap.c,v 1.58 2009/11/26 00:19:17 matt Exp $ */
/* $NetBSD: pmap.c,v 1.59 2009/11/27 03:23:09 rmind Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@ -65,12 +65,11 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.58 2009/11/26 00:19:17 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.59 2009/11/27 03:23:09 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/malloc.h>
#include <sys/user.h>
#include <sys/proc.h>
#include <uvm/uvm.h>
@ -1023,7 +1022,7 @@ pmap_bootstrap(vaddr_t vstart)
else if (va >= ksro && va < kero)
prot = UVM_PROT_R;
#ifdef DIAGNOSTIC
else if (va == (vaddr_t)lwp0.l_addr + USPACE - PAGE_SIZE)
else if (va == uvm_lwp_getuarea(&lwp0) + USPACE - PAGE_SIZE)
prot = UVM_PROT_NONE;
#endif
pmap_kenter_pa(va, va, prot, 0);
@ -1666,8 +1665,9 @@ pmap_extract(pmap_t pmap, vaddr_t va, paddr_t *pap)
/*
* pmap_activate(lwp)
* Activates the vmspace for the given LWP. This isn't necessarily the
* current LWP.
*
* Activates the vmspace for the given LWP.
* This is not necessarily the current LWP.
*/
void
pmap_activate(struct lwp *l)
@ -1677,11 +1677,11 @@ pmap_activate(struct lwp *l)
pa_space_t space = pmap->pm_space;
struct pcb *pcb = lwp_getpcb(l);
KASSERT(pcb->pcb_uva == (vaddr_t)l->l_addr);
KASSERT(pcb->pcb_uva == uvm_lwp_getuarea(l));
/* space is cached for the copy{in,out}'s pleasure */
pcb->pcb_space = space;
fdcache(HPPA_SID_KERNEL, (vaddr_t)l->l_addr, PAGE_SIZE);
fdcache(HPPA_SID_KERNEL, (vaddr_t)pcb, PAGE_SIZE);
if (p == curproc)
mtctl(pmap->pm_pid, CR_PIDR2);

View File

@ -1,4 +1,4 @@
/* $NetBSD: trap.c,v 1.61 2009/11/21 15:36:34 rmind Exp $ */
/* $NetBSD: trap.c,v 1.62 2009/11/27 03:23:09 rmind Exp $ */
/*-
* Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@ -58,7 +58,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.61 2009/11/21 15:36:34 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.62 2009/11/27 03:23:09 rmind Exp $");
/* #define INTRDEBUG */
/* #define TRAPDEBUG */
@ -413,6 +413,7 @@ frame_sanity_check(int where, int type, struct trapframe *tf, struct lwp *l)
extern int kernel_text;
extern int etext;
extern register_t kpsw;
#define SANITY(e) \
do { \
if (sanity_frame == NULL && !(e)) { \
@ -425,7 +426,7 @@ do { \
SANITY((tf->tf_ipsw & kpsw) == kpsw);
SANITY((kpsw & PSW_I) == 0 || tf->tf_eiem != 0);
if (tf->tf_iisq_head == HPPA_SID_KERNEL) {
vaddr_t minsp, maxsp;
vaddr_t minsp, maxsp, uv;
/*
* If the trap happened in the gateway
@ -451,14 +452,15 @@ do { \
SANITY(tf->tf_iioq_tail >= (u_int) &kernel_text);
SANITY(tf->tf_iioq_tail < (u_int) &etext);
maxsp = (u_int)(l->l_addr) + USPACE + PAGE_SIZE;
minsp = (u_int)(l->l_addr) + PAGE_SIZE;
maxsp = uv + USPACE + PAGE_SIZE;
minsp = uv + PAGE_SIZE;
SANITY(l != NULL || (tf->tf_sp >= minsp && tf->tf_sp < maxsp));
} else {
SANITY(USERMODE(tf->tf_iioq_head));
SANITY(USERMODE(tf->tf_iioq_tail));
SANITY(l != NULL && tf->tf_cr30 == kvtop((void *)l->l_addr));
SANITY(l != NULL &&
tf->tf_cr30 == kvtop((void *)uvm_lwp_getuarea(l)));
}
#undef SANITY
out:

View File

@ -1,4 +1,4 @@
/* $NetBSD: copy.S,v 1.20 2009/11/06 18:18:57 dyoung Exp $ */
/* $NetBSD: copy.S,v 1.21 2009/11/27 03:23:10 rmind Exp $ */
/* NetBSD: locore.S,v 1.34 2005/04/01 11:59:31 yamt Exp $ */
/*-
@ -65,7 +65,7 @@
*/
#include <machine/asm.h>
__KERNEL_RCSID(0, "$NetBSD: copy.S,v 1.20 2009/11/06 18:18:57 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: copy.S,v 1.21 2009/11/27 03:23:10 rmind Exp $");
#include "assym.h"
@ -76,7 +76,7 @@ __KERNEL_RCSID(0, "$NetBSD: copy.S,v 1.20 2009/11/06 18:18:57 dyoung Exp $");
#define GET_CURPCB(reg) \
movl CPUVAR(CURLWP), reg; \
movl L_ADDR(reg), reg
movl L_PCB(reg), reg
/*
* These are arranged so that the abnormal case is a forwards
@ -140,7 +140,7 @@ ENTRY(return_address)
movl %ebp,%eax /* frame pointer -> %eax */
movl 4(%esp),%ecx /* level -> %ecx */
movl CPUVAR(CURLWP),%edx
movl L_ADDR(%edx),%edx
movl L_PCB(%edx),%edx
movl $_C_LABEL(return_address_fault),PCB_ONFAULT(%edx)
cmpl $0,%ecx
je 2f
@ -540,7 +540,7 @@ ENTRY(fuswintr)
cmpl $VM_MAXUSER_ADDRESS-2,%edx
ja _C_LABEL(fusuaddrfault)
movl CPUVAR(CURLWP),%ecx
movl L_ADDR(%ecx),%ecx
movl L_PCB(%ecx),%ecx
movl $_C_LABEL(fusubail),PCB_ONFAULT(%ecx)
movzwl (%edx),%eax
movl $0,PCB_ONFAULT(%ecx)
@ -646,7 +646,7 @@ ENTRY(suswintr)
cmpl $VM_MAXUSER_ADDRESS-2,%edx
ja _C_LABEL(fusuaddrfault)
movl CPUVAR(CURLWP),%ecx
movl L_ADDR(%ecx),%ecx
movl L_PCB(%ecx),%ecx
movl $_C_LABEL(fusubail),PCB_ONFAULT(%ecx)
movl 8(%esp),%eax
movw %ax,(%edx)

View File

@ -1,4 +1,4 @@
# $NetBSD: genassym.cf,v 1.83 2009/11/25 14:28:50 rmind Exp $
# $NetBSD: genassym.cf,v 1.84 2009/11/27 03:23:10 rmind Exp $
#
# Copyright (c) 1998, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@ -173,7 +173,7 @@ define IOMAPSIZE IOMAPSIZE
define VM_MAXUSER_ADDRESS (int)VM_MAXUSER_ADDRESS
define L_ADDR offsetof(struct lwp, l_addr)
define L_PCB offsetof(struct lwp, l_addr)
define L_FLAG offsetof(struct lwp, l_flag)
define L_PROC offsetof(struct lwp, l_proc)
define L_MD_REGS offsetof(struct lwp, l_md.md_regs)

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.S,v 1.90 2009/11/25 14:28:50 rmind Exp $ */
/* $NetBSD: locore.S,v 1.91 2009/11/27 03:23:10 rmind Exp $ */
/*
* Copyright-o-rama!
@ -129,7 +129,7 @@
*/
#include <machine/asm.h>
__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.90 2009/11/25 14:28:50 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.91 2009/11/27 03:23:10 rmind Exp $");
#include "opt_compat_oldboot.h"
#include "opt_ddb.h"
@ -201,7 +201,7 @@ __KERNEL_RCSID(0, "$NetBSD: locore.S,v 1.90 2009/11/25 14:28:50 rmind Exp $");
.globl _C_LABEL(esym)
.globl _C_LABEL(eblob)
.globl _C_LABEL(atdevbase)
.globl _C_LABEL(proc0uarea),_C_LABEL(PDPpaddr)
.globl _C_LABEL(lwp0uarea),_C_LABEL(PDPpaddr)
.globl _C_LABEL(gdt)
.globl _C_LABEL(idt)
.globl _C_LABEL(lapic_tpr)
@ -232,7 +232,7 @@ _C_LABEL(lapic_tpr):
_C_LABEL(cpu): .long 0 # are we 80486, Pentium, or..
_C_LABEL(cpuid_level): .long 0
_C_LABEL(atdevbase): .long 0 # location of start of iomem in virtual
_C_LABEL(proc0uarea): .long 0
_C_LABEL(lwp0uarea): .long 0
_C_LABEL(PDPpaddr): .long 0 # paddr of PDP, for libkvm
_C_LABEL(tablesize): .long 0
@ -667,7 +667,7 @@ begin:
/* Set up bootstrap stack. */
leal (PROC0_STK_OFF+KERNBASE)(%esi),%eax
movl %eax,_C_LABEL(proc0uarea)
movl %eax,_C_LABEL(lwp0uarea)
leal (KSTACK_SIZE-FRAMESIZE)(%eax),%esp
movl %esi,(KSTACK_SIZE+PCB_CR3)(%eax) # pcb->pcb_cr3
xorl %ebp,%ebp # mark end of frames
@ -750,7 +750,7 @@ start:
* First avail returned by xen_pmap_bootstrap in %eax
*/
movl %eax, %esi;
movl %esi, _C_LABEL(proc0uarea)
movl %esi, _C_LABEL(lwp0uarea)
#define PROC0PDIR ((0) * PAGE_SIZE)
#define PROC0STACK ((1) * PAGE_SIZE)
@ -931,12 +931,12 @@ ENTRY(cpu_switchto)
jz 1f
/* Save old context. */
movl L_ADDR(%esi),%eax
movl L_PCB(%esi),%eax
movl %esp,PCB_ESP(%eax)
movl %ebp,PCB_EBP(%eax)
/* Switch to newlwp's stack. */
1: movl L_ADDR(%edi),%ebx
1: movl L_PCB(%edi),%ebx
movl PCB_EBP(%ebx),%ebp
movl PCB_ESP(%ebx),%esp

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.678 2009/11/26 00:19:18 matt Exp $ */
/* $NetBSD: machdep.c,v 1.679 2009/11/27 03:23:10 rmind 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.678 2009/11/26 00:19:18 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.679 2009/11/27 03:23:10 rmind Exp $");
#include "opt_beep.h"
#include "opt_compat_ibcs2.h"
@ -1055,7 +1055,7 @@ setregs(struct lwp *l, struct exec_package *pack, u_long stack)
union descriptor *gdt, *ldt;
union descriptor *pentium_idt;
extern vaddr_t proc0uarea;
extern vaddr_t lwp0uarea;
void
setgate(struct gate_descriptor *gd, void *func, int args, int type, int dpl,
@ -1312,8 +1312,8 @@ init386(paddr_t first_avail)
cpu_feature2 = cpu_info_primary.ci_feature2_flags;
cpu_feature_padlock = cpu_info_primary.ci_padlock_flags;
lwp0.l_addr = UAREA_TO_USER(proc0uarea);
pcb = (void *)lwp0.l_addr;
uvm_lwp_setuarea(&lwp0, lwp0uarea);
pcb = lwp_getpcb(&lwp0);
#ifdef XEN
/* not on Xen... */

View File

@ -1,4 +1,4 @@
/* $NetBSD: mptramp.S,v 1.18 2008/08/26 13:07:48 drochner Exp $ */
/* $NetBSD: mptramp.S,v 1.19 2009/11/27 03:23:10 rmind Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -76,7 +76,7 @@
*/
#include <machine/asm.h>
__KERNEL_RCSID(0, "$NetBSD: mptramp.S,v 1.18 2008/08/26 13:07:48 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: mptramp.S,v 1.19 2009/11/27 03:23:10 rmind Exp $");
#include "opt_mpbios.h" /* for MPDEBUG */
@ -224,7 +224,7 @@ mp_cont:
HALT(0x15)
movl CPU_INFO_IDLELWP(%ecx),%esi
movl L_ADDR(%esi),%esi
movl L_PCB(%esi),%esi
/* %esi now points at our PCB. */

View File

@ -1,4 +1,4 @@
/* $NetBSD: spl.S,v 1.34 2009/11/25 14:28:50 rmind Exp $ */
/* $NetBSD: spl.S,v 1.35 2009/11/27 03:23:10 rmind Exp $ */
/*
* Copyright (c) 1998, 2007, 2008 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <machine/asm.h>
__KERNEL_RCSID(0, "$NetBSD: spl.S,v 1.34 2009/11/25 14:28:50 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: spl.S,v 1.35 2009/11/27 03:23:10 rmind Exp $");
#include "opt_vm86.h"
#include "opt_ddb.h"
@ -379,8 +379,8 @@ IDTVEC(softintr)
movl CPUVAR(CURLWP),%esi
movl IS_LWP(%eax),%edi /* switch to handler LWP */
movl %edi,CPUVAR(CURLWP)
movl L_ADDR(%edi),%edx
movl L_ADDR(%esi),%ecx
movl L_PCB(%edi),%edx
movl L_PCB(%esi),%ecx
movl %esp,PCB_ESP(%ecx)
movl %ebp,PCB_EBP(%ecx)
movl PCB_ESP0(%edx),%esp /* onto new stack */
@ -390,7 +390,7 @@ IDTVEC(softintr)
call _C_LABEL(softint_dispatch)/* run handlers */
addl $8,%esp
cli
movl L_ADDR(%esi),%ecx
movl L_PCB(%esi),%ecx
movl PCB_ESP(%ecx),%esp
xchgl %esi,CPUVAR(CURLWP) /* must be globally visible */
popl %edi /* unwind switchframe */

View File

@ -1,4 +1,4 @@
/* $NetBSD: context.S,v 1.2 2009/07/20 04:41:36 kiyohara Exp $ */
/* $NetBSD: context.S,v 1.3 2009/11/27 03:23:10 rmind Exp $ */
/*
* Copyright (c) 2003 Marcel Moolenaar
@ -826,8 +826,8 @@ ENTRY(cpu_switchto, 3)
;;
}
{ .mii
add r2=L_ADDR,in0 // r2 = &oldlwp->l_addr
add r3=L_ADDR,in1 // r3 = &newlwp->l_addr
add r2=L_PCB,in0 // r2 = lwp_getpcb(&oldlwp)
add r3=L_PCB,in1 // r3 = lwp_getpcb(&newlwp)
mov loc1=rp // save rp (loc1 = rp)
;;
}
@ -836,7 +836,7 @@ ENTRY(cpu_switchto, 3)
* Switch to new context, if p6 == true.
* We assum to return to restorectx_return_here for swapped context.
*/
(p6) ld8 out0=[r3] // if (p6) out0 = newlwp->l_addr
(p6) ld8 out0=[r3] // if (p6) out0 = pcb of &newlwp
xchg8 r9=[r14],in1 // ci->ci_curlwp = newlwp
(p6) br.call.sptk.many rp=restorectx // if (p6) restorectx(out0)
;;

View File

@ -1,4 +1,4 @@
# $NetBSD: genassym.cf,v 1.6 2008/09/20 18:29:05 tsutsui Exp $
# $NetBSD: genassym.cf,v 1.7 2009/11/27 03:23:10 rmind Exp $
#
# Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -125,7 +125,7 @@ define ENAMETOOLONG ENAMETOOLONG
define EFAULT EFAULT
# Important offsets into the lwp and proc structs & associated constants
define L_ADDR offsetof(struct lwp, l_addr)
define L_PCB offsetof(struct lwp, l_addr)
define L_PRIORITY offsetof(struct lwp, l_priority)
define L_STAT offsetof(struct lwp, l_stat)
define L_WCHAN offsetof(struct lwp, l_wchan)
@ -166,7 +166,5 @@ define UPAGES UPAGES
define FRAME_SYSCALL FRAME_SYSCALL
#XXX: LWP_PCB should be lwp->l_addr->u_pcb
define PC_CURLWP offsetof(struct cpu_info, ci_curlwp)
define LWP_PCB offsetof(struct lwp, l_addr)
define PCB_ONFAULT offsetof(struct pcb, pcb_onfault)

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.19 2009/11/26 00:19:18 matt Exp $ */
/* $NetBSD: machdep.c,v 1.20 2009/11/27 03:23:10 rmind Exp $ */
/*-
* Copyright (c) 2003,2004 Marcel Moolenaar
@ -100,7 +100,6 @@
#include <sys/proc.h>
#include <sys/reboot.h>
#include <sys/systm.h>
#include <sys/user.h>
#include <machine/ia64_cpu.h>
#include <machine/pal.h>
@ -440,6 +439,7 @@ ia64_init(void)
paddr_t kernstartpfn, kernendpfn, pfn0, pfn1;
struct pcb *pcb0;
struct efi_md *md;
vaddr_t v;
/* NO OUTPUT ALLOWED UNTIL FURTHER NOTICE */
@ -660,13 +660,12 @@ ia64_init(void)
/*
* Init mapping for u page(s) for proc 0
*/
lwp0.l_addr = (struct user *)uvm_pageboot_alloc(UPAGES * PAGE_SIZE);
pcb0 = &lwp0.l_addr->u_pcb;
v = uvm_pageboot_alloc(UPAGES * PAGE_SIZE);
uvm_lwp_setuarea(&lwp0, v);
/*
* 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.
*/
/*
@ -683,29 +682,23 @@ ia64_init(void)
* --------------------------->
* Higher Addresses
*
* PCB: struct user; TF: struct trapframe;
* PCB: struct pcb; TF: struct trapframe;
*/
lwp0.l_md.md_tf = (struct trapframe *)((vaddr_t)lwp0.l_addr +
USPACE - sizeof(struct trapframe));
lwp0.l_md.md_tf = (struct trapframe *)(v + USPACE) - 1;
pcb0->pcb_special.sp =
(vaddr_t)lwp0.l_md.md_tf - 16; /* 16 bytes is the
* scratch area defined
* by the ia64 ABI
*/
pcb0 = lwp_getpcb(&lwp0);
pcb0->pcb_special.bspstore = (vaddr_t) (lwp0.l_addr + 1);
/* 16 bytes is the scratch area defined by the ia64 ABI. */
pcb0->pcb_special.sp = (vaddr_t)lwp0.l_md.md_tf - 16;
pcb0->pcb_special.bspstore = v + 1;
mutex_init(&pcb0.pcb_fpcpu_slock, MUTEX_DEFAULT, 0);
/*
* Setup global data for the bootstrap cpu.
*/
ci = curcpu();
/* ar.k4 contains the cpu_info pointer to the
@ -730,7 +723,6 @@ ia64_init(void)
/* Indicate that proc0 has a CPU. */
lwp0.l_cpu = ci;
ia64_set_tpr(0);
ia64_srlz_d();
@ -739,7 +731,7 @@ ia64_init(void)
* sane) context as the initial context for new threads that are
* forked from us.
*/
if (savectx(lwp_getpcb(&lwp0)))
if (savectx(pcb0))
panic("savectx failed");
/*
@ -776,9 +768,10 @@ setregs(register struct lwp *l, struct exec_package *pack, u_long stack)
{
struct trapframe *tf;
uint64_t *ksttop, *kst, regstkp;
vaddr_t uv = uvm_lwp_getuarea(l);
tf = l->l_md.md_tf;
regstkp = (uint64_t) (l->l_addr) + sizeof(struct user);
regstkp = uv + sizeof(struct pcb);
ksttop =
(uint64_t*)(regstkp + tf->tf_special.ndirty +

View File

@ -1,4 +1,4 @@
/* $NetBSD: support.S,v 1.4 2009/07/20 04:41:37 kiyohara Exp $ */
/* $NetBSD: support.S,v 1.5 2009/11/27 03:23:10 rmind Exp $ */
/*-
* Copyright (c) 1998 Doug Rabson
@ -213,7 +213,7 @@ ENTRY(casuptr, 3)
;;
}
{ .mlx
add r15=LWP_PCB,r15
add r15=L_PCB,r15
movl r14=fusufault
;;
}
@ -267,7 +267,7 @@ ENTRY(subyte, 2)
;;
}
{ .mlx
add r15=LWP_PCB,r15
add r15=L_PCB,r15
movl r14=fusufault
;;
}
@ -313,7 +313,7 @@ ENTRY(suword16, 2)
;;
}
{ .mlx
add r15=LWP_PCB,r15
add r15=L_PCB,r15
movl r14=fusufault
;;
}
@ -359,7 +359,7 @@ ENTRY(suword32, 2)
;;
}
{ .mlx
add r15=LWP_PCB,r15
add r15=L_PCB,r15
movl r14=fusufault
;;
}
@ -406,7 +406,7 @@ XENTRY(suword)
;;
}
{ .mlx
add r15=LWP_PCB,r15
add r15=L_PCB,r15
movl r14=fusufault
;;
}
@ -460,7 +460,7 @@ ENTRY(fubyte, 1)
;;
}
{ .mlx
add r15=LWP_PCB,r15
add r15=L_PCB,r15
movl r14=fusufault
;;
}
@ -506,7 +506,7 @@ ENTRY(fuword16, 2)
;;
}
{ .mlx
add r15=LWP_PCB,r15
add r15=L_PCB,r15
movl r14=fusufault
;;
}
@ -552,7 +552,7 @@ ENTRY(fuword32, 2)
;;
}
{ .mlx
add r15=LWP_PCB,r15
add r15=L_PCB,r15
movl r14=fusufault
;;
}
@ -599,7 +599,7 @@ XENTRY(fuword)
;;
}
{ .mlx
add r15=LWP_PCB,r15
add r15=L_PCB,r15
movl r14=fusufault
;;
}
@ -714,7 +714,7 @@ ENTRY(copyinstr, 4)
;;
ld8 r15=[r15]
;;
add r15=LWP_PCB,r15 // find pcb
add r15=L_PCB,r15 // find pcb
;;
ld8 r15=[r15]
;;
@ -753,7 +753,7 @@ ENTRY(copyoutstr, 4)
;;
ld8 r15=[r15]
;;
add r15=LWP_PCB,r15 // find pcb
add r15=L_PCB,r15 // find pcb
;;
ld8 r15=[r15]
;;
@ -866,7 +866,7 @@ ENTRY(kcopy, 3)
;;
ld8 r15=[r15]
;;
add r15=LWP_PCB,r15 // find pcb
add r15=L_PCB,r15 // find pcb
;;
ld8 r15=[r15]
;;
@ -904,7 +904,7 @@ ENTRY(copyin, 3)
;;
ld8 r15=[r15]
;;
add r15=LWP_PCB,r15 // find pcb
add r15=L_PCB,r15 // find pcb
;;
ld8 r15=[r15]
;;
@ -942,7 +942,7 @@ ENTRY(copyout, 3)
;;
ld8 r15=[r15]
;;
add r15=LWP_PCB,r15 // find pcb
add r15=L_PCB,r15 // find pcb
;;
ld8 r15=[r15]
;;
@ -964,7 +964,7 @@ END(copyout)
ENTRY(copyerr, 0)
add r14=PC_CURLWP,r13 ;; // find curthread
ld8 r14=[r14] ;;
add r14=LWP_PCB,r14 ;; // curthread->td_addr
add r14=L_PCB,r14 ;; // curthread->td_addr
ld8 r14=[r14] ;;
add r14=PCB_ONFAULT,r14 ;; // &curthread->td_pcb->pcb_onfault
st8 [r14]=r0 // reset fault handler

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.13 2008/11/11 06:46:42 dyoung Exp $ */
/* $NetBSD: machdep.c,v 1.14 2009/11/27 03:23:10 rmind Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.13 2008/11/11 06:46:42 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.14 2009/11/27 03:23:10 rmind Exp $");
#include "opt_compat_netbsd.h"
@ -52,7 +52,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.13 2008/11/11 06:46:42 dyoung Exp $");
#include <sys/syscallargs.h>
#include <sys/syslog.h>
#include <sys/systm.h>
#include <sys/user.h>
#include <uvm/uvm_extern.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: iyonix_machdep.c,v 1.14 2009/11/26 00:19:18 matt Exp $ */
/* $NetBSD: iyonix_machdep.c,v 1.15 2009/11/27 03:23:10 rmind 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.14 2009/11/26 00:19:18 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: iyonix_machdep.c,v 1.15 2009/11/27 03:23:10 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -747,7 +747,7 @@ initarm(void *arg)
* Moved from cpu_startup() as data_abort_handler() references
* this during uvm init
*/
lwp0.l_addr = (struct user *)kernelstack.pv_va;
uvm_lwp_setuarea(&lwp0, kernelstack.pv_va);
#ifdef VERBOSE_INIT_ARM
printf("done!\n");

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.12 2009/02/13 22:41:02 apb Exp $ */
/* $NetBSD: machdep.c,v 1.13 2009/11/27 03:23:10 rmind Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.12 2009/02/13 22:41:02 apb Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.13 2009/11/27 03:23:10 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -81,7 +81,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.12 2009/02/13 22:41:02 apb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/user.h>
#include <sys/mount.h>
#include <sys/reboot.h>
#include <sys/sysctl.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: pmap_bootstrap.c,v 1.79 2009/11/26 00:19:18 matt Exp $ */
/* $NetBSD: pmap_bootstrap.c,v 1.80 2009/11/27 03:23:10 rmind Exp $ */
/*
* Copyright (c) 1991, 1993
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.79 2009/11/26 00:19:18 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: pmap_bootstrap.c,v 1.80 2009/11/27 03:23:10 rmind Exp $");
#include "opt_ddb.h"
#include "opt_kgdb.h"
@ -413,7 +413,7 @@ pmap_bootstrap(paddr_t nextpa, paddr_t firstpa)
/*
* Store the u-area address
*/
lwp0.l_addr = PA2VA(l0upa, struct user *);
uvm_lwp_setuarea(&lwp0, PA2VA(l0upa, vaddr_t));
/*
* VM data structures are now initialized, set up data for

View File

@ -1,4 +1,4 @@
/* $NetBSD: esp.c,v 1.28 2009/09/26 15:49:45 tsutsui Exp $ */
/* $NetBSD: esp.c,v 1.29 2009/11/27 03:23:10 rmind Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@ -70,7 +70,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: esp.c,v 1.28 2009/09/26 15:49:45 tsutsui Exp $");
__KERNEL_RCSID(0, "$NetBSD: esp.c,v 1.29 2009/11/27 03:23:10 rmind Exp $");
#include <sys/types.h>
#include <sys/param.h>
@ -81,7 +81,6 @@ __KERNEL_RCSID(0, "$NetBSD: esp.c,v 1.28 2009/09/26 15:49:45 tsutsui Exp $");
#include <sys/device.h>
#include <sys/buf.h>
#include <sys/proc.h>
#include <sys/user.h>
#include <sys/queue.h>
#include <sys/malloc.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.c,v 1.51 2009/03/18 10:22:32 cegger Exp $ */
/* $NetBSD: cpu.c,v 1.52 2009/11/27 03:23:11 rmind Exp $ */
/*-
* Copyright (c) 2001 Tsubai Masanari.
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.51 2009/03/18 10:22:32 cegger Exp $");
__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.52 2009/11/27 03:23:11 rmind Exp $");
#include "opt_ppcparam.h"
#include "opt_multiprocessor.h"
@ -45,7 +45,6 @@ __KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.51 2009/03/18 10:22:32 cegger Exp $");
#include <sys/device.h>
#include <sys/types.h>
#include <sys/lwp.h>
#include <sys/user.h>
#include <uvm/uvm_extern.h>
#include <dev/ofw/openfirm.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.152 2008/11/11 06:46:43 dyoung Exp $ */
/* $NetBSD: machdep.c,v 1.153 2009/11/27 03:23:11 rmind Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.152 2008/11/11 06:46:43 dyoung Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.153 2009/11/27 03:23:11 rmind Exp $");
#include "opt_compat_netbsd.h"
#include "opt_ddb.h"
@ -56,7 +56,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.152 2008/11/11 06:46:43 dyoung Exp $")
#include <sys/syslog.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/user.h>
#include <sys/boot_flag.h>
#include <sys/ksyms.h>
#include <sys/conf.h>

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu.h,v 1.92 2009/11/21 17:40:27 rmind Exp $ */
/* $NetBSD: cpu.h,v 1.93 2009/11/27 03:23:11 rmind Exp $ */
/*-
* Copyright (c) 1992, 1993
@ -341,7 +341,7 @@ do { \
* Misc prototypes and variable declarations.
*/
struct lwp;
struct user;
struct pcb;
extern struct segtab *segbase; /* current segtab base */
@ -351,7 +351,7 @@ int kdbpeek(vaddr_t);
/* mips_machdep.c */
void dumpsys(void);
int savectx(struct user *);
int savectx(struct pcb *);
void mips_init_msgbuf(void);
void savefpregs(struct lwp *);
void loadfpregs(struct lwp *);

View File

@ -1,4 +1,4 @@
/* $NetBSD: copy.S,v 1.5 2007/10/17 19:55:37 garbled Exp $ */
/* $NetBSD: copy.S,v 1.6 2009/11/27 03:23:11 rmind Exp $ */
/*
* Copyright (c) 1992, 1993
@ -100,7 +100,7 @@ LEAF(copyinstr)
lw v1, L_ADDR(MIPS_CURLWP)
la v0, _C_LABEL(copystrerr)
blt a0, zero, _C_LABEL(copystrerr)
sw v0, U_PCB_ONFAULT(v1)
sw v0, PCB_ONFAULT(v1)
move t0, a2
beq a2, zero, 4f
1:
@ -119,7 +119,7 @@ LEAF(copyinstr)
sw a2, 0(a3)
3:
j ra # v0 is 0 or ENAMETOOLONG
sw zero, U_PCB_ONFAULT(v1)
sw zero, PCB_ONFAULT(v1)
END(copyinstr)
/*
@ -133,7 +133,7 @@ LEAF(copyoutstr)
lw v1, L_ADDR(MIPS_CURLWP)
la v0, _C_LABEL(copystrerr)
blt a1, zero, _C_LABEL(copystrerr)
sw v0, U_PCB_ONFAULT(v1)
sw v0, PCB_ONFAULT(v1)
move t0, a2
beq a2, zero, 4f
1:
@ -152,11 +152,11 @@ LEAF(copyoutstr)
sw a2, 0(a3)
3:
j ra # v0 is 0 or ENAMETOOLONG
sw zero, U_PCB_ONFAULT(v1)
sw zero, PCB_ONFAULT(v1)
END(copyoutstr)
LEAF(copystrerr)
sw zero, U_PCB_ONFAULT(v1)
sw zero, PCB_ONFAULT(v1)
j ra
li v0, EFAULT # return EFAULT
END(copystrerr)
@ -182,13 +182,13 @@ NESTED(kcopy, 48, ra)
move a1, v0
lw v1, L_ADDR(MIPS_CURLWP) # set up fault handler
la v0, _C_LABEL(kcopyerr)
lw s0, U_PCB_ONFAULT(v1) # save old handler
lw s0, PCB_ONFAULT(v1) # save old handler
jal memcpy
sw v0, U_PCB_ONFAULT(v1)
sw v0, PCB_ONFAULT(v1)
lw v1, L_ADDR(MIPS_CURLWP) # restore the old handler
lw ra, 44(sp) # restore ra
sw s0, U_PCB_ONFAULT(v1)
sw s0, PCB_ONFAULT(v1)
lw s0, 32(sp) # restore s0
addu sp, sp, 48 # kill stack frame
j ra
@ -198,7 +198,7 @@ END(kcopy)
LEAF(kcopyerr)
lw v1, L_ADDR(MIPS_CURLWP) # restore the old handler
lw ra, 44(sp) # restore ra
sw s0, U_PCB_ONFAULT(v1)
sw s0, PCB_ONFAULT(v1)
lw s0, 32(sp) # restore s0
addu sp, sp, 48 # kill stack frame
j ra
@ -222,12 +222,12 @@ NESTED(copyin, CALLFRAME_SIZ, ra)
lw v1, L_ADDR(MIPS_CURLWP)
la v0, _C_LABEL(copyerr)
jal memcpy
sw v0, U_PCB_ONFAULT(v1)
sw v0, PCB_ONFAULT(v1)
lw v1, L_ADDR(MIPS_CURLWP)
lw ra, CALLFRAME_RA(sp)
addu sp, sp, CALLFRAME_SIZ
sw zero, U_PCB_ONFAULT(v1)
sw zero, PCB_ONFAULT(v1)
j ra
move v0, zero
END(copyin)
@ -249,12 +249,12 @@ NESTED(copyout, CALLFRAME_SIZ, ra)
lw v1, L_ADDR(MIPS_CURLWP)
la v0, _C_LABEL(copyerr)
jal memcpy
sw v0, U_PCB_ONFAULT(v1)
sw v0, PCB_ONFAULT(v1)
lw v1, L_ADDR(MIPS_CURLWP)
lw ra, CALLFRAME_RA(sp)
addu sp, sp, CALLFRAME_SIZ
sw zero, U_PCB_ONFAULT(v1)
sw zero, PCB_ONFAULT(v1)
j ra
move v0, zero
END(copyout)
@ -263,7 +263,7 @@ LEAF(copyerr)
lw v1, L_ADDR(MIPS_CURLWP)
lw ra, CALLFRAME_RA(sp)
addu sp, sp, CALLFRAME_SIZ
sw zero, U_PCB_ONFAULT(v1)
sw zero, PCB_ONFAULT(v1)
j ra
li v0, EFAULT # return EFAULT
END(copyerr)
@ -276,12 +276,12 @@ END(copyerr)
LEAF(fuswintr)
lw v1, L_ADDR(MIPS_CURLWP)
la v0, _C_LABEL(fswintrberr)
lw a2, U_PCB_ONFAULT(v1)
lw a2, PCB_ONFAULT(v1)
blt a0, zero, _C_LABEL(fswintrberr)
sw v0, U_PCB_ONFAULT(v1)
sw v0, PCB_ONFAULT(v1)
lhu v0, 0(a0) # fetch short
j ra
sw a2, U_PCB_ONFAULT(v1)
sw a2, PCB_ONFAULT(v1)
END(fuswintr)
/*
@ -292,11 +292,11 @@ END(fuswintr)
LEAF(suswintr)
lw v1, L_ADDR(MIPS_CURLWP)
la v0, _C_LABEL(fswintrberr)
lw a2, U_PCB_ONFAULT(v1)
lw a2, PCB_ONFAULT(v1)
blt a0, zero, _C_LABEL(fswintrberr)
sw v0, U_PCB_ONFAULT(v1)
sw v0, PCB_ONFAULT(v1)
sh a1, 0(a0) # store short
sw a2, U_PCB_ONFAULT(v1)
sw a2, PCB_ONFAULT(v1)
j ra
move v0, zero
END(suswintr)
@ -310,10 +310,10 @@ XLEAF(fuiword)
lw v1, L_ADDR(MIPS_CURLWP)
la v0, _C_LABEL(fswberr)
blt a0, zero, _C_LABEL(fswberr)
sw v0, U_PCB_ONFAULT(v1)
sw v0, PCB_ONFAULT(v1)
lw v0, 0(a0) # fetch word
j ra
sw zero, U_PCB_ONFAULT(v1)
sw zero, PCB_ONFAULT(v1)
END(fuword)
/*
@ -325,10 +325,10 @@ XLEAF(fuisword)
lw v1, L_ADDR(MIPS_CURLWP)
la v0, _C_LABEL(fswberr)
blt a0, zero, _C_LABEL(fswberr)
sw v0, U_PCB_ONFAULT(v1)
sw v0, PCB_ONFAULT(v1)
lhu v0, 0(a0) # fetch short
j ra
sw zero, U_PCB_ONFAULT(v1)
sw zero, PCB_ONFAULT(v1)
END(fusword)
/*
@ -340,10 +340,10 @@ XLEAF(fuibyte)
lw v1, L_ADDR(MIPS_CURLWP)
la v0, _C_LABEL(fswberr)
blt a0, zero, _C_LABEL(fswberr)
sw v0, U_PCB_ONFAULT(v1)
sw v0, PCB_ONFAULT(v1)
lbu v0, 0(a0) # fetch byte
j ra
sw zero, U_PCB_ONFAULT(v1)
sw zero, PCB_ONFAULT(v1)
END(fubyte)
/*
@ -354,9 +354,9 @@ LEAF(suword)
lw v1, L_ADDR(MIPS_CURLWP)
la v0, _C_LABEL(fswberr)
blt a0, zero, _C_LABEL(fswberr)
sw v0, U_PCB_ONFAULT(v1)
sw v0, PCB_ONFAULT(v1)
sw a1, 0(a0) # store word
sw zero, U_PCB_ONFAULT(v1)
sw zero, PCB_ONFAULT(v1)
j ra
move v0, zero
END(suword)
@ -369,9 +369,9 @@ LEAF(suiword)
lw v1, L_ADDR(MIPS_CURLWP)
la v0, _C_LABEL(fswberr)
blt a0, zero, _C_LABEL(fswberr)
sw v0, U_PCB_ONFAULT(v1)
sw v0, PCB_ONFAULT(v1)
sw a1, 0(a0) # store word
sw zero, U_PCB_ONFAULT(v1)
sw zero, PCB_ONFAULT(v1)
move v0, zero
lw v1, _C_LABEL(mips_cache_ops) + MIPSX_FLUSHICACHE
j v1 # NOTE: must not clobber v0!
@ -387,9 +387,9 @@ XLEAF(suisword)
lw v1, L_ADDR(MIPS_CURLWP)
la v0, _C_LABEL(fswberr)
blt a0, zero, _C_LABEL(fswberr)
sw v0, U_PCB_ONFAULT(v1)
sw v0, PCB_ONFAULT(v1)
sh a1, 0(a0) # store short
sw zero, U_PCB_ONFAULT(v1)
sw zero, PCB_ONFAULT(v1)
j ra
move v0, zero
END(susword)
@ -403,9 +403,9 @@ XLEAF(suibyte)
lw v1, L_ADDR(MIPS_CURLWP)
la v0, _C_LABEL(fswberr)
blt a0, zero, _C_LABEL(fswberr)
sw v0, U_PCB_ONFAULT(v1)
sw v0, PCB_ONFAULT(v1)
sb a1, 0(a0) # store byte
sw zero, U_PCB_ONFAULT(v1)
sw zero, PCB_ONFAULT(v1)
j ra
move v0, zero
END(subyte)
@ -419,7 +419,7 @@ LEAF(badaddr)
lw v1, L_ADDR(MIPS_CURLWP)
la v0, _C_LABEL(baderr)
bne a1, 1, 2f
sw v0, U_PCB_ONFAULT(v1)
sw v0, PCB_ONFAULT(v1)
b 5f
lbu v0, (a0)
2:
@ -430,7 +430,7 @@ LEAF(badaddr)
4:
lw v0, (a0)
5:
sw zero, U_PCB_ONFAULT(v1)
sw zero, PCB_ONFAULT(v1)
j ra
move v0, zero # made it w/o errors
END(badaddr)
@ -443,14 +443,14 @@ END(badaddr)
*/
LEAF(fswintrberr)
nop
sw a2, U_PCB_ONFAULT(v1)
sw a2, PCB_ONFAULT(v1)
j ra
li v0, -1
END(fswintrberr)
LEAF(fswberr)
XLEAF(baderr)
sw zero, U_PCB_ONFAULT(v1)
sw zero, PCB_ONFAULT(v1)
j ra
li v0, -1
END(fswberr)

View File

@ -1,4 +1,4 @@
/* $NetBSD: fp.S,v 1.34 2009/08/18 21:28:07 matt Exp $ */
/* $NetBSD: fp.S,v 1.35 2009/11/27 03:23:11 rmind Exp $ */
/*
* Copyright (c) 1992, 1993
@ -117,7 +117,7 @@ NESTED(MachEmulateFP, CALLFRAME_SIZ, ra)
#ifdef SOFTFLOAT
lw t0, L_ADDR(MIPS_CURLWP) # get pcb of current process
lw a3, fmt_tbl(v0) # switch on FUNC & FMT
lw a2, U_PCB_FPREGS+FRAME_FSR(t0)
lw a2, PCB_FPREGS+FRAME_FSR(t0)
#else
cfc1 a2, MIPS_FPU_CSR # get exception register
lw a3, fmt_tbl(v0) # switch on FUNC & FMT
@ -497,7 +497,7 @@ mfromc1:
andi t1, t1, 0x007C
addu t0, t0, t1
lw v0, U_PCB_FPREGS+FRAME_FP0(t0)
lw v0, PCB_FPREGS+FRAME_FP0(t0)
srl t0, a0, 16-SZREG_SHFT
andi t0, t0, SZREG_MASK
@ -523,7 +523,7 @@ mtoc1:
andi t1, t1, 0x007C
addu t0, t0, t1
sw v0, U_PCB_FPREGS+FRAME_FP0(t0)
sw v0, PCB_FPREGS+FRAME_FP0(t0)
b done
@ -535,7 +535,7 @@ cfromc1:
move v0, zero
bne t1, t2, cfinvalid
lw v0, U_PCB_FPREGS+FRAME_FSR(t0)
lw v0, PCB_FPREGS+FRAME_FSR(t0)
cfinvalid:
@ -567,7 +567,7 @@ ctoc1:
REG_EPILOGUE
lw t0, L_ADDR(MIPS_CURLWP) # get pcb of current process
#nop
sw v0, U_PCB_FPREGS+FRAME_FSR(t0)
sw v0, PCB_FPREGS+FRAME_FSR(t0)
b done
@ -1124,7 +1124,7 @@ div_s:
#ifdef SOFTFLOAT
lw t1, L_ADDR(MIPS_CURLWP) # get pcb of current process
#nop
sw a2, U_PCB_FPREGS+FRAME_FSR(t1)
sw a2, PCB_FPREGS+FRAME_FSR(t1)
#else
ctc1 a2, MIPS_FPU_CSR # save exceptions
#endif
@ -1204,7 +1204,7 @@ div_d:
#ifdef SOFTFLOAT
lw t1, L_ADDR(MIPS_CURLWP) # get pcb of current process
#nop
sw a2, U_PCB_FPREGS+FRAME_FSR(t1)
sw a2, PCB_FPREGS+FRAME_FSR(t1)
#else
ctc1 a2, MIPS_FPU_CSR # save exceptions
#endif
@ -1820,7 +1820,7 @@ inexact_w:
#ifdef SOFTFLOAT
lw v0, L_ADDR(MIPS_CURLWP) # get pcb of current process
#nop
sw a2, U_PCB_FPREGS+FRAME_FSR(v0)
sw a2, PCB_FPREGS+FRAME_FSR(v0)
#else
ctc1 a2, MIPS_FPU_CSR # save exceptions
#endif
@ -1932,7 +1932,7 @@ set_cond:
#ifdef SOFTFLOAT
lw v0, L_ADDR(MIPS_CURLWP) # get pcb of current process
#nop
sw a2, U_PCB_FPREGS+FRAME_FSR(v0)
sw a2, PCB_FPREGS+FRAME_FSR(v0)
#else
ctc1 a2, MIPS_FPU_CSR # save condition bit
#endif
@ -1955,7 +1955,7 @@ unordered:
#ifdef SOFTFLOAT
lw v0, L_ADDR(MIPS_CURLWP) # get pcb of current process
#nop
sw a2, U_PCB_FPREGS+FRAME_FSR(v0)
sw a2, PCB_FPREGS+FRAME_FSR(v0)
#else
ctc1 a2, MIPS_FPU_CSR # save condition bit
#endif
@ -2072,7 +2072,7 @@ inexact_nobias_s:
#ifdef SOFTFLOAT
lw v0, L_ADDR(MIPS_CURLWP) # get pcb of current process
#nop
sw a2, U_PCB_FPREGS+FRAME_FSR(v0)
sw a2, PCB_FPREGS+FRAME_FSR(v0)
#else
ctc1 a2, MIPS_FPU_CSR # save exceptions
#endif
@ -2193,7 +2193,7 @@ underflow_s:
#ifdef SOFTFLOAT
lw v0, L_ADDR(MIPS_CURLWP) # get pcb of current process
#nop
sw a2, U_PCB_FPREGS+FRAME_FSR(v0)
sw a2, PCB_FPREGS+FRAME_FSR(v0)
#else
ctc1 a2, MIPS_FPU_CSR # save exceptions
#endif
@ -2334,7 +2334,7 @@ inexact_nobias_d:
#ifdef SOFTFLOAT
lw v0, L_ADDR(MIPS_CURLWP) # get pcb of current process
#nop
sw a2, U_PCB_FPREGS+FRAME_FSR(v0)
sw a2, PCB_FPREGS+FRAME_FSR(v0)
#else
ctc1 a2, MIPS_FPU_CSR # save exceptions
#endif
@ -2477,7 +2477,7 @@ underflow_d:
#ifdef SOFTFLOAT
lw v0, L_ADDR(MIPS_CURLWP) # get pcb of current process
#nop
sw a2, U_PCB_FPREGS+FRAME_FSR(v0)
sw a2, PCB_FPREGS+FRAME_FSR(v0)
#else
ctc1 a2, MIPS_FPU_CSR # save exceptions
#endif
@ -2494,7 +2494,7 @@ invalid_s: # trap invalid operation
#ifdef SOFTFLOAT
lw v0, L_ADDR(MIPS_CURLWP) # get pcb of current process
#nop
sw a2, U_PCB_FPREGS+FRAME_FSR(v0)
sw a2, PCB_FPREGS+FRAME_FSR(v0)
#else
ctc1 a2, MIPS_FPU_CSR # save exceptions
#endif
@ -2515,7 +2515,7 @@ invalid_d: # trap invalid operation
#ifdef SOFTFLOAT
lw v0, L_ADDR(MIPS_CURLWP) # get pcb of current process
#nop
sw a2, U_PCB_FPREGS+FRAME_FSR(v0)
sw a2, PCB_FPREGS+FRAME_FSR(v0)
#else
ctc1 a2, MIPS_FPU_CSR # save exceptions
#endif
@ -2537,7 +2537,7 @@ invalid_w: # trap invalid operation
#ifdef SOFTFLOAT
lw v0, L_ADDR(MIPS_CURLWP) # get pcb of current process
#nop
sw a2, U_PCB_FPREGS+FRAME_FSR(v0)
sw a2, PCB_FPREGS+FRAME_FSR(v0)
#else
ctc1 a2, MIPS_FPU_CSR # save exceptions
#endif
@ -2555,7 +2555,7 @@ fpe_trap:
#ifdef SOFTFLOAT
lw v0, L_ADDR(MIPS_CURLWP) # get pcb of current process
#nop
sw a2, U_PCB_FPREGS+FRAME_FSR(v0)
sw a2, PCB_FPREGS+FRAME_FSR(v0)
#else
/*
* ctc1 with fpe bits set causes FPE in kernel mode panic on 5231.
@ -2568,7 +2568,7 @@ fpe_trap:
lw v0, L_ADDR(MIPS_CURLWP) # get pcb of current process
#nop
sw a2, U_PCB_FPREGS+FRAME_FSR(v0)
sw a2, PCB_FPREGS+FRAME_FSR(v0)
#endif
lw a1, CALLFRAME_SIZ + 4(sp) # frame
lw a2, CALLFRAME_SIZ + 8(sp) # cause
@ -2583,7 +2583,7 @@ ill:
#ifdef SOFTFLOAT
lw v0, L_ADDR(MIPS_CURLWP) # get pcb of current process
#nop
sw a2, U_PCB_FPREGS+FRAME_FSR(v0)
sw a2, PCB_FPREGS+FRAME_FSR(v0)
#else
ctc1 a2, MIPS_FPU_CSR # save exceptions
#endif
@ -2671,7 +2671,7 @@ STATIC_LEAF(get_fs_int)
andi t2, t2, 0x0078 # Even regs only
addu t0, t0, t2
lw t2, U_PCB_FPREGS+FRAME_FP0(t0)
lw t2, PCB_FPREGS+FRAME_FP0(t0)
srl t0, t2, 31 # init the sign bit
bge t2, zero, 1f
@ -2784,7 +2784,7 @@ STATIC_LEAF(get_ft_fs_s)
andi ta0, ta0, 0x0078 # Even regs only
addu ta1, ta1, ta0
lw ta0, U_PCB_FPREGS+FRAME_FP0(ta1)
lw ta0, PCB_FPREGS+FRAME_FP0(ta1)
srl ta1, ta0, 23 # get exponent
and ta1, ta1, 0xFF
@ -2901,7 +2901,7 @@ STATIC_XLEAF(get_fs_s)
andi t0, t0, 0x0078 # Even regs only
addu t1, t1, t0
lw t0, U_PCB_FPREGS+FRAME_FP0(t1)
lw t0, PCB_FPREGS+FRAME_FP0(t1)
srl t1, t0, 23 # get exponent
and t1, t1, 0xFF
@ -3024,8 +3024,8 @@ STATIC_LEAF(get_ft_fs_d)
andi ta3, ta3, 0x0078 # Even regs only
addu ta0, ta0, ta3
lw ta3, U_PCB_FPREGS+FRAME_FP0(ta0)
lw ta0, U_PCB_FPREGS+FRAME_FP0+4(ta0)
lw ta3, PCB_FPREGS+FRAME_FP0(ta0)
lw ta0, PCB_FPREGS+FRAME_FP0+4(ta0)
srl ta1, ta0, 20 # get exponent
and ta1, ta1, 0x7FF
@ -3159,8 +3159,8 @@ STATIC_XLEAF(get_fs_d)
andi t3, t3, 0x0078 # Even regs only
addu t0, t0, t3
lw t3, U_PCB_FPREGS+FRAME_FP0(t0)
lw t0, U_PCB_FPREGS+FRAME_FP0+4(t0)
lw t3, PCB_FPREGS+FRAME_FP0(t0)
lw t0, PCB_FPREGS+FRAME_FP0+4(t0)
srl t1, t0, 20 # get exponent
and t1, t1, 0x7FF
@ -3297,7 +3297,7 @@ STATIC_LEAF(get_cmp_s)
andi t1, t1, 0x0078 # Even regs only
addu t0, ta2, t1
lw t0, U_PCB_FPREGS+FRAME_FP0(t0)
lw t0, PCB_FPREGS+FRAME_FP0(t0)
srl t1, t0, 23 # get exponent
and t1, t1, 0xFF
@ -3308,7 +3308,7 @@ STATIC_LEAF(get_cmp_s)
andi ta0, ta0, 0x0078 # Even regs only
addu ta2, ta2, ta0
lw ta0, U_PCB_FPREGS+FRAME_FP0(ta2)
lw ta0, PCB_FPREGS+FRAME_FP0(ta2)
srl ta1, ta0, 23 # get exponent
and ta1, ta1, 0xFF
@ -3501,8 +3501,8 @@ STATIC_LEAF(get_cmp_d)
andi t1, t1, 0x0078 # Even regs only
addu t0, ta2, t1
lw t3, U_PCB_FPREGS+FRAME_FP0(t0)
lw t0, U_PCB_FPREGS+FRAME_FP0+4(t0)
lw t3, PCB_FPREGS+FRAME_FP0(t0)
lw t0, PCB_FPREGS+FRAME_FP0+4(t0)
srl t1, t0, 20 # get exponent
and t1, t1, 0x7FF
@ -3513,8 +3513,8 @@ STATIC_LEAF(get_cmp_d)
andi ta0, ta0, 0x0078 # Even regs only
addu ta2, ta2, ta0
lw ta3, U_PCB_FPREGS+FRAME_FP0(ta2)
lw ta0, U_PCB_FPREGS+FRAME_FP0+4(ta2)
lw ta3, PCB_FPREGS+FRAME_FP0(ta2)
lw ta0, PCB_FPREGS+FRAME_FP0+4(ta2)
srl ta1, ta0, 20 # get exponent
and ta1, ta1, 0x7FF
@ -3748,7 +3748,7 @@ STATIC_XLEAF(set_fd_word)
andi t1, t1, 0x0078 # Even regs only
addu t0, t0, t1
sw t2, U_PCB_FPREGS+FRAME_FP0(t0)
sw t2, PCB_FPREGS+FRAME_FP0(t0)
j ra
#else
srl a3, a0, 7 - 2 # get FD field (even regs only)
@ -3854,8 +3854,8 @@ STATIC_LEAF(set_fd_d)
andi t1, t1, 0x0078 # Even regs only
addu t2, t2, t1
sw t3, U_PCB_FPREGS+FRAME_FP0(t2)
sw t0, U_PCB_FPREGS+FRAME_FP0+4(t2)
sw t3, PCB_FPREGS+FRAME_FP0(t2)
sw t0, PCB_FPREGS+FRAME_FP0+4(t2)
j ra
#else
sll t0, t0, 31 # set sign

View File

@ -1,4 +1,4 @@
# $NetBSD: genassym.cf,v 1.46 2009/08/20 03:33:53 cliff Exp $
# $NetBSD: genassym.cf,v 1.47 2009/11/27 03:23:11 rmind Exp $
#
# Copyright (c) 1992, 1993
# The Regents of the University of California. All rights reserved.
@ -110,10 +110,10 @@ define L_MD_ASTPENDING offsetof(struct lwp, l_md.md_astpending)
define P_RASLIST offsetof(struct proc, p_raslist)
define P_MD_SYSCALL offsetof(struct proc, p_md.md_syscall)
define U_PCB_FPREGS offsetof(struct user, u_pcb.pcb_fpregs)
define U_PCB_CONTEXT offsetof(struct user, u_pcb.pcb_context)
define U_PCB_ONFAULT offsetof(struct user, u_pcb.pcb_onfault)
define U_PCB_PPL offsetof(struct user, u_pcb.pcb_ppl)
define PCB_FPREGS offsetof(struct pcb, pcb_fpregs)
define PCB_CONTEXT offsetof(struct pcb, pcb_context)
define PCB_ONFAULT offsetof(struct pcb, pcb_onfault)
define PCB_PPL offsetof(struct pcb, pcb_ppl)
define VM_MIN_ADDRESS VM_MIN_ADDRESS
define VM_MIN_KERNEL_ADDRESS VM_MIN_KERNEL_ADDRESS

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.S,v 1.168 2009/11/26 00:19:19 matt Exp $ */
/* $NetBSD: locore.S,v 1.169 2009/11/27 03:23:11 rmind Exp $ */
/*
* Copyright (c) 1992, 1993
@ -166,21 +166,21 @@ NESTED(cpu_switchto, CALLFRAME_SIZ, ra)
lw a2, L_ADDR(a0) # a2 = l->l_addr
mfc0 t0, MIPS_COP_0_STATUS
REG_PROLOGUE
REG_S s0, U_PCB_CONTEXT+SF_REG_S0(a2)
REG_S s1, U_PCB_CONTEXT+SF_REG_S1(a2)
REG_S s2, U_PCB_CONTEXT+SF_REG_S2(a2)
REG_S s3, U_PCB_CONTEXT+SF_REG_S3(a2)
REG_S s4, U_PCB_CONTEXT+SF_REG_S4(a2)
REG_S s5, U_PCB_CONTEXT+SF_REG_S5(a2)
REG_S s6, U_PCB_CONTEXT+SF_REG_S6(a2)
REG_S s7, U_PCB_CONTEXT+SF_REG_S7(a2)
REG_S sp, U_PCB_CONTEXT+SF_REG_SP(a2)
REG_S s8, U_PCB_CONTEXT+SF_REG_S8(a2)
REG_S ra, U_PCB_CONTEXT+SF_REG_RA(a2)
REG_S t0, U_PCB_CONTEXT+SF_REG_SR(a2)
REG_S s0, PCB_CONTEXT+SF_REG_S0(a2)
REG_S s1, PCB_CONTEXT+SF_REG_S1(a2)
REG_S s2, PCB_CONTEXT+SF_REG_S2(a2)
REG_S s3, PCB_CONTEXT+SF_REG_S3(a2)
REG_S s4, PCB_CONTEXT+SF_REG_S4(a2)
REG_S s5, PCB_CONTEXT+SF_REG_S5(a2)
REG_S s6, PCB_CONTEXT+SF_REG_S6(a2)
REG_S s7, PCB_CONTEXT+SF_REG_S7(a2)
REG_S sp, PCB_CONTEXT+SF_REG_SP(a2)
REG_S s8, PCB_CONTEXT+SF_REG_S8(a2)
REG_S ra, PCB_CONTEXT+SF_REG_RA(a2)
REG_S t0, PCB_CONTEXT+SF_REG_SR(a2)
#ifdef IPL_ICU_MASK
lw t0, _C_LABEL(md_imask)
sw t0, U_PCB_PPL(a2)
sw t0, PCB_PPL(a2)
#endif
REG_EPILOGUE
1:
@ -218,7 +218,7 @@ NESTED(cpu_switchto, CALLFRAME_SIZ, ra)
#ifdef IPL_ICU_MASK
# restore ICU state
lw a0, L_ADDR(MIPS_CURLWP)
lw t0, U_PCB_PPL(a0)
lw t0, PCB_PPL(a0)
sw t0, _C_LABEL(md_imask)
jal _C_LABEL(md_imask_update)
nop
@ -226,19 +226,19 @@ NESTED(cpu_switchto, CALLFRAME_SIZ, ra)
lw a0, L_ADDR(MIPS_CURLWP)
move v0, s6 # Save return value
REG_PROLOGUE
REG_L t0, U_PCB_CONTEXT+SF_REG_SR(a0)
REG_L t0, PCB_CONTEXT+SF_REG_SR(a0)
DYNAMIC_STATUS_MASK(t0,ra) # machine dependent masking
REG_L ra, U_PCB_CONTEXT+SF_REG_RA(a0)
REG_L s0, U_PCB_CONTEXT+SF_REG_S0(a0)
REG_L s1, U_PCB_CONTEXT+SF_REG_S1(a0)
REG_L s2, U_PCB_CONTEXT+SF_REG_S2(a0)
REG_L s3, U_PCB_CONTEXT+SF_REG_S3(a0)
REG_L s4, U_PCB_CONTEXT+SF_REG_S4(a0)
REG_L s5, U_PCB_CONTEXT+SF_REG_S5(a0)
REG_L s6, U_PCB_CONTEXT+SF_REG_S6(a0)
REG_L s7, U_PCB_CONTEXT+SF_REG_S7(a0)
REG_L sp, U_PCB_CONTEXT+SF_REG_SP(a0)
REG_L s8, U_PCB_CONTEXT+SF_REG_S8(a0)
REG_L ra, PCB_CONTEXT+SF_REG_RA(a0)
REG_L s0, PCB_CONTEXT+SF_REG_S0(a0)
REG_L s1, PCB_CONTEXT+SF_REG_S1(a0)
REG_L s2, PCB_CONTEXT+SF_REG_S2(a0)
REG_L s3, PCB_CONTEXT+SF_REG_S3(a0)
REG_L s4, PCB_CONTEXT+SF_REG_S4(a0)
REG_L s5, PCB_CONTEXT+SF_REG_S5(a0)
REG_L s6, PCB_CONTEXT+SF_REG_S6(a0)
REG_L s7, PCB_CONTEXT+SF_REG_S7(a0)
REG_L sp, PCB_CONTEXT+SF_REG_SP(a0)
REG_L s8, PCB_CONTEXT+SF_REG_S8(a0)
REG_EPILOGUE
mtc0 t0, MIPS_COP_0_STATUS
COP0_SYNC
@ -247,23 +247,23 @@ NESTED(cpu_switchto, CALLFRAME_SIZ, ra)
END(cpu_switchto)
/*
* savectx(struct user *up)
* savectx(struct pcb *)
*/
LEAF(savectx)
mfc0 v0, MIPS_COP_0_STATUS
REG_PROLOGUE
REG_S s0, U_PCB_CONTEXT+SF_REG_S0(a0)
REG_S s1, U_PCB_CONTEXT+SF_REG_S1(a0)
REG_S s2, U_PCB_CONTEXT+SF_REG_S2(a0)
REG_S s3, U_PCB_CONTEXT+SF_REG_S3(a0)
REG_S s4, U_PCB_CONTEXT+SF_REG_S4(a0)
REG_S s5, U_PCB_CONTEXT+SF_REG_S5(a0)
REG_S s6, U_PCB_CONTEXT+SF_REG_S6(a0)
REG_S s7, U_PCB_CONTEXT+SF_REG_S7(a0)
REG_S sp, U_PCB_CONTEXT+SF_REG_SP(a0)
REG_S s8, U_PCB_CONTEXT+SF_REG_S8(a0)
REG_S ra, U_PCB_CONTEXT+SF_REG_RA(a0)
REG_S v0, U_PCB_CONTEXT+SF_REG_SR(a0)
REG_S s0, PCB_CONTEXT+SF_REG_S0(a0)
REG_S s1, PCB_CONTEXT+SF_REG_S1(a0)
REG_S s2, PCB_CONTEXT+SF_REG_S2(a0)
REG_S s3, PCB_CONTEXT+SF_REG_S3(a0)
REG_S s4, PCB_CONTEXT+SF_REG_S4(a0)
REG_S s5, PCB_CONTEXT+SF_REG_S5(a0)
REG_S s6, PCB_CONTEXT+SF_REG_S6(a0)
REG_S s7, PCB_CONTEXT+SF_REG_S7(a0)
REG_S sp, PCB_CONTEXT+SF_REG_SP(a0)
REG_S s8, PCB_CONTEXT+SF_REG_S8(a0)
REG_S ra, PCB_CONTEXT+SF_REG_RA(a0)
REG_S v0, PCB_CONTEXT+SF_REG_SR(a0)
REG_EPILOGUE
j ra
move v0, zero

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore_mips3.S,v 1.93 2007/10/17 19:55:38 garbled Exp $ */
/* $NetBSD: locore_mips3.S,v 1.94 2009/11/27 03:23:11 rmind Exp $ */
/*
* Copyright (c) 1997 Jonathan Stone (hereinafter referred to as the author)
@ -448,7 +448,7 @@ LEAF(badaddr64)
or a0, a0, a1
bne a2, 1, 2f
sw v0, U_PCB_ONFAULT(v1)
sw v0, PCB_ONFAULT(v1)
b 9f
lbu v0, (a0)
2:
@ -466,7 +466,7 @@ LEAF(badaddr64)
9:
mtc0 t0, MIPS_COP_0_STATUS # Restore KX
COP0_SYNC
sw zero, U_PCB_ONFAULT(v1)
sw zero, PCB_ONFAULT(v1)
j ra
move v0, zero # made it w/o errors
END(badaddr64)
@ -474,7 +474,7 @@ END(badaddr64)
LEAF(baderr64)
mtc0 t0, MIPS_COP_0_STATUS # Restore KX
COP0_SYNC
sw zero, U_PCB_ONFAULT(v1)
sw zero, PCB_ONFAULT(v1)
j ra
li v0, -1
END(baderr64)

View File

@ -1,4 +1,4 @@
/* $NetBSD: mips_machdep.c,v 1.220 2009/11/27 01:37:30 rmind Exp $ */
/* $NetBSD: mips_machdep.c,v 1.221 2009/11/27 03:23:11 rmind 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.220 2009/11/27 01:37:30 rmind Exp $");
__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.221 2009/11/27 03:23:11 rmind Exp $");
#include "opt_cputype.h"
@ -124,7 +124,6 @@ __KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.220 2009/11/27 01:37:30 rmind Exp
#include <sys/mount.h> /* fsid_t for syscallargs */
#include <sys/lwp.h>
#include <sys/sysctl.h>
#include <sys/user.h>
#include <sys/msgbuf.h>
#include <sys/conf.h>
#include <sys/core.h>
@ -1240,7 +1239,7 @@ u_int32_t dumpmag = 0x8fca0101; /* magic number */
int dumpsize = 0; /* pages */
long dumplo = 0; /* blocks */
struct user dumppcb; /* Actually, struct pcb would do. */
struct pcb dumppcb;
/*
* cpu_dumpsize: calculate size of machine-dependent kernel core dump headers.

View File

@ -1,4 +1,4 @@
/* $NetBSD: machdep.c,v 1.68 2009/11/26 00:19:19 matt Exp $ */
/* $NetBSD: machdep.c,v 1.69 2009/11/27 03:23:11 rmind 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.68 2009/11/26 00:19:19 matt Exp $");
__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.69 2009/11/27 03:23:11 rmind Exp $");
/* from: Utah Hdr: machdep.c 1.63 91/04/24 */
@ -99,7 +99,6 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.68 2009/11/26 00:19:19 matt Exp $");
#include <sys/msgbuf.h>
#include <sys/ioctl.h>
#include <sys/device.h>
#include <sys/user.h>
#include <sys/exec.h>
#include <sys/mount.h>
#include <sys/syscallargs.h>
@ -230,7 +229,9 @@ void
mach_init(int argc, char *argv[], char *envp[], u_int bim, char *bip)
{
u_long first, last;
char *kernend, *v;
struct pcb *pcb0;
char *kernend;
vaddr_t v;
char *cp;
int i, howto;
extern char edata[], end[];
@ -367,13 +368,15 @@ mach_init(int argc, char *argv[], char *envp[], u_int bim, char *bip)
pmap_bootstrap();
/*
* Allocate space for proc0's USPACE.
* Allocate uarea page for lwp0 and set it.
*/
v = (void *)uvm_pageboot_alloc(USPACE);
lwp0.l_addr = (struct user *)v;
v = uvm_pageboot_alloc(USPACE);
uvm_lwp_setuarea(&lwp0, v);
pcb0 = lwp_getpcb(&lwp0);
pcb0->pcb_context[11] = MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
lwp0.l_md.md_regs = (struct frame *)(v + USPACE) - 1;
lwp0.l_addr->u_pcb.pcb_context[11] =
MIPS_INT_MASK | MIPS_SR_INT_IE; /* SR */
/*
* Set up interrupt handling and I/O addresses.
@ -470,7 +473,7 @@ cpu_reboot(volatile int howto, char *bootstr)
{
/* take a snap shot before clobbering any registers */
if (curlwp)
savectx((struct user *)curpcb);
savectx(curpcb);
#ifdef DEBUG
if (panicstr)

Some files were not shown because too many files have changed in this diff Show More