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 mips, powerpc and sh3, clean fr...



details:   https://anonhg.NetBSD.org/src/rev/15e3a9d03234
branches:  trunk
changeset: 749213:15e3a9d03234
user:      rmind <rmind%NetBSD.org@localhost>
date:      Sat Nov 21 17:40:27 2009 +0000

description:
Use lwp_getpcb() on mips, powerpc and sh3, clean from struct user usage.

diffstat:

 sys/arch/evbppc/ev64260/com_obio.c           |   5 +--
 sys/arch/evbppc/pmppc/machdep.c              |   5 +--
 sys/arch/mips/adm5120/dev/uart.c             |   5 +--
 sys/arch/mips/include/cpu.h                  |   4 +-
 sys/arch/mips/include/proc.h                 |   3 +-
 sys/arch/mips/mips/compat_13_machdep.c       |  11 ++++---
 sys/arch/mips/mips/compat_16_machdep.c       |  18 ++++++++-----
 sys/arch/mips/mips/core_machdep.c            |   9 +++--
 sys/arch/mips/mips/db_interface.c            |  12 +++++--
 sys/arch/mips/mips/db_trace.c                |   7 ++--
 sys/arch/mips/mips/kgdb_machdep.c            |   5 +--
 sys/arch/mips/mips/linux_trap.c              |   5 +--
 sys/arch/mips/mips/mips_emul.c               |   5 +--
 sys/arch/mips/mips/mips_machdep.c            |  32 +++++++++++++++--------
 sys/arch/mips/mips/pmap.c                    |   5 +--
 sys/arch/mips/mips/process_machdep.c         |  11 ++++---
 sys/arch/mips/mips/sig_machdep.c             |   5 +--
 sys/arch/mips/mips/svr4_machdep.c            |   5 +--
 sys/arch/mips/mips/syscall.c                 |   5 +--
 sys/arch/mips/mips/trap.c                    |  32 ++++++++++++++++-------
 sys/arch/mips/mips/vm_machdep.c              |  27 ++++++++++---------
 sys/arch/mips/sibyte/dev/sbjcn.c             |   5 +--
 sys/arch/mips/sibyte/dev/sbscn.c             |   5 +--
 sys/arch/powerpc/ibm4xx/ibm4xx_machdep.c     |   9 ++---
 sys/arch/powerpc/ibm4xx/pmap.c               |   5 +--
 sys/arch/powerpc/ibm4xx/trap.c               |  26 ++++++++++--------
 sys/arch/powerpc/include/proc.h              |   4 ++-
 sys/arch/powerpc/include/userret.h           |   4 +-
 sys/arch/powerpc/oea/altivec.c               |  13 ++++-----
 sys/arch/powerpc/oea/cpu_subr.c              |  11 ++++---
 sys/arch/powerpc/oea/oea_machdep.c           |   7 ++--
 sys/arch/powerpc/oea/pmap.c                  |   7 ++--
 sys/arch/powerpc/powerpc/compat_13_machdep.c |   5 +--
 sys/arch/powerpc/powerpc/compat_16_machdep.c |  22 ++++++++++-----
 sys/arch/powerpc/powerpc/core_machdep.c      |   7 ++--
 sys/arch/powerpc/powerpc/db_trace.c          |  11 +++----
 sys/arch/powerpc/powerpc/fpu.c               |  13 ++++-----
 sys/arch/powerpc/powerpc/linux_trap.c        |   5 +--
 sys/arch/powerpc/powerpc/mach_machdep.c      |   5 +--
 sys/arch/powerpc/powerpc/powerpc_machdep.c   |   8 ++--
 sys/arch/powerpc/powerpc/process_machdep.c   |  13 ++++-----
 sys/arch/powerpc/powerpc/sig_machdep.c       |   9 ++---
 sys/arch/powerpc/powerpc/syscall.c           |   8 ++--
 sys/arch/powerpc/powerpc/trap.c              |  11 +++----
 sys/arch/powerpc/powerpc/vm_machdep.c        |  38 +++++++++++++--------------
 sys/arch/sgimips/dev/scn.c                   |   5 +--
 sys/arch/sgimips/mace/com_mace.c             |   5 +--
 sys/arch/sgimips/mace/lpt_mace.c             |   5 +--
 sys/arch/sh3/include/proc.h                  |   3 +-
 sys/arch/sh3/sh3/core_machdep.c              |   5 +--
 sys/arch/sh3/sh3/db_interface.c              |  11 ++-----
 sys/arch/sh3/sh3/exception.c                 |   5 +--
 sys/arch/sh3/sh3/kgdb_machdep.c              |   5 +--
 sys/arch/sh3/sh3/locore_c.c                  |   5 +--
 sys/arch/sh3/sh3/process_machdep.c           |   5 +--
 sys/arch/sh3/sh3/sh3_machdep.c               |  11 ++++---
 sys/arch/sh3/sh3/vm_machdep.c                |  11 +++----
 57 files changed, 275 insertions(+), 268 deletions(-)

