Module Name:    src
Committed By:   matt
Date:           Thu Aug 16 16:41:54 UTC 2012

Modified Files:
        src/sys/arch/arm/arm: compat_16_machdep.c process_machdep.c
            sig_machdep.c
        src/sys/arch/arm/include: frame.h
        src/sys/compat/linux/arch/arm: linux_machdep.c

Log Message:
Rename process_frame to lwp_trapframe


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/sys/arch/arm/arm/compat_16_machdep.c
cvs rdiff -u -r1.22 -r1.23 src/sys/arch/arm/arm/process_machdep.c
cvs rdiff -u -r1.42 -r1.43 src/sys/arch/arm/arm/sig_machdep.c
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/arm/include/frame.h
cvs rdiff -u -r1.29 -r1.30 src/sys/compat/linux/arch/arm/linux_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/arm/arm/compat_16_machdep.c
diff -u src/sys/arch/arm/arm/compat_16_machdep.c:1.14 src/sys/arch/arm/arm/compat_16_machdep.c:1.15
--- src/sys/arch/arm/arm/compat_16_machdep.c:1.14	Wed Jan 25 17:38:09 2012
+++ src/sys/arch/arm/arm/compat_16_machdep.c	Thu Aug 16 16:41:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: compat_16_machdep.c,v 1.14 2012/01/25 17:38:09 tsutsui Exp $	*/
+/*	$NetBSD: compat_16_machdep.c,v 1.15 2012/08/16 16:41:53 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -42,7 +42,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.14 2012/01/25 17:38:09 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: compat_16_machdep.c,v 1.15 2012/08/16 16:41:53 matt Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -84,18 +84,16 @@ __KERNEL_RCSID(0, "$NetBSD: compat_16_ma
 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 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 = lwp_trapframe(l);
 	struct sigframe_sigcontext *fp, frame;
 	int onstack, error;
 	int sig = ksi->ksi_signo;
 	u_long code = KSI_TRAPCODE(ksi);
 	sig_t catcher = SIGACTION(p, sig).sa_handler;
 
-	tf = process_frame(l);
-
 	fp = getframe(l, sig, &onstack);
 
 	/* make room on the stack */
