Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/nathanw_sa]: src/sys/arch/powerpc LWPify.



details:   https://anonhg.NetBSD.org/src/rev/def895046566
branches:  nathanw_sa
changeset: 506087:def895046566
user:      nathanw <nathanw%NetBSD.org@localhost>
date:      Thu Aug 01 04:03:21 2002 +0000

description:
LWPify.

diffstat:

 sys/arch/powerpc/include/altivec.h       |   6 ++--
 sys/arch/powerpc/include/cpu.h           |   4 +-
 sys/arch/powerpc/include/fpu.h           |   6 ++--
 sys/arch/powerpc/mpc6xx/altivec.c        |  35 ++++++++++++++++---------------
 sys/arch/powerpc/mpc6xx/mpc6xx_machdep.c |   9 ++++---
 5 files changed, 31 insertions(+), 29 deletions(-)

diffs (201 lines):

diff -r dcb4f7c8bfe0 -r def895046566 sys/arch/powerpc/include/altivec.h
--- a/sys/arch/powerpc/include/altivec.h        Thu Aug 01 03:31:28 2002 +0000
+++ b/sys/arch/powerpc/include/altivec.h        Thu Aug 01 04:03:21 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: altivec.h,v 1.1.10.1 2002/08/01 02:43:02 nathanw Exp $ */
+/*     $NetBSD: altivec.h,v 1.1.10.2 2002/08/01 04:03:21 nathanw Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -45,9 +45,9 @@
 #ifdef _KERNEL
 void enable_vec(void);
 void save_vec_cpu(void);
-void save_vec_proc(struct proc *);
+void save_vec_lwp(struct lwp *);
 #ifdef MULTIPROCESSOR
-void mp_save_vec_proc(struct proc *);
+void mp_save_vec_lwp(struct lwp *);
 #endif
 void init_vec(void);
 void vzeropage(paddr_t);
diff -r dcb4f7c8bfe0 -r def895046566 sys/arch/powerpc/include/cpu.h
--- a/sys/arch/powerpc/include/cpu.h    Thu Aug 01 03:31:28 2002 +0000
+++ b/sys/arch/powerpc/include/cpu.h    Thu Aug 01 04:03:21 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpu.h,v 1.10.6.8 2002/08/01 02:43:03 nathanw Exp $     */
+/*     $NetBSD: cpu.h,v 1.10.6.9 2002/08/01 04:03:21 nathanw Exp $     */
 
 /*
  * Copyright (C) 1999 Wolfgang Solfrank.
@@ -70,7 +70,7 @@
 
        struct pcb *ci_curpcb;
        struct pmap *ci_curpm;
-       struct lwp *ci_fprlwp;
+       struct lwp *ci_fpulwp;
        struct lwp *ci_veclwp;
        struct pcb *ci_idle_pcb;        /* PA of our idle pcb */
        int ci_cpuid;
diff -r dcb4f7c8bfe0 -r def895046566 sys/arch/powerpc/include/fpu.h
--- a/sys/arch/powerpc/include/fpu.h    Thu Aug 01 03:31:28 2002 +0000
+++ b/sys/arch/powerpc/include/fpu.h    Thu Aug 01 04:03:21 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fpu.h,v 1.4.8.5 2002/08/01 02:43:03 nathanw Exp $      */
+/*     $NetBSD: fpu.h,v 1.4.8.6 2002/08/01 04:03:22 nathanw Exp $      */
 
 /*-
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -78,9 +78,9 @@
 
 void   enable_fpu(void);
 void   save_fpu_cpu(void);
-void   save_fpu_proc(struct lwp *);
+void   save_fpu_lwp(struct lwp *);
 #ifdef MULTIPROCESSOR
-void   mp_save_fpu_proc(struct lwp *);
+void   mp_save_fpu_lwp(struct lwp *);
 #endif
 #endif /* PPC_HAVE_FPU */
 #endif /* _KERNEL */
diff -r dcb4f7c8bfe0 -r def895046566 sys/arch/powerpc/mpc6xx/altivec.c
--- a/sys/arch/powerpc/mpc6xx/altivec.c Thu Aug 01 03:31:28 2002 +0000
+++ b/sys/arch/powerpc/mpc6xx/altivec.c Thu Aug 01 04:03:21 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: altivec.c,v 1.6.2.2 2002/08/01 02:43:07 nathanw Exp $  */
+/*     $NetBSD: altivec.c,v 1.6.2.3 2002/08/01 04:03:52 nathanw Exp $  */
 
 /*
  * Copyright (C) 1996 Wolfgang Solfrank.
@@ -32,6 +32,7 @@
  */
 #include <sys/param.h>
 #include <sys/proc.h>
+#include <sys/sa.h>
 #include <sys/systm.h>
 #include <sys/user.h>
 #include <sys/malloc.h>
