Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/powerpc Use l->l_md.md_utf in preference to...



details:   https://anonhg.NetBSD.org/src/rev/8ad9cdbe899c
branches:  trunk
changeset: 763305:8ad9cdbe899c
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Mar 16 21:15:29 2011 +0000

description:
Use l->l_md.md_utf in preference to trapframe(l).  This shrink the kernel
just a bit in size.

diffstat:

 sys/arch/powerpc/powerpc/compat_13_machdep.c |  10 ++++------
 sys/arch/powerpc/powerpc/compat_16_machdep.c |  17 ++++++++---------
 sys/arch/powerpc/powerpc/core_machdep.c      |   6 +++---
 sys/arch/powerpc/powerpc/darwin_machdep.c    |  20 +++++++++-----------
 sys/arch/powerpc/powerpc/mach_machdep.c      |  14 +++++---------
 sys/arch/powerpc/powerpc/powerpc_machdep.c   |  14 ++++++--------
 sys/arch/powerpc/powerpc/process_machdep.c   |  12 ++++++------
 sys/arch/powerpc/powerpc/sig_machdep.c       |   8 ++++----
 sys/arch/powerpc/powerpc/syscall.c           |   6 +++---
 sys/arch/powerpc/powerpc/trap.c              |  16 ++++++++--------
 10 files changed, 56 insertions(+), 67 deletions(-)

diffs (truncated from 443 to 300 lines):

diff -r 08f65edb4183 -r 8ad9cdbe899c sys/arch/powerpc/powerpc/compat_13_machdep.c
--- a/sys/arch/powerpc/powerpc/compat_13_machdep.c      Wed Mar 16 21:12:15 2011 +0000
+++ b/sys/arch/powerpc/powerpc/compat_13_machdep.c      Wed Mar 16 21:15:29 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_13_machdep.c,v 1.18 2011/01/18 01:02:55 matt Exp $      */
+/*     $NetBSD: compat_13_machdep.c,v 1.19 2011/03/16 21:15:29 matt Exp $      */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_13_machdep.c,v 1.18 2011/01/18 01:02:55 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_13_machdep.c,v 1.19 2011/03/16 21:15:29 matt Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ppcarch.h"
@@ -58,9 +58,9 @@
        /* {
                syscallarg(struct sigcontext13 *) sigcntxp;
        } */
-       struct proc *p = l->l_proc;
+       struct proc * const p = l->l_proc;
+       struct trapframe * const tf = l->l_md.md_utf;
        struct sigcontext13 sc;
-       struct trapframe *tf;
        int error;
        sigset_t mask;
 
@@ -72,8 +72,6 @@
        if ((error = copyin(SCARG(uap, sigcntxp), &sc, sizeof sc)) != 0)
                return (error);
 
-       /* Restore the register context. */
-       tf = trapframe(l);
        if (!PSL_USEROK_P(sc.sc_frame.srr1))
                return (EINVAL);
 
diff -r 08f65edb4183 -r 8ad9cdbe899c sys/arch/powerpc/powerpc/compat_16_machdep.c
--- a/sys/arch/powerpc/powerpc/compat_16_machdep.c      Wed Mar 16 21:12:15 2011 +0000
+++ b/sys/arch/powerpc/powerpc/compat_16_machdep.c      Wed Mar 16 21:15:29 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_16_machdep.c,v 1.16 2011/01/18 01:02:55 matt Exp $      */
+/*     $NetBSD: compat_16_machdep.c,v 1.17 2011/03/16 21:15:29 matt Exp $      */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.16 2011/01/18 01:02:55 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.17 2011/03/16 21:15:29 matt Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -61,18 +61,17 @@
 void
 sendsig_sigcontext(const ksiginfo_t *ksi, const sigset_t *mask)
 {
-       struct lwp *l = curlwp;
-       struct proc *p = l->l_proc;
-       struct sigacts *ps = p->p_sigacts;
+       struct lwp * const l = curlwp;
+       struct proc * const p = l->l_proc;
+       struct sigacts * const ps = p->p_sigacts;
        struct sigcontext *fp, frame;
-       struct trapframe *tf;
-       struct utrapframe *utf = &frame.sc_frame;
+       struct trapframe * const tf = l->l_md.md_utf;
+       struct utrapframe * const utf = &frame.sc_frame;
        int onstack, error;
        int sig = ksi->ksi_signo;
        u_long code = KSI_TRAPCODE(ksi);
        sig_t catcher = SIGACTION(p, sig).sa_handler;
 
-       tf = trapframe(l);
 
        /* Do we need to jump onto the signal stack? */
        onstack =
@@ -196,7 +195,7 @@
                return (error);
 
        /* Restore the register context. */
-       struct trapframe * const tf = trapframe(l);
+       struct trapframe * const tf = l->l_md.md_utf;
 
        /*
         * Make sure SRR1 hasn't been maliciously tampered with.
diff -r 08f65edb4183 -r 8ad9cdbe899c sys/arch/powerpc/powerpc/core_machdep.c
--- a/sys/arch/powerpc/powerpc/core_machdep.c   Wed Mar 16 21:12:15 2011 +0000
+++ b/sys/arch/powerpc/powerpc/core_machdep.c   Wed Mar 16 21:15:29 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: core_machdep.c,v 1.5 2011/01/18 01:02:55 matt Exp $    */
+/*     $NetBSD: core_machdep.c,v 1.6 2011/03/16 21:15:30 matt Exp $    */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: core_machdep.c,v 1.5 2011/01/18 01:02:55 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: core_machdep.c,v 1.6 2011/03/16 21:15:30 matt Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_altivec.h"
@@ -76,7 +76,7 @@
                return 0;
        }
 