@@ -216,9 +214,9 @@ compat_16_sys___sigreturn14(struct lwp *
 	/* {
 		syscallarg(struct sigcontext *) sigcntxp;
 	} */
+	struct trapframe * const tf = lwp_trapframe(l);
+	struct proc * const p = l->l_proc;
 	struct sigcontext *scp, context;
-	struct trapframe *tf;
-	struct proc *p = l->l_proc;
 
 	/*
 	 * we do a rather scary test in userland
@@ -243,7 +241,6 @@ compat_16_sys___sigreturn14(struct lwp *
 		return EINVAL;
 
 	/* Restore register context. */
-	tf = process_frame(l);
 	tf->tf_r0    = context.sc_r0;
 	tf->tf_r1    = context.sc_r1;
 	tf->tf_r2    = context.sc_r2;

Index: src/sys/arch/arm/arm/process_machdep.c
diff -u src/sys/arch/arm/arm/process_machdep.c:1.22 src/sys/arch/arm/arm/process_machdep.c:1.23
--- src/sys/arch/arm/arm/process_machdep.c:1.22	Sat Nov 21 20:32:17 2009
+++ src/sys/arch/arm/arm/process_machdep.c	Thu Aug 16 16:41:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: process_machdep.c,v 1.22 2009/11/21 20:32:17 rmind Exp $	*/
+/*	$NetBSD: process_machdep.c,v 1.23 2012/08/16 16:41:53 matt Exp $	*/
 
 /*
  * Copyright (c) 1993 The Regents of the University of California.
@@ -133,7 +133,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.22 2009/11/21 20:32:17 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.23 2012/08/16 16:41:53 matt Exp $");
 
 #include <sys/proc.h>
 #include <sys/ptrace.h>
@@ -152,7 +152,7 @@ __KERNEL_RCSID(0, "$NetBSD: process_mach
 int
 process_read_regs(struct lwp *l, struct reg *regs)
 {
-	struct trapframe *tf = process_frame(l);
+	struct trapframe * const tf = lwp_trapframe(l);
 
 	KASSERT(tf != NULL);
 	memcpy((void *)regs->r, (void *)&tf->tf_r0, sizeof(regs->r));
@@ -190,7 +190,7 @@ process_read_fpregs(struct lwp *l, struc
 int
 process_write_regs(struct lwp *l, const struct reg *regs)
 {
-	struct trapframe *tf = process_frame(l);
+	struct trapframe * const tf = lwp_trapframe(l);
 
 	KASSERT(tf != NULL);
 	memcpy(&tf->tf_r0, regs->r, sizeof(regs->r));
@@ -234,7 +234,7 @@ process_write_fpregs(struct lwp *l, cons
 int
 process_set_pc(struct lwp *l, void *addr)
 {
-	struct trapframe *tf = process_frame(l);
+	struct trapframe * const tf = lwp_trapframe(l);
 
 	KASSERT(tf != NULL);
 #ifdef __PROG32

Index: src/sys/arch/arm/arm/sig_machdep.c
diff -u src/sys/arch/arm/arm/sig_machdep.c:1.42 src/sys/arch/arm/arm/sig_machdep.c:1.43
--- src/sys/arch/arm/arm/sig_machdep.c:1.42	Mon May 21 14:15:17 2012
+++ src/sys/arch/arm/arm/sig_machdep.c	Thu Aug 16 16:41:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: sig_machdep.c,v 1.42 2012/05/21 14:15:17 martin Exp $	*/
+/*	$NetBSD: sig_machdep.c,v 1.43 2012/08/16 16:41:53 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -44,7 +44,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.42 2012/05/21 14:15:17 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.43 2012/08/16 16:41:53 matt Exp $");
 
 #include <sys/mount.h>		/* XXX only needed by syscallargs.h */
 #include <sys/proc.h>
@@ -66,8 +66,8 @@ __KERNEL_RCSID(0, "$NetBSD: sig_machdep.
 void *
 getframe(struct lwp *l, int sig, int *onstack)
 {
-	struct proc *p = l->l_proc;
-	struct trapframe *tf = process_frame(l);
+	struct proc * const p = l->l_proc;
+	struct trapframe * const tf = lwp_trapframe(l);
 
 	/* Do we need to jump onto the signal stack? */
 	*onstack = (l->l_sigstk.ss_flags & (SS_DISABLE | SS_ONSTACK)) == 0
@@ -90,18 +90,15 @@ getframe(struct lwp *l, int sig, int *on
 void
 sendsig_siginfo(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 = lwp_trapframe(l);
 	struct sigframe_siginfo *fp, frame;
 	int onstack, error;
 	int sig = ksi->ksi_signo;
 	sig_t catcher = SIGACTION(p, sig).sa_handler;
 
-	/* get the current frame */
-	tf = process_frame(l);
-
 	fp = getframe(l, sig, &onstack);
 	
 	/* make room on the stack */
@@ -165,8 +162,8 @@ sendsig_siginfo(const ksiginfo_t *ksi, c
 void
 cpu_getmcontext(struct lwp *l, mcontext_t *mcp, unsigned int *flags)
 {
-	struct trapframe *tf = process_frame(l);
-	__greg_t *gr = mcp->__gregs;
+	struct trapframe * const tf = lwp_trapframe(l);
+	__greg_t * const gr = mcp->__gregs;
 	__greg_t ras_pc;
 
 	/* Save General Register context. */
@@ -207,7 +204,7 @@ cpu_getmcontext(struct lwp *l, mcontext_
 int
 cpu_mcontext_validate(struct lwp *l, const mcontext_t *mcp)
 {
-	const __greg_t *gr = mcp->__gregs;
+	const __greg_t * const gr = mcp->__gregs;
 
 	/* Make sure the processor mode has not been tampered with. */
 	if (!VALID_R15_PSR(gr[_REG_PC], gr[_REG_CPSR]))
@@ -218,9 +215,9 @@ cpu_mcontext_validate(struct lwp *l, con
 int
 cpu_setmcontext(struct lwp *l, const mcontext_t *mcp, unsigned int flags)
 {
-	struct trapframe *tf = process_frame(l);
-	const __greg_t *gr = mcp->__gregs;
-	struct proc *p = l->l_proc;
+	struct trapframe * const tf = lwp_trapframe(l);
+	const __greg_t * const gr = mcp->__gregs;
+	struct proc * const p = l->l_proc;
 	int error;
 
 	if ((flags & _UC_CPU) != 0) {

Index: src/sys/arch/arm/include/frame.h
diff -u src/sys/arch/arm/include/frame.h:1.15 src/sys/arch/arm/include/frame.h:1.16
--- src/sys/arch/arm/include/frame.h:1.15	Wed Aug  1 22:46:07 2012
+++ src/sys/arch/arm/include/frame.h	Thu Aug 16 16:41:54 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: frame.h,v 1.15 2012/08/01 22:46:07 matt Exp $	*/
+/*	$NetBSD: frame.h,v 1.16 2012/08/16 16:41:54 matt Exp $	*/
 
 /*
  * Copyright (c) 1994-1997 Mark Brinicombe.
@@ -99,7 +99,7 @@ __BEGIN_DECLS
 void sendsig_sigcontext(const ksiginfo_t *, const sigset_t *);
 void *getframe(struct lwp *, int, int *);
 __END_DECLS
-#define process_frame(l) (((struct pcb *)lwp_getpcb(l))->pcb_tf)
+#define lwp_trapframe(l) (((struct pcb *)lwp_getpcb(l))->pcb_tf)
 #endif
 
 #endif /* _LOCORE */

Index: src/sys/compat/linux/arch/arm/linux_machdep.c
diff -u src/sys/compat/linux/arch/arm/linux_machdep.c:1.29 src/sys/compat/linux/arch/arm/linux_machdep.c:1.30
--- src/sys/compat/linux/arch/arm/linux_machdep.c:1.29	Wed Jul  7 01:30:33 2010
+++ src/sys/compat/linux/arch/arm/linux_machdep.c	Thu Aug 16 16:41:53 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_machdep.c,v 1.29 2010/07/07 01:30:33 chs Exp $	*/
+/*	$NetBSD: linux_machdep.c,v 1.30 2012/08/16 16:41:53 matt Exp $	*/
 
 /*-
  * Copyright (c) 1995, 2000 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.29 2010/07/07 01:30:33 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_machdep.c,v 1.30 2012/08/16 16:41:53 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -76,15 +76,14 @@ linux_setregs(struct lwp *l, struct exec
 void
 linux_sendsig(const ksiginfo_t *ksi, const sigset_t *mask)
 {
-	struct lwp *l = curlwp;
-	struct proc *p = l->l_proc;
-	struct trapframe *tf;
+	struct lwp * const l = curlwp;
+	struct proc * const p = l->l_proc;
+	struct trapframe * const tf = lwp_trapframe(l);
 	struct linux_sigframe *fp, frame;
 	int onstack, error;
 	const int sig = ksi->ksi_signo;
 	sig_t catcher = SIGACTION(p, sig).sa_handler;
 
-	tf = process_frame(l);
 
 	/*
 	 * The Linux version of this code is in
@@ -195,13 +194,11 @@ int
 linux_sys_sigreturn(struct lwp *l, const struct linux_sys_sigreturn_args *v,
 	register_t *retval)
 {
+	struct trapframe * const tf = lwp_trapframe(l);
+	struct proc * const p = l->l_proc;
 	struct linux_sigframe *sfp, frame;
-	struct proc *p = l->l_proc;
-	struct trapframe *tf;
 	sigset_t mask;
 
-	tf = process_frame(l);
-
 	/*
 	 * The trampoline code hands us the context.
 	 * It is unsafe to keep track of it ourselves, in the event that a
@@ -219,7 +216,6 @@ linux_sys_sigreturn(struct lwp *l, const
 		return EINVAL;
 
 	/* Restore register context. */
-	tf = process_frame(l);
 	tf->tf_r0    = frame.sf_sc.sc_r0;
 	tf->tf_r1    = frame.sf_sc.sc_r1;
 	tf->tf_r2    = frame.sf_sc.sc_r2;

Reply via email to