diffs (truncated from 2259 to 300 lines):

diff -r 434a12171159 -r 15e3a9d03234 sys/arch/evbppc/ev64260/com_obio.c
--- a/sys/arch/evbppc/ev64260/com_obio.c        Sat Nov 21 15:38:43 2009 +0000
+++ b/sys/arch/evbppc/ev64260/com_obio.c        Sat Nov 21 17:40:27 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: com_obio.c,v 1.8 2008/04/28 20:23:17 martin Exp $      */
+/*     $NetBSD: com_obio.c,v 1.9 2009/11/21 17:40:28 rmind Exp $       */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: com_obio.c,v 1.8 2008/04/28 20:23:17 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: com_obio.c,v 1.9 2009/11/21 17:40:28 rmind Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -69,7 +69,6 @@
 #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>
diff -r 434a12171159 -r 15e3a9d03234 sys/arch/evbppc/pmppc/machdep.c
--- a/sys/arch/evbppc/pmppc/machdep.c   Sat Nov 21 15:38:43 2009 +0000
+++ b/sys/arch/evbppc/pmppc/machdep.c   Sat Nov 21 17:40:27 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.7 2009/03/18 10:22:28 cegger Exp $       */
+/*     $NetBSD: machdep.c,v 1.8 2009/11/21 17:40:28 rmind Exp $        */
 
 /*
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.7 2009/03/18 10:22:28 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.8 2009/11/21 17:40:28 rmind Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_ddb.h"
@@ -90,7 +90,6 @@
 #include <sys/syslog.h>
 #include <sys/sysctl.h>
 #include <sys/systm.h>
-#include <sys/user.h>
 #include <sys/ksyms.h>
 
 #include <uvm/uvm.h>
diff -r 434a12171159 -r 15e3a9d03234 sys/arch/mips/adm5120/dev/uart.c
--- a/sys/arch/mips/adm5120/dev/uart.c  Sat Nov 21 15:38:43 2009 +0000
+++ b/sys/arch/mips/adm5120/dev/uart.c  Sat Nov 21 17:40:27 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uart.c,v 1.5 2008/06/11 23:55:20 cegger Exp $ */
+/* $NetBSD: uart.c,v 1.6 2009/11/21 17:40:27 rmind Exp $ */
 
 /*-
  * Copyright (c) 2007 Ruslan Ermilov and Vsevolod Lobko.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uart.c,v 1.5 2008/06/11 23:55:20 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uart.c,v 1.6 2009/11/21 17:40:27 rmind Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -42,7 +42,6 @@
 #include <sys/device.h>
 
 #include <sys/proc.h>
-#include <sys/user.h>
 #include <sys/buf.h>
 #include <sys/ioctl.h>
 #include <sys/kauth.h>
diff -r 434a12171159 -r 15e3a9d03234 sys/arch/mips/include/cpu.h
--- a/sys/arch/mips/include/cpu.h       Sat Nov 21 15:38:43 2009 +0000
+++ b/sys/arch/mips/include/cpu.h       Sat Nov 21 17:40:27 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.91 2009/10/21 21:12:00 rmind Exp $   */
+/*     $NetBSD: cpu.h,v 1.92 2009/11/21 17:40:27 rmind Exp $   */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -139,7 +139,7 @@
 
 #define        curlwp                  mips_curlwp
 #define        curcpu()                (curlwp->l_cpu)
-#define        curpcb                  ((struct pcb *)curlwp->l_addr)
+#define        curpcb                  ((struct pcb *)lwp_getpcb(curlwp))
 #define        fpcurlwp                (curcpu()->ci_fpcurlwp)
 #define        cpu_number()            (0)
 #define        cpu_proc_fork(p1, p2)