-       md_core.frame = *trapframe(l);
+       md_core.frame = *l->l_md.md_utf;
        if (l->l_md.md_flags & MDLWP_OWNFPU) {
 #ifdef PPC_HAVE_FPU
                fpu_save_lwp(l, FPU_SAVE);
diff -r 08f65edb4183 -r 8ad9cdbe899c sys/arch/powerpc/powerpc/darwin_machdep.c
--- a/sys/arch/powerpc/powerpc/darwin_machdep.c Wed Mar 16 21:12:15 2011 +0000
+++ b/sys/arch/powerpc/powerpc/darwin_machdep.c Wed Mar 16 21:15:29 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: darwin_machdep.c,v 1.29 2011/02/26 05:25:27 kiyohara Exp $ */
+/*     $NetBSD: darwin_machdep.c,v 1.30 2011/03/16 21:15:30 matt Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: darwin_machdep.c,v 1.29 2011/02/26 05:25:27 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: darwin_machdep.c,v 1.30 2011/03/16 21:15:30 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -66,10 +66,10 @@
 void
 darwin_sendsig(const ksiginfo_t *ksi, const sigset_t *mask)
 {
-       struct lwp *l = curlwp;
-       struct proc *p = l->l_proc;
-       struct sigacts *ps = p->p_sigacts;
-       struct trapframe *tf;
+       struct lwp * const l = curlwp;
+       struct proc * const p = l->l_proc;
+       struct sigacts * const ps = p->p_sigacts;
+       struct trapframe * const tf = l->l_md.md_utf;
        struct darwin_sigframe *sfp, sf;
        int onstack;
        size_t stack_size;
@@ -77,7 +77,6 @@
        int sig;
        int error;
 
-       tf = trapframe(l);
 
        sig = ksi->ksi_signo;
        catcher = SIGACTION(p, sig).sa_handler;
@@ -191,7 +190,7 @@
        } */
        struct darwin_ucontext uctx;
        struct darwin_mcontext mctx;
-       struct trapframe *tf;
+       struct trapframe * const tf = l->l_md.md_utf;
        sigset_t mask;
        size_t mcsize;
        int error;
@@ -213,9 +212,8 @@
                return (error);
 
        /* Check for security abuse */
-       tf = trapframe(l);
        if (!PSL_USEROK_P(mctx.ss.srr1)) {
-               DPRINTF(("uctx.ss.srr1 = 0x%08x, rf->srr1 = 0x%08lx\n",
+               DPRINTF(("uctx.ss.srr1 = 0x%08x, tf->srr1 = 0x%08lx\n",
                    mctx.ss.srr1, tf->tf_srr1));
                return (EINVAL);
        }
@@ -284,7 +282,7 @@
 {
        struct lwp * const l = arg;
        struct proc * const p = l->l_proc;
-       struct trapframe * const tf = trapframe(l);
+       struct trapframe * const tf = l->l_md.md_utf;
 
        child_return(arg);
 
diff -r 08f65edb4183 -r 8ad9cdbe899c sys/arch/powerpc/powerpc/mach_machdep.c
--- a/sys/arch/powerpc/powerpc/mach_machdep.c   Wed Mar 16 21:12:15 2011 +0000
+++ b/sys/arch/powerpc/powerpc/mach_machdep.c   Wed Mar 16 21:15:29 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mach_machdep.c,v 1.30 2011/02/26 05:23:22 kiyohara Exp $ */
+/*     $NetBSD: mach_machdep.c,v 1.31 2011/03/16 21:15:30 matt Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mach_machdep.c,v 1.30 2011/02/26 05:23:22 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mach_machdep.c,v 1.31 2011/03/16 21:15:30 matt Exp $");
 
 #include "opt_ppcarch.h"
 #include <sys/param.h>
@@ -81,18 +81,15 @@
 void
 mach_create_thread_child(void *arg)
 {
-       struct mach_create_thread_child_args *mctc;
-       struct lwp *l;
-       struct trapframe *tf;
+       struct mach_create_thread_child_args * const mctc = arg;
+       struct lwp * const l = mctc->mctc_lwp;
+       struct trapframe * const tf = l->l_md.md_utf;
        struct exec_macho_powerpc_thread_state *regs;
 
 #ifdef DEBUG_MACH
        printf("entering mach_create_thread_child\n");
 #endif
 
-       mctc = (struct mach_create_thread_child_args *)arg;
-       l = mctc->mctc_lwp;
-
        if (mctc->mctc_flavor != MACHO_POWERPC_THREAD_STATE) {
                mctc->mctc_child_done = 1;
                wakeup(&mctc->mctc_child_done); 
@@ -101,7 +98,6 @@
                mutex_exit(proc_lock);
        }
        
-       tf = trapframe(l);
        regs = (struct exec_macho_powerpc_thread_state *)mctc->mctc_state;
 
        /* 
diff -r 08f65edb4183 -r 8ad9cdbe899c sys/arch/powerpc/powerpc/powerpc_machdep.c
--- a/sys/arch/powerpc/powerpc/powerpc_machdep.c        Wed Mar 16 21:12:15 2011 +0000
+++ b/sys/arch/powerpc/powerpc/powerpc_machdep.c        Wed Mar 16 21:15:29 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: powerpc_machdep.c,v 1.46 2011/03/04 22:25:28 joerg Exp $       */
+/*     $NetBSD: powerpc_machdep.c,v 1.47 2011/03/16 21:15:30 matt Exp $        */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.46 2011/03/04 22:25:28 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: powerpc_machdep.c,v 1.47 2011/03/16 21:15:30 matt Exp $");
 
 #include "opt_altivec.h"
 #include "opt_modular.h"
@@ -69,9 +69,9 @@
 void
 setregs(struct lwp *l, struct exec_package *pack, vaddr_t stack)
 {
-       struct proc *p = l->l_proc;
-       struct trapframe *tf = trapframe(l);
-       struct pcb *pcb = lwp_getpcb(l);
+       struct proc * const p = l->l_proc;
+       struct trapframe * const tf = l->l_md.md_utf;
+       struct pcb * const pcb = lwp_getpcb(l);
        struct ps_strings arginfo;
 
        memset(tf, 0, sizeof *tf);
@@ -283,9 +283,7 @@
 cpu_upcall(struct lwp *l, int type, int nevents, int ninterrupted,
        void *sas, void *ap, void *sp, sa_upcall_t upcall)
 {
-       struct trapframe *tf;
-
-       tf = trapframe(l);
+       struct trapframe * const tf = l->l_md.md_utf;
 
        /*
         * Build context to run handler in.
diff -r 08f65edb4183 -r 8ad9cdbe899c sys/arch/powerpc/powerpc/process_machdep.c
--- a/sys/arch/powerpc/powerpc/process_machdep.c        Wed Mar 16 21:12:15 2011 +0000
+++ b/sys/arch/powerpc/powerpc/process_machdep.c        Wed Mar 16 21:15:29 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: process_machdep.c,v 1.29 2011/01/18 01:02:55 matt Exp $        */
+/*     $NetBSD: process_machdep.c,v 1.30 2011/03/16 21:15:30 matt Exp $        */
 
 /*
  * Copyright (C) 1995, 1996 Wolfgang Solfrank.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.29 2011/01/18 01:02:55 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.30 2011/03/16 21:15:30 matt Exp $");
 
 #include "opt_altivec.h"
 
@@ -52,7 +52,7 @@
 int
 process_read_regs(struct lwp *l, struct reg *regs)
 {
-       struct trapframe * const tf = trapframe(l);



Home | Main Index | Thread Index | Old Index