@@ -47,9 +48,9 @@
 enable_vec()
 {
        struct cpu_info *ci = curcpu();
-       struct proc *p = curproc;
-       struct pcb *pcb = &p->p_addr->u_pcb;
-       struct trapframe *tf = trapframe(p);
+       struct lwp *l = curlwp;
+       struct pcb *pcb = &l->l_addr->u_pcb;
+       struct trapframe *tf = trapframe(l);
        struct vreg *vr = pcb->pcb_vr;
        int msr, scratch;
 
@@ -82,10 +83,10 @@
        msr = mfmsr();
        mtmsr((msr & ~PSL_EE) | PSL_VEC);
        __asm __volatile ("isync");
-       if (ci->ci_vecproc) {
+       if (ci->ci_veclwp) {
                save_vec_cpu();
        }
-       KASSERT(curcpu()->ci_vecproc == NULL);
+       KASSERT(curcpu()->ci_veclwp == NULL);
 
        /*
         * Restore VSCR by first loading it into a vector and then into VSCR.
@@ -122,7 +123,7 @@
         * Record the new ownership of the AltiVec unit.
         */
        tf->srr1 |= PSL_VEC;
-       curcpu()->ci_vecproc = p;
+       curcpu()->ci_veclwp = l;
        pcb->pcb_veccpu = curcpu();
        __asm __volatile ("sync");
 
@@ -136,7 +137,7 @@
 save_vec_cpu(void)
 {
        struct cpu_info *ci = curcpu();
-       struct proc *p;
+       struct lwp *l;
        struct pcb *pcb;
        struct vreg *vr;
        struct trapframe *tf;
@@ -148,13 +149,13 @@
        msr = mfmsr();
        mtmsr((msr & ~PSL_EE) | PSL_VEC);
        __asm __volatile ("isync");
-       p = ci->ci_vecproc;
-       if (p == NULL) {
+       l = ci->ci_veclwp;
+       if (l == NULL) {
                goto out;
        }
-       pcb = &p->p_addr->u_pcb;
+       pcb = &l->l_addr->u_pcb;
        vr = pcb->pcb_vr;
-       tf = trapframe(p);
+       tf = trapframe(l);
 
 #define        STVX(n,vr)      __asm /*__volatile*/("stvx %2,%0,%1" \
            ::  "r"(vr), "r"(offsetof(struct vreg, vreg[n])), "n"(n));
@@ -190,7 +191,7 @@
         */
        tf->srr1 &= ~PSL_VEC;
        pcb->pcb_veccpu = NULL;
-       ci->ci_vecproc = NULL;
+       ci->ci_veclwp = NULL;
        __asm __volatile ("dssall; sync");
 
  out:
@@ -208,10 +209,10 @@
  * this function).
  */
 void
-save_vec_proc(p)
-       struct proc *p;
+save_vec_lwp(l)
+       struct lwp *l;
 {
-       struct pcb *pcb = &p->p_addr->u_pcb;
+       struct pcb *pcb = &l->l_addr->u_pcb;
        struct cpu_info *ci = curcpu();
 
        /*
@@ -227,7 +228,7 @@
         * state.
         */
 
-       if (p == ci->ci_vecproc) {
+       if (l == ci->ci_veclwp) {
                save_vec_cpu();
                return;
        }
diff -r dcb4f7c8bfe0 -r def895046566 sys/arch/powerpc/mpc6xx/mpc6xx_machdep.c
--- a/sys/arch/powerpc/mpc6xx/mpc6xx_machdep.c  Thu Aug 01 03:31:28 2002 +0000
+++ b/sys/arch/powerpc/mpc6xx/mpc6xx_machdep.c  Thu Aug 01 04:03:21 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mpc6xx_machdep.c,v 1.4.2.2 2002/08/01 02:43:07 nathanw Exp $   */
+/*     $NetBSD: mpc6xx_machdep.c,v 1.4.2.3 2002/08/01 04:03:52 nathanw Exp $   */
 
 /*
  * Copyright (C) 2002 Matt Thomas
@@ -49,6 +49,7 @@
 #include <sys/msgbuf.h>
 #include <sys/proc.h>
 #include <sys/reboot.h>
+#include <sys/sa.h>
 #include <sys/syscallargs.h>
 #include <sys/syslog.h>
 #include <sys/systm.h>
@@ -134,9 +135,9 @@
        /*
         * Initialize proc0 and current pcb and pmap pointers.
         */
-       proc0.p_cpu = ci;
-       proc0.p_addr = proc0paddr;
-       memset(proc0.p_addr, 0, sizeof *proc0.p_addr);
+       lwp0.l_cpu = ci;
+       lwp0.l_addr = proc0paddr;
+       memset(lwp0.l_addr, 0, sizeof *lwp0.l_addr);
 
        curpcb = &proc0paddr->u_pcb;
        curpm = curpcb->pcb_pmreal = curpcb->pcb_pm = pmap_kernel();



Home | Main Index | Thread Index | Old Index