diff -r 434a12171159 -r 15e3a9d03234 sys/arch/mips/include/proc.h
--- a/sys/arch/mips/include/proc.h      Sat Nov 21 15:38:43 2009 +0000
+++ b/sys/arch/mips/include/proc.h      Sat Nov 21 17:40:27 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: proc.h,v 1.23 2009/08/20 01:33:39 cliff Exp $  */
+/*     $NetBSD: proc.h,v 1.24 2009/11/21 17:40:27 rmind Exp $  */
 
 /*
  * Copyright (c) 1992, 1993
@@ -38,6 +38,7 @@
 #define _MIPS_PROC_H_
 
 #include <sys/param.h>
+#include <sys/user.h> /* for sizeof(struct user) */
 #include <mips/vmparam.h>
 
 struct lwp;
diff -r 434a12171159 -r 15e3a9d03234 sys/arch/mips/mips/compat_13_machdep.c
--- a/sys/arch/mips/mips/compat_13_machdep.c    Sat Nov 21 15:38:43 2009 +0000
+++ b/sys/arch/mips/mips/compat_13_machdep.c    Sat Nov 21 17:40:27 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_13_machdep.c,v 1.16 2008/04/24 18:39:21 ad Exp $        */
+/*     $NetBSD: compat_13_machdep.c,v 1.17 2009/11/21 17:40:28 rmind Exp $     */
 
 /*
  * Copyright 1996 The Board of Trustees of The Leland Stanford
@@ -15,14 +15,13 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: compat_13_machdep.c,v 1.16 2008/04/24 18:39:21 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_13_machdep.c,v 1.17 2009/11/21 17:40:28 rmind Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/signalvar.h>
 #include <sys/kernel.h>
 #include <sys/proc.h>
-#include <sys/user.h>
 #include <sys/mount.h>
 #include <sys/syscallargs.h>
 
@@ -74,8 +73,10 @@
        f->f_regs[_R_MULHI] = ksc.mulhi;
        memcpy(&f->f_regs[1], &scp->sc_regs[1],
            sizeof(scp->sc_regs) - sizeof(scp->sc_regs[0]));
-       if (scp->sc_fpused)
-               l->l_addr->u_pcb.pcb_fpregs = *(struct fpreg *)scp->sc_fpregs;
+       if (scp->sc_fpused) {
+               struct pcb *pcb = lwp_getpcb(l);
+               pcb->pcb_fpregs = *(struct fpreg *)scp->sc_fpregs;
+       }
 
        mutex_enter(p->p_lock);
 
diff -r 434a12171159 -r 15e3a9d03234 sys/arch/mips/mips/compat_16_machdep.c
--- a/sys/arch/mips/mips/compat_16_machdep.c    Sat Nov 21 15:38:43 2009 +0000
+++ b/sys/arch/mips/mips/compat_16_machdep.c    Sat Nov 21 17:40:27 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_16_machdep.c,v 1.13 2008/11/21 06:57:35 he Exp $        */
+/*     $NetBSD: compat_16_machdep.c,v 1.14 2009/11/21 17:40:28 rmind Exp $     */
 
 /*-
  * Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -45,7 +45,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
        
-__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.13 2008/11/21 06:57:35 he Exp $"); 
+__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.14 2009/11/21 17:40:28 rmind Exp $"); 
 
 #ifdef _KERNEL_OPT
 #include "opt_cputype.h"
@@ -57,7 +57,6 @@
 #include <sys/systm.h>
 #include <sys/kernel.h>
 #include <sys/proc.h>
-#include <sys/user.h>
 #include <sys/signal.h>
 #include <sys/signalvar.h>
 #include <sys/mount.h>
@@ -88,6 +87,7 @@
        int sig = ksi->ksi_signo;
        struct lwp *l = curlwp;
        struct proc *p = l->l_proc;
+       struct pcb *pcb;
        struct sigacts *ps = p->p_sigacts;
        int onstack, error;
        struct sigcontext *scp = getframe(l, sig, &onstack), ksc;
@@ -116,16 +116,17 @@
            sizeof(ksc.sc_regs) - sizeof(ksc.sc_regs[0]));
 
        /* Save the FP state, if necessary, then copy it. */
+       pcb = lwp_getpcb(l);
 #ifndef SOFTFLOAT
        ksc.sc_fpused = l->l_md.md_flags & MDP_FPUSED;
        if (ksc.sc_fpused) {
                /* if FPU has current state, save it first */
                if (l == fpcurlwp)
                        savefpregs(l);
-               *(struct fpreg *)ksc.sc_fpregs = l->l_addr->u_pcb.pcb_fpregs;
+               *(struct fpreg *)ksc.sc_fpregs = pcb->pcb_fpregs;
        }
 #else
