Module Name: src
Committed By: matt
Date: Fri Apr 29 22:11:15 UTC 2011
Modified Files:
src/sys/arch/mips/mips: compat_16_machdep.c
Log Message:
constification.
To generate a diff of this commit:
cvs rdiff -u -r1.18 -r1.19 src/sys/arch/mips/mips/compat_16_machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/mips/mips/compat_16_machdep.c
diff -u src/sys/arch/mips/mips/compat_16_machdep.c:1.18 src/sys/arch/mips/mips/compat_16_machdep.c:1.19
--- src/sys/arch/mips/mips/compat_16_machdep.c:1.18 Sun Feb 20 07:45:47 2011
+++ src/sys/arch/mips/mips/compat_16_machdep.c Fri Apr 29 22:11:15 2011
@@ -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 (scp->sc_fpused) {
#if !defined(NOFPU)
+ if (scp->sc_fpused) {
fpu_discard();
-#endif
- pcb = lwp_getpcb(l);
- *(struct fpreg *)&pcb->pcb_fpregs
- = *(struct fpreg *)scp->sc_fpregs;
}
+#endif
+ *(struct fpreg *)&pcb->pcb_fpregs = *(struct fpreg *)scp->sc_fpregs;
mutex_enter(p->p_lock);
/* Restore signal stack. */