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 ARM (and acorn26/32), clean fro...
details: https://anonhg.NetBSD.org/src/rev/b7b10f3e3ef2
branches: trunk
changeset: 749220:b7b10f3e3ef2
user: rmind <rmind%NetBSD.org@localhost>
date: Sat Nov 21 20:32:13 2009 +0000
description:
Use lwp_getpcb() on ARM (and acorn26/32), clean from struct user usage.
diffstat:
sys/arch/acorn26/acorn26/cpu.c | 5 +--
sys/arch/acorn26/acorn26/cpuswitch.c | 11 ++++---
sys/arch/acorn26/acorn26/except.c | 23 +++++++++--------
sys/arch/acorn26/acorn26/fpu.c | 5 +--
sys/arch/acorn26/acorn26/machdep.c | 6 ++--
sys/arch/acorn26/acorn26/start.c | 5 +--
sys/arch/acorn26/acorn26/stubs.c | 5 +--
sys/arch/acorn26/acorn26/vm_machdep.c | 26 +++++++++---------
sys/arch/arm/arm/arm_machdep.c | 15 ++++++-----
sys/arch/arm/arm/ast.c | 12 +++++---
sys/arch/arm/arm/compat_13_machdep.c | 9 +++---
sys/arch/arm/arm/compat_16_machdep.c | 5 +--
sys/arch/arm/arm/db_trace.c | 13 ++++-----
sys/arch/arm/arm/linux_syscall.c | 5 +--
sys/arch/arm/arm/linux_trap.c | 5 +--
sys/arch/arm/arm/process_machdep.c | 5 +--
sys/arch/arm/arm/sig_machdep.c | 5 +--
sys/arch/arm/arm/syscall.c | 12 +++++---
sys/arch/arm/arm/undefined.c | 5 +--
sys/arch/arm/arm32/arm32_machdep.c | 6 ++--
sys/arch/arm/arm32/fault.c | 30 ++++++++++++----------
sys/arch/arm/arm32/pmap.c | 5 +--
sys/arch/arm/arm32/vm_machdep.c | 41 +++++++++++++++++-------------
sys/arch/arm/fpe-arm/armfpe_init.c | 5 +--
sys/arch/arm/include/cpu.h | 5 +--
sys/arch/arm/include/frame.h | 4 +-
sys/arch/arm/include/proc.h | 4 ++-
sys/arch/arm/s3c2xx0/sscom.c | 5 +--
sys/arch/arm/s3c2xx0/sscom_s3c2410.c | 5 +--
sys/arch/arm/s3c2xx0/sscom_s3c2800.c | 5 +--
sys/arch/arm/vfp/vfp_init.c | 46 +++++++++++++++++++---------------
sys/arch/evbarm/dev/plcom.c | 5 +--
32 files changed, 174 insertions(+), 169 deletions(-)
diffs (truncated from 1377 to 300 lines):
diff -r bb2e85f9c7d0 -r b7b10f3e3ef2 sys/arch/acorn26/acorn26/cpu.c
--- a/sys/arch/acorn26/acorn26/cpu.c Sat Nov 21 19:59:51 2009 +0000
+++ b/sys/arch/acorn26/acorn26/cpu.c Sat Nov 21 20:32:13 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu.c,v 1.27 2009/03/18 10:22:21 cegger Exp $ */
+/* $NetBSD: cpu.c,v 1.28 2009/11/21 20:32:13 rmind Exp $ */
/*-
* Copyright (c) 2000, 2001 Ben Harris
@@ -32,13 +32,12 @@
#include <sys/param.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.27 2009/03/18 10:22:21 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.28 2009/11/21 20:32:13 rmind Exp $");
#include <sys/device.h>
#include <sys/proc.h>
#include <sys/systm.h>
#include <sys/time.h>
-#include <sys/user.h>
#include <uvm/uvm_extern.h>
#include <arm/armreg.h>
#include <arm/cpuconf.h>
diff -r bb2e85f9c7d0 -r b7b10f3e3ef2 sys/arch/acorn26/acorn26/cpuswitch.c
--- a/sys/arch/acorn26/acorn26/cpuswitch.c Sat Nov 21 19:59:51 2009 +0000
+++ b/sys/arch/acorn26/acorn26/cpuswitch.c Sat Nov 21 20:32:13 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpuswitch.c,v 1.16 2008/06/23 17:58:17 matt Exp $ */
+/* $NetBSD: cpuswitch.c,v 1.17 2009/11/21 20:32:17 rmind Exp $ */
/*
* Copyright (c) 2000 Ben Harris.
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpuswitch.c,v 1.16 2008/06/23 17:58:17 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpuswitch.c,v 1.17 2009/11/21 20:32:17 rmind Exp $");
#include "opt_lockdebug.h"
@@ -46,7 +46,6 @@
#include <sys/proc.h>
#include <sys/sched.h>
#include <sys/systm.h>
-#include <sys/user.h>
#include <sys/ras.h>
#include <sys/cpu.h>
@@ -62,6 +61,7 @@
cpu_switchto(lwp_t *old, lwp_t *new, bool returning)
{
struct cpu_info * const ci = curcpu();
+ struct pcb *pcb;
struct proc *p2;
/*
@@ -73,13 +73,14 @@
#endif
curlwp = new;
- ci->ci_curpcb = &curlwp->l_addr->u_pcb;
+ pcb = lwp_getpcb(curlwp);
+ ci->ci_curpcb = pcb;
if ((new->l_flag & LW_SYSTEM) == 0) {
/* Check for Restartable Atomic Sequences. */
p2 = new->l_proc;
if (p2->p_raslist != NULL) {
- struct trapframe *tf = new->l_addr->u_pcb.pcb_tf;
+ struct trapframe *tf = pcb->pcb_tf;
void *pc;
pc = ras_lookup(p2, (void *)(tf->tf_r15 & R15_PC));
diff -r bb2e85f9c7d0 -r b7b10f3e3ef2 sys/arch/acorn26/acorn26/except.c
--- a/sys/arch/acorn26/acorn26/except.c Sat Nov 21 19:59:51 2009 +0000
+++ b/sys/arch/acorn26/acorn26/except.c Sat Nov 21 20:32:13 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: except.c,v 1.22 2009/03/18 10:22:21 cegger Exp $ */
+/* $NetBSD: except.c,v 1.23 2009/11/21 20:32:17 rmind Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 Ben Harris
* All rights reserved.
@@ -31,7 +31,7 @@
#include <sys/param.h>
-__KERNEL_RCSID(0, "$NetBSD: except.c,v 1.22 2009/03/18 10:22:21 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: except.c,v 1.23 2009/11/21 20:32:17 rmind Exp $");
#include "opt_ddb.h"
@@ -40,7 +40,6 @@
#include <sys/kernel.h>
#include <sys/syslog.h>
#include <sys/systm.h>
-#include <sys/user.h>
#include <sys/cpu.h>
#include <uvm/uvm_extern.h>
@@ -89,7 +88,6 @@
}
#endif
-
void
prefetch_abort_handler(struct trapframe *tf)
{
@@ -115,7 +113,8 @@
p = l->l_proc;
if ((tf->tf_r15 & R15_MODE) == R15_MODE_USR) {
- l->l_addr->u_pcb.pcb_tf = tf;
+ struct pcb *pcb = lwp_getpcb(l);
+ pcb->pcb_tf = tf;
LWP_CACHE_CREDS(l, p);
}
@@ -139,7 +138,7 @@
userret(l);
}
-
+
void
data_abort_handler(struct trapframe *tf)
{
@@ -171,7 +170,8 @@
l = &lwp0;
p = l->l_proc;
if ((tf->tf_r15 & R15_MODE) == R15_MODE_USR) {
- l->l_addr->u_pcb.pcb_tf = tf;
+ struct pcb *pcb = lwp_getpcb(l);
+ pcb->pcb_tf = tf;
LWP_CACHE_CREDS(l, p);
}
pc = tf->tf_r15 & R15_PC;
@@ -214,7 +214,7 @@
if (error != 0) {
ksiginfo_t ksi;
- cur_pcb = &l->l_addr->u_pcb;
+ cur_pcb = lwp_getpcb(l);
if (cur_pcb->pcb_onfault != NULL) {
tf->tf_r0 = error;
tf->tf_r15 = (tf->tf_r15 & ~R15_PC) |
@@ -455,7 +455,7 @@
return true;
return false;
}
-
+
void
address_exception_handler(struct trapframe *tf)
{
@@ -471,7 +471,8 @@
if (l == NULL)
l = &lwp0;
if ((tf->tf_r15 & R15_MODE) == R15_MODE_USR) {
- l->l_addr->u_pcb.pcb_tf = tf;
+ struct pcb *pcb = lwp_getpcb(l);
+ pcb->pcb_tf = tf;
LWP_CACHE_CREDS(l, l->l_proc);
}
@@ -506,7 +507,7 @@
trapsignal(l, &ksi);
userret(l);
}
-
+
#ifdef DEBUG
static void
printregs(struct trapframe *tf)
diff -r bb2e85f9c7d0 -r b7b10f3e3ef2 sys/arch/acorn26/acorn26/fpu.c
--- a/sys/arch/acorn26/acorn26/fpu.c Sat Nov 21 19:59:51 2009 +0000
+++ b/sys/arch/acorn26/acorn26/fpu.c Sat Nov 21 20:32:13 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: fpu.c,v 1.10 2009/05/12 06:31:37 cegger Exp $ */
+/* $NetBSD: fpu.c,v 1.11 2009/11/21 20:32:17 rmind Exp $ */
/*-
* Copyright (c) 2000, 2001 Ben Harris
@@ -32,12 +32,11 @@
#include <sys/param.h>
-__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.10 2009/05/12 06:31:37 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu.c,v 1.11 2009/11/21 20:32:17 rmind Exp $");
#include <sys/device.h>
#include <sys/proc.h>
#include <sys/systm.h>
-#include <sys/user.h>
#include <arm/undefined.h>
#include <machine/fpureg.h>
#include <machine/pcb.h>
diff -r bb2e85f9c7d0 -r b7b10f3e3ef2 sys/arch/acorn26/acorn26/machdep.c
--- a/sys/arch/acorn26/acorn26/machdep.c Sat Nov 21 19:59:51 2009 +0000
+++ b/sys/arch/acorn26/acorn26/machdep.c Sat Nov 21 20:32:13 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.31 2009/08/11 17:04:14 matt Exp $ */
+/* $NetBSD: machdep.c,v 1.32 2009/11/21 20:32:17 rmind Exp $ */
/*-
* Copyright (c) 1998 Ben Harris
@@ -32,7 +32,7 @@
#include <sys/param.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.31 2009/08/11 17:04:14 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.32 2009/11/21 20:32:17 rmind Exp $");
#include <sys/buf.h>
#include <sys/kernel.h>
@@ -168,7 +168,7 @@
format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
printf("avail memory = %s\n", pbuf);
- curpcb = &lwp0.l_addr->u_pcb;
+ curpcb = lwp_getpcb(&lwp0);
#if 0
/* Test exception handlers */
diff -r bb2e85f9c7d0 -r b7b10f3e3ef2 sys/arch/acorn26/acorn26/start.c
--- a/sys/arch/acorn26/acorn26/start.c Sat Nov 21 19:59:51 2009 +0000
+++ b/sys/arch/acorn26/acorn26/start.c Sat Nov 21 20:32:13 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: start.c,v 1.14 2009/03/18 16:00:08 cegger Exp $ */
+/* $NetBSD: start.c,v 1.15 2009/11/21 20:32:17 rmind Exp $ */
/*-
* Copyright (c) 1998, 2000 Ben Harris
* All rights reserved.
@@ -31,12 +31,11 @@
#include <sys/param.h>
-__KERNEL_RCSID(0, "$NetBSD: start.c,v 1.14 2009/03/18 16:00:08 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: start.c,v 1.15 2009/11/21 20:32:17 rmind Exp $");
#include "opt_modular.h"
#include <sys/msgbuf.h>
-#include <sys/user.h>
#include <sys/syslog.h>
#include <sys/systm.h>
diff -r bb2e85f9c7d0 -r b7b10f3e3ef2 sys/arch/acorn26/acorn26/stubs.c
--- a/sys/arch/acorn26/acorn26/stubs.c Sat Nov 21 19:59:51 2009 +0000
+++ b/sys/arch/acorn26/acorn26/stubs.c Sat Nov 21 20:32:13 2009 +0000
@@ -1,15 +1,14 @@
-/* $NetBSD: stubs.c,v 1.9 2009/03/14 15:35:58 dsl Exp $ */
+/* $NetBSD: stubs.c,v 1.10 2009/11/21 20:32:17 rmind Exp $ */
/*
* stubs.c -- functions I haven't written yet
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: stubs.c,v 1.9 2009/03/14 15:35:58 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: stubs.c,v 1.10 2009/11/21 20:32:17 rmind Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
#include <sys/systm.h>
-#include <sys/user.h>
#include <uvm/uvm_extern.h>
diff -r bb2e85f9c7d0 -r b7b10f3e3ef2 sys/arch/acorn26/acorn26/vm_machdep.c
--- a/sys/arch/acorn26/acorn26/vm_machdep.c Sat Nov 21 19:59:51 2009 +0000
+++ b/sys/arch/acorn26/acorn26/vm_machdep.c Sat Nov 21 20:32:13 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vm_machdep.c,v 1.22 2009/10/21 21:11:58 rmind Exp $ */
+/* $NetBSD: vm_machdep.c,v 1.23 2009/11/21 20:32:17 rmind Exp $ */
/*-
* Copyright (c) 2000, 2001 Ben Harris
@@ -64,14 +64,13 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.22 2009/10/21 21:11:58 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vm_machdep.c,v 1.23 2009/11/21 20:32:17 rmind Exp $");
#include <sys/param.h>
#include <sys/buf.h>
#include <sys/mount.h> /* XXX syscallargs.h uses fhandle_t and fsid_t */
#include <sys/proc.h>
#include <sys/syscallargs.h>
-#include <sys/user.h>
#include <sys/sched.h>
#include <sys/mutex.h>
@@ -98,16 +97,15 @@
/*
* Note:
*
- * p->p_addr points to a page containing the user structure
- * (see <sys/user.h>) and the kernel stack. The user structure has to be
Home |
Main Index |
Thread Index |
Old Index