-       *(struct fpreg *)ksc.sc_fpregs = l->l_addr->u_pcb.pcb_fpregs;
+       *(struct fpreg *)ksc.sc_fpregs = pcb->pcb_fpregs;
 #endif
 
        /* Save signal stack. */
@@ -226,6 +227,7 @@
        struct sigcontext *scp, ksc;
        struct frame *f;
        struct proc *p = l->l_proc;
+       struct pcb *pcb;
        int error;
 
        /*
@@ -251,16 +253,18 @@
        f->f_regs[_R_MULHI] = ksc.mulhi;
        memcpy(&f->f_regs[1], &scp->sc_regs[1],
            sizeof(scp->sc_regs) - sizeof(scp->sc_regs[0]));
+
+       pcb = lwp_getpcb(l);
 #ifndef        SOFTFLOAT
        if (scp->sc_fpused) {
                /* Disable the FPU to fault in FP registers. */
                f->f_regs[_R_SR] &= ~MIPS_SR_COP_1_BIT;
                if (l == fpcurlwp)
                        fpcurlwp = NULL;
-               l->l_addr->u_pcb.pcb_fpregs = *(struct fpreg *)scp->sc_fpregs;
+               pcb->pcb_fpregs = *(struct fpreg *)scp->sc_fpregs;
        }
 #else
-       l->l_addr->u_pcb.pcb_fpregs = *(struct fpreg *)scp->sc_fpregs;
+       pcb->pcb_fpregs = *(struct fpreg *)scp->sc_fpregs;
 #endif
 
        mutex_enter(p->p_lock);
diff -r 434a12171159 -r 15e3a9d03234 sys/arch/mips/mips/core_machdep.c
--- a/sys/arch/mips/mips/core_machdep.c Sat Nov 21 15:38:43 2009 +0000
+++ b/sys/arch/mips/mips/core_machdep.c Sat Nov 21 17:40:27 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: core_machdep.c,v 1.1 2008/11/19 18:35:59 ad Exp $      */
+/*     $NetBSD: core_machdep.c,v 1.2 2009/11/21 17:40:28 rmind Exp $   */
 
 /*
  * Copyright (c) 1992, 1993
@@ -77,7 +77,7 @@
  */
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: core_machdep.c,v 1.1 2008/11/19 18:35:59 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: core_machdep.c,v 1.2 2009/11/21 17:40:28 rmind Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -85,7 +85,6 @@
 #include <sys/malloc.h>
 #include <sys/buf.h>
 #include <sys/vnode.h>
-#include <sys/user.h>
 #include <sys/core.h>
 #include <sys/exec.h>
 
@@ -105,6 +104,7 @@
 cpu_coredump(struct lwp *l, void *iocookie, struct core *chdr)
 {
        int error;
+       struct pcb *pcb;
        struct coreseg cseg;
        struct cpustate {
                struct frame frame;
@@ -122,8 +122,9 @@
 
        if ((l->l_md.md_flags & MDP_FPUSED) && l == fpcurlwp)
                savefpregs(l);
+       pcb = lwp_getpcb(l);
        cpustate.frame = *(struct frame *)l->l_md.md_regs;
-       cpustate.fpregs = l->l_addr->u_pcb.pcb_fpregs;
+       cpustate.fpregs = pcb->pcb_fpregs;
 
        CORE_SETMAGIC(cseg, CORESEGMAGIC, MID_MACHINE, CORE_CPU);
        cseg.c_addr = 0;
diff -r 434a12171159 -r 15e3a9d03234 sys/arch/mips/mips/db_interface.c
--- a/sys/arch/mips/mips/db_interface.c Sat Nov 21 15:38:43 2009 +0000
+++ b/sys/arch/mips/mips/db_interface.c Sat Nov 21 17:40:27 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_interface.c,v 1.64 2008/05/23 17:01:32 tsutsui Exp $        */
+/*     $NetBSD: db_interface.c,v 1.65 2009/11/21 17:40:28 rmind Exp $  */
 
 /*
  * Mach Operating System
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.64 2008/05/23 17:01:32 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_interface.c,v 1.65 2009/11/21 17:40:28 rmind Exp $");
 
 #include "opt_cputype.h"       /* which mips CPUs do we support? */
 #include "opt_ddb.h"
@@ -37,7 +37,6 @@
 #include <sys/systm.h>
 #include <sys/param.h>



Home | Main Index | Thread Index | Old Index