Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch Use lwp_getpcb() on hppa and ia64, clean from struc...
details: https://anonhg.NetBSD.org/src/rev/dfe9424e6a7e
branches: trunk
changeset: 749211:dfe9424e6a7e
user: rmind <rmind%NetBSD.org@localhost>
date: Sat Nov 21 15:36:33 2009 +0000
description:
Use lwp_getpcb() on hppa and ia64, clean from struct user usage.
diffstat:
sys/arch/hp300/dev/hil.c | 5 +--
sys/arch/hp300/hp300/machdep.c | 15 +++++----
sys/arch/hp300/hp300/trap.c | 29 ++++++++----------
sys/arch/hp700/dev/pdc.c | 5 +--
sys/arch/hp700/gsc/gscbus.c | 5 +--
sys/arch/hp700/hp700/machdep.c | 13 ++++----
sys/arch/hppa/hppa/core_machdep.c | 5 +--
sys/arch/hppa/hppa/db_interface.c | 5 +--
sys/arch/hppa/hppa/db_trace.c | 11 +++----
sys/arch/hppa/hppa/fpu.c | 22 +++++++-------
sys/arch/hppa/hppa/hppa_machdep.c | 22 +++++++-------
sys/arch/hppa/hppa/pmap.c | 8 ++--
sys/arch/hppa/hppa/process_machdep.c | 22 +++++++-------
sys/arch/hppa/hppa/sig_machdep.c | 8 ++--
sys/arch/hppa/hppa/trap.c | 29 +++++++++----------
sys/arch/hppa/hppa/vm_machdep.c | 54 +++++++++++++++++------------------
sys/arch/ia64/ia64/cpu.c | 5 +--
sys/arch/ia64/ia64/machdep.c | 5 ++-
sys/arch/ia64/ia64/vm_machdep.c | 30 ++++++++++----------
sys/arch/ia64/include/proc.h | 2 +
20 files changed, 146 insertions(+), 154 deletions(-)
diffs (truncated from 1050 to 300 lines):
diff -r 9959a16c0d7a -r dfe9424e6a7e sys/arch/hp300/dev/hil.c
--- a/sys/arch/hp300/dev/hil.c Sat Nov 21 15:13:14 2009 +0000
+++ b/sys/arch/hp300/dev/hil.c Sat Nov 21 15:36:33 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hil.c,v 1.82 2008/06/13 09:41:15 cegger Exp $ */
+/* $NetBSD: hil.c,v 1.83 2009/11/21 15:36:33 rmind Exp $ */
/*
* Copyright (c) 1990, 1993
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hil.c,v 1.82 2008/06/13 09:41:15 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hil.c,v 1.83 2009/11/21 15:36:33 rmind Exp $");
#include "ite.h"
#include "rnd.h"
@@ -93,7 +93,6 @@
#include <sys/proc.h>
#include <sys/tty.h>
#include <sys/uio.h>
-#include <sys/user.h>
#include <sys/kauth.h>
#include <uvm/uvm_extern.h>
diff -r 9959a16c0d7a -r dfe9424e6a7e sys/arch/hp300/hp300/machdep.c
--- a/sys/arch/hp300/hp300/machdep.c Sat Nov 21 15:13:14 2009 +0000
+++ b/sys/arch/hp300/hp300/machdep.c Sat Nov 21 15:36:33 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.208 2009/11/07 07:27:43 cegger Exp $ */
+/* $NetBSD: machdep.c,v 1.209 2009/11/21 15:36:33 rmind Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.208 2009/11/07 07:27:43 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.209 2009/11/21 15:36:33 rmind Exp $");
#include "opt_ddb.h"
#include "opt_compat_netbsd.h"
@@ -105,7 +105,6 @@
#include <sys/signalvar.h>
#include <sys/syscallargs.h>
#include <sys/tty.h>
-#include <sys/user.h>
#include <sys/core.h>
#include <sys/kcore.h>
#include <sys/vnode.h>
@@ -375,6 +374,7 @@
setregs(struct lwp *l, struct exec_package *pack, u_long stack)
{
struct frame *frame = (struct frame *)l->l_md.md_regs;
+ struct pcb *pcb = lwp_getpcb(l);
frame->f_sr = PSL_USERSET;
frame->f_pc = pack->ep_entry & ~1;
@@ -396,9 +396,9 @@
frame->f_regs[SP] = stack;
/* restore a null state frame */
- l->l_addr->u_pcb.pcb_fpregs.fpf_null = 0;
+ pcb->pcb_fpregs.fpf_null = 0;
if (fputype)
- m68881_restore(&l->l_addr->u_pcb.pcb_fpregs);
+ m68881_restore(&pcb->pcb_fpregs);
}
/*
@@ -634,10 +634,11 @@
void
cpu_reboot(int howto, char *bootstr)
{
+ struct pcb *pcb = lwp_getpcb(curlwp);
/* take a snap shot before clobbering any registers */
- if (curlwp->l_addr)
- savectx(&curlwp->l_addr->u_pcb);
+ if (pcb != NULL)
+ savectx(pcb);
/* If system is cold, just halt. */
if (cold) {
diff -r 9959a16c0d7a -r dfe9424e6a7e sys/arch/hp300/hp300/trap.c
--- a/sys/arch/hp300/hp300/trap.c Sat Nov 21 15:13:14 2009 +0000
+++ b/sys/arch/hp300/hp300/trap.c Sat Nov 21 15:36:33 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.140 2009/01/27 20:30:13 martin Exp $ */
+/* $NetBSD: trap.c,v 1.141 2009/11/21 15:36:33 rmind Exp $ */
/*
* Copyright (c) 1982, 1986, 1990, 1993
@@ -77,7 +77,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.140 2009/01/27 20:30:13 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.141 2009/11/21 15:36:33 rmind Exp $");
#include "opt_ddb.h"
#include "opt_execfmt.h"
@@ -96,7 +96,6 @@
#include <sys/sa.h>
#include <sys/savar.h>
#include <sys/syscall.h>
-#include <sys/user.h>
#include <sys/userret.h>
#include <sys/kauth.h>
@@ -290,6 +289,7 @@
extern char fubail[], subail[];
struct lwp *l;
struct proc *p;
+ struct pcb *pcb;
ksiginfo_t ksi;
int s;
u_quad_t sticks = 0 /* XXX initializer works around compiler bug */;
@@ -301,11 +301,8 @@
ksi.ksi_trap = type & ~T_USER;
p = l->l_proc;
-
-#ifdef DIAGNOSTIC
- if (l->l_addr == NULL)
- panic("trap: no pcb");
-#endif
+ pcb = lwp_getpcb(l);
+ KASSERT(pcb != NULL);
if (USERMODE(fp->f_sr)) {
type |= T_USER;
@@ -352,7 +349,7 @@
panic("trap");
case T_BUSERR: /* kernel bus error */
- if (l->l_addr->u_pcb.pcb_onfault == 0)
+ if (pcb->pcb_onfault == 0)
goto dopanic;
/* FALLTHROUGH */
@@ -365,7 +362,7 @@
*/
fp->f_stackadj = exframesize[fp->f_format];
fp->f_format = fp->f_vector = 0;
- fp->f_pc = (int) l->l_addr->u_pcb.pcb_onfault;
+ fp->f_pc = (int)pcb->pcb_onfault;
return;
case T_BUSERR|T_USER: /* bus error */
@@ -546,8 +543,7 @@
* If we were doing profiling ticks or other user mode
* stuff from interrupt code, Just Say No.
*/
- if (l->l_addr->u_pcb.pcb_onfault == fubail ||
- l->l_addr->u_pcb.pcb_onfault == subail)
+ if (pcb->pcb_onfault == fubail || pcb->pcb_onfault == subail)
goto copyfault;
/* fall into ... */
@@ -574,7 +570,7 @@
* argument space is lazy-allocated.
*/
if ((type & T_USER) == 0 &&
- ((l->l_addr->u_pcb.pcb_onfault == 0) || KDFAULT(code)))
+ ((pcb->pcb_onfault == 0) || KDFAULT(code)))
map = kernel_map;
else {
map = vm ? &vm->vm_map : kernel_map;
@@ -632,7 +628,7 @@
} else
ksi.ksi_code = SEGV_MAPERR;
if (type == T_MMUFLT) {
- if (l->l_addr->u_pcb.pcb_onfault)
+ if (pcb->pcb_onfault)
goto copyfault;
printf("uvm_fault(%p, 0x%lx, 0x%x) -> 0x%x\n",
map, va, ftype, rv);
@@ -685,9 +681,10 @@
struct fmt7 *f = &fp->f_fmt7;
struct lwp *l = curlwp;
struct proc *p = l->l_proc;
+ struct pcb *pcb = lwp_getpcb(l);
+ void *oonfault = pcb->pcb_onfault;
int err = 0;
u_int fa;
- void *oonfault = l->l_addr->u_pcb.pcb_onfault;
paddr_t pa;
#ifdef DEBUG
@@ -910,7 +907,7 @@
#endif
}
}
- l->l_addr->u_pcb.pcb_onfault = oonfault;
+ pcb->pcb_onfault = oonfault;
if (err)
err = SIGSEGV;
return err;
diff -r 9959a16c0d7a -r dfe9424e6a7e sys/arch/hp700/dev/pdc.c
--- a/sys/arch/hp700/dev/pdc.c Sat Nov 21 15:13:14 2009 +0000
+++ b/sys/arch/hp700/dev/pdc.c Sat Nov 21 15:36:33 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pdc.c,v 1.32 2009/11/03 05:07:25 snj Exp $ */
+/* $NetBSD: pdc.c,v 1.33 2009/11/21 15:36:33 rmind Exp $ */
/* $OpenBSD: pdc.c,v 1.14 2001/04/29 21:05:43 mickey Exp $ */
@@ -29,14 +29,13 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pdc.c,v 1.32 2009/11/03 05:07:25 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pdc.c,v 1.33 2009/11/21 15:36:33 rmind Exp $");
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/proc.h>
#include <sys/tty.h>
-#include <sys/user.h>
#include <sys/callout.h>
#include <sys/conf.h>
#include <sys/kauth.h>
diff -r 9959a16c0d7a -r dfe9424e6a7e sys/arch/hp700/gsc/gscbus.c
--- a/sys/arch/hp700/gsc/gscbus.c Sat Nov 21 15:13:14 2009 +0000
+++ b/sys/arch/hp700/gsc/gscbus.c Sat Nov 21 15:36:33 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: gscbus.c,v 1.18 2009/11/03 05:07:25 snj Exp $ */
+/* $NetBSD: gscbus.c,v 1.19 2009/11/21 15:36:33 rmind Exp $ */
/* $OpenBSD: gscbus.c,v 1.13 2001/08/01 20:32:04 miod Exp $ */
@@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gscbus.c,v 1.18 2009/11/03 05:07:25 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gscbus.c,v 1.19 2009/11/21 15:36:33 rmind Exp $");
#define GSCDEBUG
@@ -78,7 +78,6 @@
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/malloc.h>
-#include <sys/user.h>
#include <sys/mbuf.h>
#include <sys/reboot.h>
diff -r 9959a16c0d7a -r dfe9424e6a7e sys/arch/hp700/hp700/machdep.c
--- a/sys/arch/hp700/hp700/machdep.c Sat Nov 21 15:13:14 2009 +0000
+++ b/sys/arch/hp700/hp700/machdep.c Sat Nov 21 15:36:33 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.72 2009/11/07 07:27:43 cegger Exp $ */
+/* $NetBSD: machdep.c,v 1.73 2009/11/21 15:36:33 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.72 2009/11/07 07:27:43 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.73 2009/11/21 15:36:33 rmind Exp $");
#include "opt_cputype.h"
#include "opt_ddb.h"
@@ -1835,11 +1835,12 @@
int
kcopy(const void *from, void *to, size_t size)
{
- u_int oldh = curlwp->l_addr->u_pcb.pcb_onfault;
+ struct pcb *pcb = lwp_getpcb(curlwp);
+ u_int oldh = pcb->pcb_onfault;
- curlwp->l_addr->u_pcb.pcb_onfault = (u_int)©_on_fault;
+ pcb->pcb_onfault = (u_int)©_on_fault;
memcpy(to, from, size);
- curlwp->l_addr->u_pcb.pcb_onfault = oldh;
+ pcb->pcb_onfault = oldh;
return 0;
}
@@ -1854,7 +1855,7 @@
struct trapframe *tf = l->l_md.md_regs;
pmap_t pmap = p->p_vmspace->vm_map.pmap;
pa_space_t space = pmap->pm_space;
- struct pcb *pcb = &l->l_addr->u_pcb;
+ struct pcb *pcb = lwp_getpcb(l);
tf->tf_flags = TFF_SYS|TFF_LAST;
tf->tf_iioq_tail = 4 +
diff -r 9959a16c0d7a -r dfe9424e6a7e sys/arch/hppa/hppa/core_machdep.c
--- a/sys/arch/hppa/hppa/core_machdep.c Sat Nov 21 15:13:14 2009 +0000
+++ b/sys/arch/hppa/hppa/core_machdep.c Sat Nov 21 15:36:33 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: core_machdep.c,v 1.3 2009/11/03 05:07:26 snj Exp $ */
Home |
Main Index |
Thread Index |
Old Index