Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mips/mips constification.



details:   https://anonhg.NetBSD.org/src/rev/956f15294bd2
branches:  trunk
changeset: 764651:956f15294bd2
user:      matt <matt%NetBSD.org@localhost>
date:      Fri Apr 29 22:11:15 2011 +0000

description:
constification.

diffstat:

 sys/arch/mips/mips/compat_16_machdep.c |  35 ++++++++++++++-------------------
 1 files changed, 15 insertions(+), 20 deletions(-)

diffs (102 lines):

diff -r 32a387cbe57c -r 956f15294bd2 sys/arch/mips/mips/compat_16_machdep.c
--- a/sys/arch/mips/mips/compat_16_machdep.c    Fri Apr 29 22:10:22 2011 +0000
+++ b/sys/arch/mips/mips/compat_16_machdep.c    Fri Apr 29 22:11:15 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: compat_16_machdep.c,v 1.18 2011/02/20 07:45:47 matt Exp $      */
+/*     $NetBSD: compat_16_machdep.c,v 1.19 2011/04/29 22:11:15 matt 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.18 2011/02/20 07:45:47 matt Exp $"); 
+__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.19 2011/04/29 22:11:15 matt Exp $"); 
 
 #ifdef _KERNEL_OPT
 #include "opt_cputype.h"
@@ -57,6 +57,7 @@
 #include <sys/systm.h>
 #include <sys/kernel.h>
 #include <sys/proc.h>
+#include <sys/cpu.h>
 #include <sys/signal.h>
 #include <sys/signalvar.h>
 #include <sys/mount.h>
@@ -65,8 +66,6 @@
 #include <compat/sys/signal.h>
 #include <compat/sys/signalvar.h>
 
-#include <machine/cpu.h>
-
 #include <mips/regnum.h>
 #include <mips/frame.h>
 #include <mips/locore.h>
@@ -92,14 +91,14 @@
 sendsig_sigcontext(const ksiginfo_t *ksi, const sigset_t *returnmask)
 {
        int sig = ksi->ksi_signo;
-       struct lwp *l = curlwp;
-       struct proc *p = l->l_proc;
-       struct pcb *pcb;
-       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 pcb * const pcb = lwp_getpcb(l);
        int onstack, error;
        struct sigcontext *scp = getframe(l, sig, &onstack);
        struct sigcontext ksc;
-       struct trapframe *tf = l->l_md.md_utf;
+       struct trapframe * const tf = l->l_md.md_utf;
        sig_t catcher = SIGACTION(p, sig).sa_handler;
 
 #if !defined(__mips_o32)
@@ -132,9 +131,8 @@
 #endif
 
        /* Save the FP state, if necessary, then copy it. */
-       pcb = lwp_getpcb(l);
-#if defined(FPEMUL) || !defined(NOFPU)
        ksc.sc_fpused = fpu_used_p(l);
+#if !defined(NOFPU)
        if (ksc.sc_fpused) {
                /* if FPU has current state, save it first */
                fpu_save();
@@ -238,9 +236,9 @@
                syscallarg(struct sigcontext *) sigcntxp;
        } */
        struct sigcontext *scp, ksc;
-       struct trapframe *tf = l->l_md.md_utf;
-       struct proc *p = l->l_proc;
-       struct pcb *pcb;
+       struct trapframe * const tf = l->l_md.md_utf;
+       struct proc * const p = l->l_proc;
+       struct pcb * const pcb = lwp_getpcb(l);
        int error;
 
 #if !defined(__mips_o32)
@@ -271,19 +269,16 @@
 #if defined(__mips_o32)
        memcpy(&tf->tf_regs[1], &scp->sc_regs[1],
            sizeof(scp->sc_regs) - sizeof(scp->sc_regs[0]));
-
 #else
        for (size_t i = 1; i < __arraycount(tf->tf_regs); i++)
                tf->tf_regs[i] = ksc.sc_regs[i];
 #endif
+#if !defined(NOFPU)
        if (scp->sc_fpused) {
-#if !defined(NOFPU)
                fpu_discard();
+       }
 #endif
-               pcb = lwp_getpcb(l);
-               *(struct fpreg *)&pcb->pcb_fpregs
-                   = *(struct fpreg *)scp->sc_fpregs;
-       }
+       *(struct fpreg *)&pcb->pcb_fpregs = *(struct fpreg *)scp->sc_fpregs;
 
        mutex_enter(p->p_lock);
        /* Restore signal stack. */



Home | Main Index | Thread Index | Old Index