Module Name: src
Committed By: rmind
Date: Sat Nov 21 04:45:39 UTC 2009
Modified Files:
src/sys/arch/vax/include: param.h proc.h
src/sys/arch/vax/uba: qv.c
src/sys/arch/vax/vax: cfl.c compat_13_machdep.c compat_16_machdep.c
core_machdep.c crl.c db_machdep.c disksubr.c ibcs2_machdep.c
ka6400.c ka820.c ka88.c machdep.c multicpu.c pmap.c sig_machdep.c
syscall.c trap.c vm_machdep.c
src/sys/arch/vax/vsa: asc_vsbus.c hdc9224.c ncr.c vsbus.c
Log Message:
- Use lwp_getpcb() on VAX, clean from struct user usage.
- Include sys/user.h in MD proc.h .
To generate a diff of this commit:
cvs rdiff -u -r1.56 -r1.57 src/sys/arch/vax/include/param.h
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/vax/include/proc.h
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/vax/uba/qv.c
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/vax/vax/cfl.c \
src/sys/arch/vax/vax/sig_machdep.c
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/vax/vax/compat_13_machdep.c \
src/sys/arch/vax/vax/compat_16_machdep.c
cvs rdiff -u -r1.2 -r1.3 src/sys/arch/vax/vax/core_machdep.c
cvs rdiff -u -r1.26 -r1.27 src/sys/arch/vax/vax/crl.c \
src/sys/arch/vax/vax/multicpu.c
cvs rdiff -u -r1.52 -r1.53 src/sys/arch/vax/vax/db_machdep.c
cvs rdiff -u -r1.50 -r1.51 src/sys/arch/vax/vax/disksubr.c \
src/sys/arch/vax/vax/ka820.c
cvs rdiff -u -r1.10 -r1.11 src/sys/arch/vax/vax/ibcs2_machdep.c
cvs rdiff -u -r1.13 -r1.14 src/sys/arch/vax/vax/ka6400.c \
src/sys/arch/vax/vax/ka88.c
cvs rdiff -u -r1.177 -r1.178 src/sys/arch/vax/vax/machdep.c
cvs rdiff -u -r1.172 -r1.173 src/sys/arch/vax/vax/pmap.c
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/vax/vax/syscall.c
cvs rdiff -u -r1.119 -r1.120 src/sys/arch/vax/vax/trap.c
cvs rdiff -u -r1.108 -r1.109 src/sys/arch/vax/vax/vm_machdep.c
cvs rdiff -u -r1.40 -r1.41 src/sys/arch/vax/vsa/asc_vsbus.c
cvs rdiff -u -r1.49 -r1.50 src/sys/arch/vax/vsa/hdc9224.c
cvs rdiff -u -r1.46 -r1.47 src/sys/arch/vax/vsa/ncr.c
cvs rdiff -u -r1.57 -r1.58 src/sys/arch/vax/vsa/vsbus.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/vax/include/param.h
diff -u src/sys/arch/vax/include/param.h:1.56 src/sys/arch/vax/include/param.h:1.57
--- src/sys/arch/vax/include/param.h:1.56 Wed Jul 2 17:28:57 2008
+++ src/sys/arch/vax/include/param.h Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: param.h,v 1.56 2008/07/02 17:28:57 ad Exp $ */
+/* $NetBSD: param.h,v 1.57 2009/11/21 04:45:39 rmind Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -82,7 +82,7 @@
#define UPAGES 2 /* pages of u-area */
#define USPACE (NBPG*UPAGES)
-#define REDZONEADDR (VAX_NBPG*3) /* Must be > sizeof(struct user) */
+#define REDZONEADDR (VAX_NBPG*3) /* Must be > sizeof(struct pcb) */
#ifndef MSGBUFSIZE
#define MSGBUFSIZE NBPG /* default message buffer size */
Index: src/sys/arch/vax/include/proc.h
diff -u src/sys/arch/vax/include/proc.h:1.12 src/sys/arch/vax/include/proc.h:1.13
--- src/sys/arch/vax/include/proc.h:1.12 Sat Dec 22 08:29:40 2007
+++ src/sys/arch/vax/include/proc.h Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: proc.h,v 1.12 2007/12/22 08:29:40 tsutsui Exp $ */
+/* $NetBSD: proc.h,v 1.13 2009/11/21 04:45:39 rmind Exp $ */
/*
* Copyright (c) 1991 Regents of the University of California.
@@ -34,6 +34,8 @@
#ifndef _VAX_PROC_H_
#define _VAX_PROC_H_
+#include <sys/user.h> /* for sizeof(struct user) */
+
/*
* Machine-dependent lwp struct for vax,
*/
Index: src/sys/arch/vax/uba/qv.c
diff -u src/sys/arch/vax/uba/qv.c:1.26 src/sys/arch/vax/uba/qv.c:1.27
--- src/sys/arch/vax/uba/qv.c:1.26 Mon Oct 26 19:16:58 2009
+++ src/sys/arch/vax/uba/qv.c Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: qv.c,v 1.26 2009/10/26 19:16:58 cegger Exp $ */
+/* $NetBSD: qv.c,v 1.27 2009/11/21 04:45:39 rmind Exp $ */
/*-
* Copyright (c) 1988
@@ -123,7 +123,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: qv.c,v 1.26 2009/10/26 19:16:58 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: qv.c,v 1.27 2009/11/21 04:45:39 rmind Exp $");
#include "qv.h"
#if NQV > 0
@@ -132,7 +132,6 @@
#include "sys/param.h"
#include "sys/conf.h"
-#include "sys/user.h"
#include "qvioctl.h"
#include "sys/tty.h"
#include "sys/buf.h"
Index: src/sys/arch/vax/vax/cfl.c
diff -u src/sys/arch/vax/vax/cfl.c:1.18 src/sys/arch/vax/vax/cfl.c:1.19
--- src/sys/arch/vax/vax/cfl.c:1.18 Tue Mar 11 05:34:03 2008
+++ src/sys/arch/vax/vax/cfl.c Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: cfl.c,v 1.18 2008/03/11 05:34:03 matt Exp $ */
+/* $NetBSD: cfl.c,v 1.19 2009/11/21 04:45:39 rmind Exp $ */
/*-
* Copyright (c) 1982, 1986 The Regents of the University of California.
* All rights reserved.
@@ -71,13 +71,12 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cfl.c,v 1.18 2008/03/11 05:34:03 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cfl.c,v 1.19 2009/11/21 04:45:39 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/proc.h>
-#include <sys/user.h>
#include <sys/buf.h>
#include <machine/cpu.h>
Index: src/sys/arch/vax/vax/sig_machdep.c
diff -u src/sys/arch/vax/vax/sig_machdep.c:1.18 src/sys/arch/vax/vax/sig_machdep.c:1.19
--- src/sys/arch/vax/vax/sig_machdep.c:1.18 Tue Jan 13 23:56:13 2009
+++ src/sys/arch/vax/vax/sig_machdep.c Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: sig_machdep.c,v 1.18 2009/01/13 23:56:13 mjf Exp $ */
+/* $NetBSD: sig_machdep.c,v 1.19 2009/11/21 04:45:39 rmind Exp $ */
/*
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -83,7 +83,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.18 2009/01/13 23:56:13 mjf Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.19 2009/11/21 04:45:39 rmind Exp $");
#include "opt_ddb.h"
#include "opt_compat_netbsd.h"
@@ -96,7 +96,6 @@
#include <sys/systm.h>
#include <sys/extent.h>
#include <sys/proc.h>
-#include <sys/user.h>
#include <sys/time.h>
#include <sys/signal.h>
#include <sys/kernel.h>
@@ -224,7 +223,8 @@
{
struct lwp *l = curlwp;
struct proc *p = l->l_proc;
- struct trapframe *tf = l->l_addr->u_pcb.framep;
+ struct pcb *pcb = lwp_getpcb(l);
+ struct trapframe *tf = pcb->framep;
struct sigaltstack *ss = &l->l_sigstk;
const struct sigact_sigdesc *sd =
&p->p_sigacts->sa_sigdesc[ksi->ksi_signo];
Index: src/sys/arch/vax/vax/compat_13_machdep.c
diff -u src/sys/arch/vax/vax/compat_13_machdep.c:1.1 src/sys/arch/vax/vax/compat_13_machdep.c:1.2
--- src/sys/arch/vax/vax/compat_13_machdep.c:1.1 Tue Jan 13 23:56:13 2009
+++ src/sys/arch/vax/vax/compat_13_machdep.c Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_13_machdep.c,v 1.1 2009/01/13 23:56:13 mjf Exp $ */
+/* $NetBSD: compat_13_machdep.c,v 1.2 2009/11/21 04:45:39 rmind Exp $ */
/*
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -83,7 +83,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_13_machdep.c,v 1.1 2009/01/13 23:56:13 mjf Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_13_machdep.c,v 1.2 2009/11/21 04:45:39 rmind Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -97,7 +97,6 @@
#include <sys/systm.h>
#include <sys/extent.h>
#include <sys/proc.h>
-#include <sys/user.h>
#include <sys/time.h>
#include <sys/signal.h>
#include <sys/kernel.h>
@@ -144,12 +143,13 @@
syscallarg(struct sigcontext13 *) sigcntxp;
} */
struct proc *p = l->l_proc;
+ struct pcb *pcb = lwp_getpcb(l);
struct trapframe *scf;
struct sigcontext13 *ucntx;
struct sigcontext13 ksc;
sigset_t mask;
- scf = l->l_addr->u_pcb.framep;
+ scf = pcb->framep;
ucntx = SCARG(uap, sigcntxp);
if (copyin((void *)ucntx, (void *)&ksc, sizeof(struct sigcontext)))
return EINVAL;
Index: src/sys/arch/vax/vax/compat_16_machdep.c
diff -u src/sys/arch/vax/vax/compat_16_machdep.c:1.1 src/sys/arch/vax/vax/compat_16_machdep.c:1.2
--- src/sys/arch/vax/vax/compat_16_machdep.c:1.1 Tue Jan 13 23:56:13 2009
+++ src/sys/arch/vax/vax/compat_16_machdep.c Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: compat_16_machdep.c,v 1.1 2009/01/13 23:56:13 mjf Exp $ */
+/* $NetBSD: compat_16_machdep.c,v 1.2 2009/11/21 04:45:39 rmind Exp $ */
/*
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -83,7 +83,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.1 2009/01/13 23:56:13 mjf Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.2 2009/11/21 04:45:39 rmind Exp $");
#ifdef _KERNEL_OPT
#include "opt_ddb.h"
@@ -98,7 +98,6 @@
#include <sys/systm.h>
#include <sys/extent.h>
#include <sys/proc.h>
-#include <sys/user.h>
#include <sys/time.h>
#include <sys/signal.h>
#include <sys/kernel.h>
@@ -142,11 +141,12 @@
syscallarg(struct sigcontext *) sigcntxp;
} */
struct proc *p = l->l_proc;
+ struct pcb *pcb = lwp_getpcb(l);
struct trapframe *scf;
struct sigcontext *ucntx;
struct sigcontext ksc;
- scf = l->l_addr->u_pcb.framep;
+ scf = pcb->framep;
ucntx = SCARG(uap, sigcntxp);
if (copyin((void *)ucntx, (void *)&ksc, sizeof(struct sigcontext)))
Index: src/sys/arch/vax/vax/core_machdep.c
diff -u src/sys/arch/vax/vax/core_machdep.c:1.2 src/sys/arch/vax/vax/core_machdep.c:1.3
--- src/sys/arch/vax/vax/core_machdep.c:1.2 Sat Aug 15 23:45:01 2009
+++ src/sys/arch/vax/vax/core_machdep.c Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: core_machdep.c,v 1.2 2009/08/15 23:45:01 matt Exp $ */
+/* $NetBSD: core_machdep.c,v 1.3 2009/11/21 04:45:39 rmind Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -31,13 +31,12 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: core_machdep.c,v 1.2 2009/08/15 23:45:01 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: core_machdep.c,v 1.3 2009/11/21 04:45:39 rmind Exp $");
#include <sys/types.h>
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
-#include <sys/user.h>
#include <sys/exec.h>
#include <sys/vnode.h>
#include <sys/core.h>
@@ -69,6 +68,7 @@
{
struct md_coredump md_core;
struct coreseg cseg;
+ struct pcb *pcb;
int error;
if (iocookie == NULL) {
@@ -80,7 +80,8 @@
return 0;
}
- md_core.md_tf = *(struct trapframe *)l->l_addr->u_pcb.framep; /*XXX*/
+ pcb = lwp_getpcb(l);
+ md_core.md_tf = *(struct trapframe *)pcb->framep; /*XXX*/
CORE_SETMAGIC(cseg, CORESEGMAGIC, MID_MACHINE, CORE_CPU);
cseg.c_addr = 0;
Index: src/sys/arch/vax/vax/crl.c
diff -u src/sys/arch/vax/vax/crl.c:1.26 src/sys/arch/vax/vax/crl.c:1.27
--- src/sys/arch/vax/vax/crl.c:1.26 Tue Dec 16 22:35:27 2008
+++ src/sys/arch/vax/vax/crl.c Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: crl.c,v 1.26 2008/12/16 22:35:27 christos Exp $ */
+/* $NetBSD: crl.c,v 1.27 2009/11/21 04:45:39 rmind Exp $ */
/*-
* Copyright (c) 1982, 1986 The Regents of the University of California.
* All rights reserved.
@@ -36,13 +36,12 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: crl.c,v 1.26 2008/12/16 22:35:27 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: crl.c,v 1.27 2009/11/21 04:45:39 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/proc.h>
-#include <sys/user.h>
#include <sys/buf.h>
#include <machine/cpu.h>
Index: src/sys/arch/vax/vax/multicpu.c
diff -u src/sys/arch/vax/vax/multicpu.c:1.26 src/sys/arch/vax/vax/multicpu.c:1.27
--- src/sys/arch/vax/vax/multicpu.c:1.26 Thu Apr 2 13:00:40 2009
+++ src/sys/arch/vax/vax/multicpu.c Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: multicpu.c,v 1.26 2009/04/02 13:00:40 tsutsui Exp $ */
+/* $NetBSD: multicpu.c,v 1.27 2009/11/21 04:45:39 rmind Exp $ */
/*
* Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved.
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: multicpu.c,v 1.26 2009/04/02 13:00:40 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: multicpu.c,v 1.27 2009/11/21 04:45:39 rmind Exp $");
#include "opt_multiprocessor.h"
@@ -43,7 +43,6 @@
#include <sys/queue.h>
#include <sys/malloc.h>
#include <sys/proc.h>
-#include <sys/user.h>
#include <sys/device.h>
#include <uvm/uvm_extern.h>
Index: src/sys/arch/vax/vax/db_machdep.c
diff -u src/sys/arch/vax/vax/db_machdep.c:1.52 src/sys/arch/vax/vax/db_machdep.c:1.53
--- src/sys/arch/vax/vax/db_machdep.c:1.52 Mon Oct 26 19:16:58 2009
+++ src/sys/arch/vax/vax/db_machdep.c Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.c,v 1.52 2009/10/26 19:16:58 cegger Exp $ */
+/* $NetBSD: db_machdep.c,v 1.53 2009/11/21 04:45:39 rmind Exp $ */
/*
* :set tabs=4
@@ -39,14 +39,13 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.52 2009/10/26 19:16:58 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.53 2009/11/21 04:45:39 rmind Exp $");
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
#include <sys/param.h>
#include <sys/proc.h>
-#include <sys/user.h>
#include <sys/reboot.h>
#include <sys/systm.h> /* just for boothowto --eichin */
@@ -408,10 +407,9 @@
const char *modif, /* pointer to flag modifier 't' */
void (*pr)(const char *, ...)) /* Print function */
{
- extern struct user *proc0paddr;
struct lwp *l = curlwp;
struct proc *p = l->l_proc;
- struct user *uarea;
+ struct pcb *pcb;
int trace_proc;
pid_t curpid;
const char *s;
@@ -484,38 +482,36 @@
#endif
}
if (p == NULL) {
- uarea = proc0paddr;
+ pcb = lwp_getpcb(&lwp0);
curpid = 0;
} else {
- uarea = l->l_addr;
+ pcb = lwp_getpcb(l);
curpid = p->p_pid;
}
(*pr)("Process %d.%d\n", curpid, l->l_lid);
(*pr)(" PCB contents:\n");
- (*pr)(" KSP = 0x%x\n", (unsigned int)(uarea->u_pcb.KSP));
- (*pr)(" ESP = 0x%x\n", (unsigned int)(uarea->u_pcb.ESP));
- (*pr)(" SSP = 0x%x\n", (unsigned int)(uarea->u_pcb.SSP));
- (*pr)(" USP = 0x%x\n", (unsigned int)(uarea->u_pcb.USP));
+ (*pr)(" KSP = 0x%x\n", (unsigned int)(pcb->KSP));
+ (*pr)(" ESP = 0x%x\n", (unsigned int)(pcb->ESP));
+ (*pr)(" SSP = 0x%x\n", (unsigned int)(pcb->SSP));
+ (*pr)(" USP = 0x%x\n", (unsigned int)(pcb->USP));
(*pr)(" R[00] = 0x%08x R[06] = 0x%08x\n",
- (unsigned int)(uarea->u_pcb.R[0]), (unsigned int)(uarea->u_pcb.R[6]));
+ (unsigned int)(pcb->R[0]), (unsigned int)(pcb->R[6]));
(*pr)(" R[01] = 0x%08x R[07] = 0x%08x\n",
- (unsigned int)(uarea->u_pcb.R[1]), (unsigned int)(uarea->u_pcb.R[7]));
+ (unsigned int)(pcb->R[1]), (unsigned int)(pcb->R[7]));
(*pr)(" R[02] = 0x%08x R[08] = 0x%08x\n",
- (unsigned int)(uarea->u_pcb.R[2]), (unsigned int)(uarea->u_pcb.R[8]));
+ (unsigned int)(pcb->R[2]), (unsigned int)(pcb->R[8]));
(*pr)(" R[03] = 0x%08x R[09] = 0x%08x\n",
- (unsigned int)(uarea->u_pcb.R[3]), (unsigned int)(uarea->u_pcb.R[9]));
+ (unsigned int)(pcb->R[3]), (unsigned int)(pcb->R[9]));
(*pr)(" R[04] = 0x%08x R[10] = 0x%08x\n",
- (unsigned int)(uarea->u_pcb.R[4]), (unsigned int)(uarea->u_pcb.R[10]));
+ (unsigned int)(pcb->R[4]), (unsigned int)(pcb->R[10]));
(*pr)(" R[05] = 0x%08x R[11] = 0x%08x\n",
- (unsigned int)(uarea->u_pcb.R[5]), (unsigned int)(uarea->u_pcb.R[11]));
- (*pr)(" AP = 0x%x\n", (unsigned int)(uarea->u_pcb.AP));
- (*pr)(" FP = 0x%x\n", (unsigned int)(uarea->u_pcb.FP));
- (*pr)(" PC = 0x%x\n", (unsigned int)(uarea->u_pcb.PC));
- (*pr)(" PSL = 0x%x\n", (unsigned int)(uarea->u_pcb.PSL));
- (*pr)(" Trap frame pointer: 0x%x\n",
- (unsigned int)(uarea->u_pcb.framep));
- db_dump_stack((VAX_CALLFRAME *)(uarea->u_pcb.FP),
- (u_int) uarea->u_pcb.KSP, pr);
+ (unsigned int)(pcb->R[5]), (unsigned int)(pcb->R[11]));
+ (*pr)(" AP = 0x%x\n", (unsigned int)(pcb->AP));
+ (*pr)(" FP = 0x%x\n", (unsigned int)(pcb->FP));
+ (*pr)(" PC = 0x%x\n", (unsigned int)(pcb->PC));
+ (*pr)(" PSL = 0x%x\n", (unsigned int)(pcb->PSL));
+ (*pr)(" Trap frame pointer: 0x%x\n", (unsigned int)(pcb->framep));
+ db_dump_stack((VAX_CALLFRAME *)(pcb->FP), (u_int)pcb->KSP, pr);
return;
#if 0
while (((u_int)(cur_frame->vax_fp) > stackbase) &&
@@ -581,12 +577,7 @@
printf("Don't know what to do without panic\n");
return;
}
- if (p)
- paddr = (u_int)p->p_addr;
- else
- paddr = proc0paddr;
-
- stackbase = (ddb_regs.psl & PSL_IS ? istack : paddr);
+ stackbase = (ddb_regs.psl & PSL_IS ? istack : pcb);
}
#endif
}
Index: src/sys/arch/vax/vax/disksubr.c
diff -u src/sys/arch/vax/vax/disksubr.c:1.50 src/sys/arch/vax/vax/disksubr.c:1.51
--- src/sys/arch/vax/vax/disksubr.c:1.50 Mon Oct 26 19:16:58 2009
+++ src/sys/arch/vax/vax/disksubr.c Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: disksubr.c,v 1.50 2009/10/26 19:16:58 cegger Exp $ */
+/* $NetBSD: disksubr.c,v 1.51 2009/11/21 04:45:39 rmind Exp $ */
/*
* Copyright (c) 1982, 1986, 1988 Regents of the University of California.
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.50 2009/10/26 19:16:58 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: disksubr.c,v 1.51 2009/11/21 04:45:39 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -42,7 +42,6 @@
#include <sys/disk.h>
#include <sys/syslog.h>
#include <sys/proc.h>
-#include <sys/user.h>
#include <uvm/uvm_extern.h>
Index: src/sys/arch/vax/vax/ka820.c
diff -u src/sys/arch/vax/vax/ka820.c:1.50 src/sys/arch/vax/vax/ka820.c:1.51
--- src/sys/arch/vax/vax/ka820.c:1.50 Tue Dec 16 22:35:28 2008
+++ src/sys/arch/vax/vax/ka820.c Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: ka820.c,v 1.50 2008/12/16 22:35:28 christos Exp $ */
+/* $NetBSD: ka820.c,v 1.51 2009/11/21 04:45:39 rmind Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
* All rights reserved.
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ka820.c,v 1.50 2008/12/16 22:35:28 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ka820.c,v 1.51 2009/11/21 04:45:39 rmind Exp $");
#include "opt_multiprocessor.h"
@@ -50,7 +50,6 @@
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/proc.h>
-#include <sys/user.h>
#include <uvm/uvm_extern.h>
@@ -535,6 +534,7 @@
static void
ka820_startslave(struct cpu_info *ci)
{
+ const struct pcb *pcb = lwp_getpcb(ci->ci_data.cpu_onproc);
const int id = ci->ci_slotid;
int i;
@@ -548,8 +548,7 @@
ka820_txrx(id, "D/I 4 %x\r", ci->ci_istack); /* Interrupt stack */
ka820_txrx(id, "D/I C %x\r", mfpr(PR_SBR)); /* SBR */
ka820_txrx(id, "D/I D %x\r", mfpr(PR_SLR)); /* SLR */
- ka820_txrx(id, "D/I 10 %x\r", /* PCB for idle proc */
- ci->ci_data.cpu_onproc->l_addr->u_pcb.pcb_paddr);
+ ka820_txrx(id, "D/I 10 %x\r", pcb->pcb_paddr); /* PCB for idle proc */
ka820_txrx(id, "D/I 11 %x\r", mfpr(PR_SCBB)); /* SCB */
ka820_txrx(id, "D/I 38 %x\r", mfpr(PR_MAPEN)); /* Enable MM */
ka820_txrx(id, "S %x\r", (int)&vax_mp_tramp); /* Start! */
Index: src/sys/arch/vax/vax/ibcs2_machdep.c
diff -u src/sys/arch/vax/vax/ibcs2_machdep.c:1.10 src/sys/arch/vax/vax/ibcs2_machdep.c:1.11
--- src/sys/arch/vax/vax/ibcs2_machdep.c:1.10 Mon Apr 28 20:23:39 2008
+++ src/sys/arch/vax/vax/ibcs2_machdep.c Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: ibcs2_machdep.c,v 1.10 2008/04/28 20:23:39 martin Exp $ */
+/* $NetBSD: ibcs2_machdep.c,v 1.11 2009/11/21 04:45:39 rmind Exp $ */
/*-
* Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -30,13 +30,12 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ibcs2_machdep.c,v 1.10 2008/04/28 20:23:39 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ibcs2_machdep.c,v 1.11 2009/11/21 04:45:39 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/exec.h>
-#include <sys/user.h>
#include <sys/signalvar.h>
#include <sys/signal.h>
Index: src/sys/arch/vax/vax/ka6400.c
diff -u src/sys/arch/vax/vax/ka6400.c:1.13 src/sys/arch/vax/vax/ka6400.c:1.14
--- src/sys/arch/vax/vax/ka6400.c:1.13 Tue Mar 11 05:34:03 2008
+++ src/sys/arch/vax/vax/ka6400.c Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: ka6400.c,v 1.13 2008/03/11 05:34:03 matt Exp $ */
+/* $NetBSD: ka6400.c,v 1.14 2009/11/21 04:45:39 rmind Exp $ */
/*
* Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ka6400.c,v 1.13 2008/03/11 05:34:03 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ka6400.c,v 1.14 2009/11/21 04:45:39 rmind Exp $");
#include "opt_multiprocessor.h"
@@ -50,7 +50,6 @@
#include <sys/device.h>
#include <sys/systm.h>
#include <sys/conf.h>
-#include <sys/user.h>
#include <machine/ka670.h>
#include <machine/cpu.h>
@@ -339,6 +338,7 @@
static void
ka6400_startslave(struct cpu_info *ci)
{
+ const struct pcb *pcb = lwp_getpcb(ci->ci_data.cpu_onproc);
const int id = ci->ci_slotid;
int i;
@@ -352,8 +352,7 @@
ka6400_txrx(id, "D/I 4 %x\r", ci->ci_istack); /* Interrupt stack */
ka6400_txrx(id, "D/I C %x\r", mfpr(PR_SBR)); /* SBR */
ka6400_txrx(id, "D/I D %x\r", mfpr(PR_SLR)); /* SLR */
- ka6400_txrx(id, "D/I 10 %x\r", /* PCB for idle proc */
- ci->ci_data.cpu_onproc->l_addr->u_pcb.pcb_paddr);
+ ka6400_txrx(id, "D/I 10 %x\r", pcb->pcb_paddr); /* PCB for idle proc */
ka6400_txrx(id, "D/I 11 %x\r", mfpr(PR_SCBB)); /* SCB */
ka6400_txrx(id, "D/I 38 %x\r", mfpr(PR_MAPEN)); /* Enable MM */
ka6400_txrx(id, "S %x\r", (int)&vax_mp_tramp); /* Start! */
Index: src/sys/arch/vax/vax/ka88.c
diff -u src/sys/arch/vax/vax/ka88.c:1.13 src/sys/arch/vax/vax/ka88.c:1.14
--- src/sys/arch/vax/vax/ka88.c:1.13 Tue Mar 11 05:34:03 2008
+++ src/sys/arch/vax/vax/ka88.c Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: ka88.c,v 1.13 2008/03/11 05:34:03 matt Exp $ */
+/* $NetBSD: ka88.c,v 1.14 2009/11/21 04:45:39 rmind Exp $ */
/*
* Copyright (c) 2000 Ludd, University of Lule}, Sweden. All rights reserved.
@@ -39,7 +39,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ka88.c,v 1.13 2008/03/11 05:34:03 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ka88.c,v 1.14 2009/11/21 04:45:39 rmind Exp $");
#include "opt_multiprocessor.h"
@@ -50,7 +50,6 @@
#include <sys/systm.h>
#include <sys/conf.h>
#include <sys/cpu.h>
-#include <sys/user.h>
#include <sys/malloc.h>
#include <sys/lwp.h>
@@ -374,6 +373,7 @@
static void
ka88_startslave(struct cpu_info *ci)
{
+ const struct pcb *pcb = lwp_getpcb(ci->ci_data.cpu_onproc);
const int id = ci->ci_slotid;
int i;
@@ -387,8 +387,7 @@
ka88_txrx(id, "D/I 4 %x\r", ci->ci_istack); /* Interrupt stack */
ka88_txrx(id, "D/I C %x\r", mfpr(PR_SBR)); /* SBR */
ka88_txrx(id, "D/I D %x\r", mfpr(PR_SLR)); /* SLR */
- ka88_txrx(id, "D/I 10 %x\r", /* PCB for idle proc */
- ci->ci_data.cpu_onproc->l_addr->u_pcb.pcb_paddr);
+ ka88_txrx(id, "D/I 10 %x\r", pcb->pcb_paddr); /* PCB for idle proc */
ka88_txrx(id, "D/I 11 %x\r", mfpr(PR_SCBB)); /* SCB */
ka88_txrx(id, "D/I 38 %x\r", mfpr(PR_MAPEN)); /* Enable MM */
ka88_txrx(id, "S %x\r", (int)&vax_mp_tramp); /* Start! */
Index: src/sys/arch/vax/vax/machdep.c
diff -u src/sys/arch/vax/vax/machdep.c:1.177 src/sys/arch/vax/vax/machdep.c:1.178
--- src/sys/arch/vax/vax/machdep.c:1.177 Mon Oct 26 19:16:58 2009
+++ src/sys/arch/vax/vax/machdep.c Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.177 2009/10/26 19:16:58 cegger Exp $ */
+/* $NetBSD: machdep.c,v 1.178 2009/11/21 04:45:39 rmind Exp $ */
/*
* Copyright (c) 1982, 1986, 1990 The Regents of the University of California.
@@ -83,7 +83,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.177 2009/10/26 19:16:58 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.178 2009/11/21 04:45:39 rmind Exp $");
#include "opt_ddb.h"
#include "opt_compat_netbsd.h"
@@ -97,7 +97,6 @@
#include <sys/systm.h>
#include <sys/extent.h>
#include <sys/proc.h>
-#include <sys/user.h>
#include <sys/time.h>
#include <sys/signal.h>
#include <sys/kernel.h>
@@ -329,8 +328,8 @@
}
#endif
#ifdef DEBUG
- if (sizeof(struct user) > REDZONEADDR)
- panic("struct user inside red zone");
+ if (sizeof(struct pcb) > REDZONEADDR)
+ panic("struct pcb inside red zone");
#endif
}
@@ -462,7 +461,8 @@
int
process_read_regs(struct lwp *l, struct reg *regs)
{
- struct trapframe *tf = l->l_addr->u_pcb.framep;
+ struct pcb *pcb = lwp_getpcb(l);
+ struct trapframe *tf = pcb->framep;
memcpy(®s->r0, &tf->r0, 12 * sizeof(int));
regs->ap = tf->ap;
@@ -476,7 +476,8 @@
int
process_write_regs(struct lwp *l, const struct reg *regs)
{
- struct trapframe *tf = l->l_addr->u_pcb.framep;
+ struct pcb *pcb = lwp_getpcb(l);
+ struct trapframe *tf = pcb->framep;
memcpy(&tf->r0, ®s->r0, 12 * sizeof(int));
tf->ap = regs->ap;
@@ -491,10 +492,11 @@
int
process_set_pc(struct lwp *l, void *addr)
{
+ struct pcb *pcb = lwp_getpcb(l);
struct trapframe *tf;
void *ptr;
- ptr = (char *) l->l_addr->u_pcb.framep;
+ ptr = (char *)pcb->framep;
tf = ptr;
tf->pc = (unsigned) addr;
@@ -505,10 +507,11 @@
int
process_sstep(struct lwp *l, int sstep)
{
- void *ptr;
+ struct pcb *pcb = lwp_getpcb(l);
struct trapframe *tf;
+ void *ptr;
- ptr = l->l_addr->u_pcb.framep;
+ ptr = pcb->framep;
tf = ptr;
if (sstep)
@@ -637,7 +640,8 @@
cpu_upcall(struct lwp *l, int type, int nevents, int ninterrupted,
void *sas, void *ap, void *sp, sa_upcall_t upcall)
{
- struct trapframe *tf = l->l_addr->u_pcb.framep;
+ struct pcb *pcb = lwp_getpcb(l);
+ struct trapframe *tf = pcb->framep;
uint32_t saframe[11], *fp = saframe;
sp = (void *)((uintptr_t)sp - sizeof(saframe));
@@ -682,7 +686,8 @@
void
cpu_getmcontext(struct lwp *l, mcontext_t *mcp, unsigned int *flags)
{
- const struct trapframe *tf = l->l_addr->u_pcb.framep;
+ const struct pcb *pcb = lwp_getpcb(l);
+ const struct trapframe *tf = pcb->framep;
__greg_t *gr = mcp->__gregs;
gr[_REG_R0] = tf->r0;
@@ -708,7 +713,8 @@
int
cpu_setmcontext(struct lwp *l, const mcontext_t *mcp, unsigned int flags)
{
- struct trapframe *tf = l->l_addr->u_pcb.framep;
+ struct pcb *pcb = lwp_getpcb(l);
+ struct trapframe *tf = pcb->framep;
const __greg_t *gr = mcp->__gregs;
if ((flags & _UC_CPU) == 0)
Index: src/sys/arch/vax/vax/pmap.c
diff -u src/sys/arch/vax/vax/pmap.c:1.172 src/sys/arch/vax/vax/pmap.c:1.173
--- src/sys/arch/vax/vax/pmap.c:1.172 Sat Nov 7 07:27:48 2009
+++ src/sys/arch/vax/vax/pmap.c Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.172 2009/11/07 07:27:48 cegger Exp $ */
+/* $NetBSD: pmap.c,v 1.173 2009/11/21 04:45:39 rmind Exp $ */
/*
* Copyright (c) 1994, 1998, 1999, 2003 Ludd, University of Lule}, Sweden.
* All rights reserved.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.172 2009/11/07 07:27:48 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.173 2009/11/21 04:45:39 rmind Exp $");
#include "opt_ddb.h"
#include "opt_cputype.h"
@@ -1664,7 +1664,7 @@
void
pmap_activate(struct lwp *l)
{
- struct pcb * const pcb = &l->l_addr->u_pcb;
+ struct pcb * const pcb = lwp_getpcb(l);
struct pmap * const pmap = l->l_proc->p_vmspace->vm_map.pmap;
PMDEBUG(("pmap_activate: l %p\n", l));
@@ -1694,7 +1694,7 @@
void
pmap_deactivate(struct lwp *l)
{
- struct pcb * const pcb = &l->l_addr->u_pcb;
+ struct pcb * const pcb = lwp_getpcb(l);
struct pmap * const pmap = l->l_proc->p_vmspace->vm_map.pmap;
PMDEBUG(("pmap_deactivate: l %p\n", l));
Index: src/sys/arch/vax/vax/syscall.c
diff -u src/sys/arch/vax/vax/syscall.c:1.16 src/sys/arch/vax/vax/syscall.c:1.17
--- src/sys/arch/vax/vax/syscall.c:1.16 Tue Jun 2 23:21:37 2009
+++ src/sys/arch/vax/vax/syscall.c Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: syscall.c,v 1.16 2009/06/02 23:21:37 pooka Exp $ */
+/* $NetBSD: syscall.c,v 1.17 2009/11/21 04:45:39 rmind Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -33,7 +33,7 @@
/* All bugs are subject to removal without further notice */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.16 2009/06/02 23:21:37 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: syscall.c,v 1.17 2009/11/21 04:45:39 rmind Exp $");
#include "opt_multiprocessor.h"
#include "opt_sa.h"
@@ -41,7 +41,6 @@
#include <sys/types.h>
#include <sys/param.h>
#include <sys/proc.h>
-#include <sys/user.h>
#include <sys/syscall.h>
#include <sys/syscallvar.h>
#include <sys/systm.h>
@@ -87,6 +86,7 @@
struct trapframe * const exptr = frame;
struct lwp * const l = curlwp;
struct proc * const p = l->l_proc;
+ struct pcb *pcb = lwp_getpcb(l);
const struct emul * const emul = p->p_emul;
const struct sysent *callp = emul->e_sysent;
const u_quad_t oticks = p->p_sticks;
@@ -99,7 +99,7 @@
LWP_CACHE_CREDS(l, p);
- l->l_addr->u_pcb.framep = frame;
+ pcb->framep = frame;
if ((unsigned long) frame->code >= emul->e_nsysent)
callp += emul->e_nosys;
@@ -131,7 +131,7 @@
error = sy_call(callp, curlwp, args, rval);
}
- KASSERT(exptr == l->l_addr->u_pcb.framep);
+ KASSERT(exptr == pcb->framep);
TDB(("return %s pc %lx, psl %lx, sp %lx, pid %d, err %d r0 %d, r1 %d, "
"frame %p\n", syscallnames[exptr->code], exptr->pc, exptr->psl,
exptr->sp, p->p_pid, error, rval[0], rval[1], exptr));
@@ -167,8 +167,9 @@
void
child_return(void *arg)
{
- struct lwp *l = arg;
+ struct lwp *l = arg;
+ struct pcb *pcb = lwp_getpcb(l);
- userret(l, l->l_addr->u_pcb.framep, 0);
+ userret(l, pcb->framep, 0);
ktrsysret(SYS_fork, 0, 0);
}
Index: src/sys/arch/vax/vax/trap.c
diff -u src/sys/arch/vax/vax/trap.c:1.119 src/sys/arch/vax/vax/trap.c:1.120
--- src/sys/arch/vax/vax/trap.c:1.119 Wed Feb 25 19:56:49 2009
+++ src/sys/arch/vax/vax/trap.c Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.119 2009/02/25 19:56:49 mhitch Exp $ */
+/* $NetBSD: trap.c,v 1.120 2009/11/21 04:45:39 rmind Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -33,7 +33,7 @@
/* All bugs are subject to removal without further notice */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.119 2009/02/25 19:56:49 mhitch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.120 2009/11/21 04:45:39 rmind Exp $");
#include "opt_ddb.h"
#include "opt_multiprocessor.h"
@@ -41,7 +41,6 @@
#include <sys/types.h>
#include <sys/param.h>
#include <sys/proc.h>
-#include <sys/user.h>
#include <sys/syscall.h>
#include <sys/systm.h>
#include <sys/signalvar.h>
@@ -99,9 +98,9 @@
int no_traps = 18;
#define USERMODE_P(framep) ((((framep)->psl) & (PSL_U)) == PSL_U)
-#define FAULTCHK \
- if (l->l_addr->u_pcb.iftrap) { \
- frame->pc = (unsigned)l->l_addr->u_pcb.iftrap; \
+#define FAULTCHK(pcb) \
+ if (pcb->iftrap) { \
+ frame->pc = (unsigned)pcb->iftrap; \
frame->psl &= ~PSL_FPD; \
frame->r0 = EFAULT;/* for copyin/out */ \
frame->r1 = -1; /* for fetch/store */ \
@@ -118,6 +117,7 @@
const bool usermode = USERMODE_P(frame);;
struct lwp *l;
struct proc *p;
+ struct pcb *pcb;
u_quad_t oticks = 0;
struct vmspace *vm;
struct vm_map *map;
@@ -127,11 +127,12 @@
KASSERT(l != NULL);
p = l->l_proc;
KASSERT(p != NULL);
+ pcb = lwp_getpcb(l);
uvmexp.traps++;
if (usermode) {
type |= T_USER;
oticks = p->p_sticks;
- l->l_addr->u_pcb.framep = frame;
+ pcb->framep = frame;
LWP_CACHE_CREDS(l, p);
}
@@ -157,7 +158,7 @@
case T_KSPNOTVAL:
panic("%d.%d (%s): KSP invalid %...@%#x pcb %p fp %#x psl %#x)",
p->p_pid, l->l_lid, l->l_name ? l->l_name : "??",
- mfpr(PR_KSP), (u_int)frame->pc, l->l_addr,
+ mfpr(PR_KSP), (u_int)frame->pc, lwp_getpcb(l),
(u_int)frame->fp, (u_int)frame->psl);
case T_TRANSFLT|T_USER:
@@ -228,7 +229,7 @@
rv = uvm_fault(map, addr, ftype);
if (rv != 0) {
if (!usermode) {
- FAULTCHK;
+ FAULTCHK(pcb);
panic("Segv in kernel mode: pc %x addr %x",
(u_int)frame->pc, (u_int)frame->code);
}
@@ -355,8 +356,10 @@
setregs(struct lwp *l, struct exec_package *pack, u_long stack)
{
struct trapframe *exptr;
+ struct pcb *pcb;
- exptr = l->l_addr->u_pcb.framep;
+ pcb = lwp_getpcb(l);
+ exptr = pcb->framep;
exptr->pc = pack->ep_entry + 2;
exptr->sp = stack;
exptr->r6 = stack; /* for ELF */
@@ -375,6 +378,7 @@
int err;
ucontext_t *uc = arg;
struct lwp *l = curlwp;
+ struct pcb *pcb;
err = cpu_setmcontext(l, &uc->uc_mcontext, uc->uc_flags);
#if DIAGNOSTIC
@@ -385,14 +389,17 @@
pool_put(&lwp_uc_pool, uc);
/* XXX - profiling spoiled here */
- userret(l, l->l_addr->u_pcb.framep, l->l_proc->p_sticks);
+ pcb = lwp_getpcb(l);
+ userret(l, pcb->framep, l->l_proc->p_sticks);
}
void
upcallret(struct lwp *l)
{
+ struct pcb *pcb;
/* XXX - profiling */
- userret(l, l->l_addr->u_pcb.framep, l->l_proc->p_sticks);
+ pcb = lwp_getpcb(l);
+ userret(l, pcb->framep, l->l_proc->p_sticks);
}
Index: src/sys/arch/vax/vax/vm_machdep.c
diff -u src/sys/arch/vax/vax/vm_machdep.c:1.108 src/sys/arch/vax/vax/vm_machdep.c:1.109
--- src/sys/arch/vax/vax/vm_machdep.c:1.108 Sat Oct 24 20:03:56 2009
+++ src/sys/arch/vax/vax/vm_machdep.c Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_machdep.c,v 1.108 2009/10/24 20:03:56 rmind Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.109 2009/11/21 04:45:39 rmind Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.108 2009/10/24 20:03:56 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.109 2009/11/21 04:45:39 rmind Exp $");
#include "opt_execfmt.h"
#include "opt_compat_ultrix.h"
@@ -42,7 +42,6 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
-#include <sys/user.h>
#include <sys/exec.h>
#include <sys/exec_aout.h>
#include <sys/vnode.h>
@@ -96,11 +95,14 @@
cpu_lwp_fork(struct lwp *l1, struct lwp *l2, void *stack, size_t stacksize,
void (*func)(void *), void *arg)
{
- struct pcb *pcb;
+ struct pcb *pcb1, *pcb2;
struct trapframe *tf;
struct callsframe *cf;
extern int sret; /* Return address in trap routine */
+ pcb1 = lwp_getpcb(l1);
+ pcb2 = lwp_getpcb(l2);
+
#ifdef DIAGNOSTIC
/*
* if p1 != curlwp && p1 == &proc0, we're creating a kernel thread.
@@ -113,8 +115,8 @@
* Copy the trap frame.
*/
tf = (struct trapframe *)((u_int)l2->l_addr + USPACE) - 1;
- l2->l_addr->u_pcb.framep = tf;
- *tf = *(struct trapframe *)l1->l_addr->u_pcb.framep;
+ pcb2->framep = tf;
+ *tf = *(struct trapframe *)pcb1->framep;
/*
* Activate address space for the new process. The PTEs have
@@ -143,21 +145,20 @@
* Set up internal defs in PCB. This matches the "fake" CALLS frame
* that were constructed earlier.
*/
- pcb = &l2->l_addr->u_pcb;
- pcb->iftrap = NULL;
- pcb->AP = (uintptr_t)&cf->ca_argno;
- pcb->KSP = (uintptr_t)cf;
- pcb->FP = (uintptr_t)cf;
- pcb->PC = (uintptr_t)cpu_lwp_bootstrap + 2;
- pcb->PSL = PSL_HIGHIPL;
- pcb->ESP = (uintptr_t)&pcb->iftrap;
- pcb->SSP = (uintptr_t)l2;
+ pcb2->iftrap = NULL;
+ pcb2->AP = (uintptr_t)&cf->ca_argno;
+ pcb2->KSP = (uintptr_t)cf;
+ pcb2->FP = (uintptr_t)cf;
+ pcb2->PC = (uintptr_t)cpu_lwp_bootstrap + 2;
+ pcb2->PSL = PSL_HIGHIPL;
+ pcb2->ESP = (uintptr_t)&pcb2->iftrap;
+ pcb2->SSP = (uintptr_t)l2;
/* pcb->R[0] (oldlwp) set by Swtchto */
- pcb->R[1] = (uintptr_t)l2;
- pcb->R[2] = (uintptr_t)func;
- pcb->R[3] = (uintptr_t)arg;
- pcb->pcb_paddr = kvtophys(pcb);
+ pcb2->R[1] = (uintptr_t)l2;
+ pcb2->R[2] = (uintptr_t)func;
+ pcb2->R[3] = (uintptr_t)arg;
+ pcb2->pcb_paddr = kvtophys(pcb2);
/*
* If specified, give the child a different stack.
@@ -179,7 +180,7 @@
void
cpu_setfunc(struct lwp *l, void (*func)(void *), void *arg)
{
- struct pcb *pcb = &l->l_addr->u_pcb;
+ struct pcb *pcb = lwp_getpcb(l);
struct trapframe *tf = (struct trapframe *)((u_int)l->l_addr + USPACE) - 1;
struct callsframe *cf;
extern int sret;
Index: src/sys/arch/vax/vsa/asc_vsbus.c
diff -u src/sys/arch/vax/vsa/asc_vsbus.c:1.40 src/sys/arch/vax/vsa/asc_vsbus.c:1.41
--- src/sys/arch/vax/vsa/asc_vsbus.c:1.40 Mon Apr 28 20:23:39 2008
+++ src/sys/arch/vax/vsa/asc_vsbus.c Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: asc_vsbus.c,v 1.40 2008/04/28 20:23:39 martin Exp $ */
+/* $NetBSD: asc_vsbus.c,v 1.41 2009/11/21 04:45:39 rmind Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: asc_vsbus.c,v 1.40 2008/04/28 20:23:39 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: asc_vsbus.c,v 1.41 2009/11/21 04:45:39 rmind Exp $");
#include "locators.h"
#include "opt_cputype.h"
@@ -45,7 +45,6 @@
#include <sys/device.h>
#include <sys/buf.h>
#include <sys/proc.h>
-#include <sys/user.h>
#include <sys/reboot.h>
#include <sys/queue.h>
Index: src/sys/arch/vax/vsa/hdc9224.c
diff -u src/sys/arch/vax/vsa/hdc9224.c:1.49 src/sys/arch/vax/vsa/hdc9224.c:1.50
--- src/sys/arch/vax/vsa/hdc9224.c:1.49 Mon Oct 26 19:16:58 2009
+++ src/sys/arch/vax/vsa/hdc9224.c Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: hdc9224.c,v 1.49 2009/10/26 19:16:58 cegger Exp $ */
+/* $NetBSD: hdc9224.c,v 1.50 2009/11/21 04:45:39 rmind Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* All rights reserved.
@@ -51,7 +51,7 @@
#undef RDDEBUG
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdc9224.c,v 1.49 2009/10/26 19:16:58 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdc9224.c,v 1.50 2009/11/21 04:45:39 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -63,7 +63,6 @@
#include <sys/buf.h>
#include <sys/bufq.h>
#include <sys/proc.h>
-#include <sys/user.h>
#include <sys/device.h>
#include <sys/disklabel.h>
#include <sys/disk.h>
Index: src/sys/arch/vax/vsa/ncr.c
diff -u src/sys/arch/vax/vsa/ncr.c:1.46 src/sys/arch/vax/vsa/ncr.c:1.47
--- src/sys/arch/vax/vsa/ncr.c:1.46 Mon Apr 28 20:23:39 2008
+++ src/sys/arch/vax/vsa/ncr.c Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: ncr.c,v 1.46 2008/04/28 20:23:39 martin Exp $ */
+/* $NetBSD: ncr.c,v 1.47 2009/11/21 04:45:39 rmind Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ncr.c,v 1.46 2008/04/28 20:23:39 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ncr.c,v 1.47 2009/11/21 04:45:39 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -52,7 +52,6 @@
#include <sys/device.h>
#include <sys/buf.h>
#include <sys/proc.h>
-#include <sys/user.h>
#include <dev/scsipi/scsi_all.h>
#include <dev/scsipi/scsipi_all.h>
Index: src/sys/arch/vax/vsa/vsbus.c
diff -u src/sys/arch/vax/vsa/vsbus.c:1.57 src/sys/arch/vax/vsa/vsbus.c:1.58
--- src/sys/arch/vax/vsa/vsbus.c:1.57 Mon Oct 26 19:16:58 2009
+++ src/sys/arch/vax/vsa/vsbus.c Sat Nov 21 04:45:39 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: vsbus.c,v 1.57 2009/10/26 19:16:58 cegger Exp $ */
+/* $NetBSD: vsbus.c,v 1.58 2009/11/21 04:45:39 rmind Exp $ */
/*
* Copyright (c) 1996, 1999 Ludd, University of Lule}, Sweden.
* All rights reserved.
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vsbus.c,v 1.57 2009/10/26 19:16:58 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vsbus.c,v 1.58 2009/11/21 04:45:39 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -42,7 +42,6 @@
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/proc.h>
-#include <sys/user.h>
#include <sys/device.h>
#include <sys/disklabel.h>
#include <sys/syslog.h>