Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Mar 2010 02:56:49 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r205062 - in projects/ppc64/sys: amd64/amd64 amd64/ia32 amd64/linux32 arm/arm compat/ia32 i386/i386 i386/linux ia64/ia32 ia64/ia64 kern mips/mips pc98/pc98 powerpc/include powerpc/power...
Message-ID:  <201003120256.o2C2unwd069300@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Fri Mar 12 02:56:49 2010
New Revision: 205062
URL: http://svn.freebsd.org/changeset/base/205062

Log:
  Reduce redundancy in exec_setregs() arguments.
  
  Suggested by:	kib

Modified:
  projects/ppc64/sys/amd64/amd64/machdep.c
  projects/ppc64/sys/amd64/ia32/ia32_signal.c
  projects/ppc64/sys/amd64/linux32/linux32_sysvec.c
  projects/ppc64/sys/arm/arm/machdep.c
  projects/ppc64/sys/compat/ia32/ia32_signal.h
  projects/ppc64/sys/i386/i386/machdep.c
  projects/ppc64/sys/i386/linux/linux_sysvec.c
  projects/ppc64/sys/ia64/ia32/ia32_signal.c
  projects/ppc64/sys/ia64/ia64/machdep.c
  projects/ppc64/sys/kern/kern_exec.c
  projects/ppc64/sys/mips/mips/pm_machdep.c
  projects/ppc64/sys/pc98/pc98/machdep.c
  projects/ppc64/sys/powerpc/include/reg.h
  projects/ppc64/sys/powerpc/powerpc/exec_machdep.c
  projects/ppc64/sys/sparc64/sparc64/machdep.c
  projects/ppc64/sys/sun4v/sun4v/machdep.c
  projects/ppc64/sys/sys/imgact.h
  projects/ppc64/sys/sys/sysent.h

Modified: projects/ppc64/sys/amd64/amd64/machdep.c
==============================================================================
--- projects/ppc64/sys/amd64/amd64/machdep.c	Fri Mar 12 02:56:45 2010	(r205061)
+++ projects/ppc64/sys/amd64/amd64/machdep.c	Fri Mar 12 02:56:49 2010	(r205062)
@@ -841,12 +841,7 @@ SYSCTL_PROC(_machdep, OID_AUTO, idle, CT
  * Reset registers to default values on exec.
  */
 void
-exec_setregs(td, entry, stack, ps_strings, imgp)
-	struct thread *td;
-	u_long entry;
-	u_long stack;
-	u_long ps_strings;
-	struct image_params *imgp;
+exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *regs = td->td_frame;
 	struct pcb *pcb = td->td_pcb;
@@ -864,7 +859,7 @@ exec_setregs(td, entry, stack, ps_string
 	pcb->pcb_full_iret = 1;
 
 	bzero((char *)regs, sizeof(struct trapframe));
-	regs->tf_rip = entry;
+	regs->tf_rip = imgp->entry_addr;
 	regs->tf_rsp = ((stack - 8) & ~0xFul) + 8;
 	regs->tf_rdi = stack;		/* argv */
 	regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T);

Modified: projects/ppc64/sys/amd64/ia32/ia32_signal.c
==============================================================================
--- projects/ppc64/sys/amd64/ia32/ia32_signal.c	Fri Mar 12 02:56:45 2010	(r205061)
+++ projects/ppc64/sys/amd64/ia32/ia32_signal.c	Fri Mar 12 02:56:49 2010	(r205062)
@@ -701,12 +701,7 @@ freebsd32_sigreturn(td, uap)
  * Clear registers on exec
  */
 void
-ia32_setregs(td, entry, stack, ps_strings, imgp)
-	struct thread *td;
-	u_long entry;
-	u_long stack;
-	u_long ps_strings;
-	struct image_params *imgp;
+ia32_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *regs = td->td_frame;
 	struct pcb *pcb = td->td_pcb;
@@ -722,7 +717,7 @@ ia32_setregs(td, entry, stack, ps_string
 	pcb->pcb_initial_fpucw = __INITIAL_FPUCW_I386__;
 
 	bzero((char *)regs, sizeof(struct trapframe));
-	regs->tf_rip = entry;
+	regs->tf_rip = imgp->entry_addr;
 	regs->tf_rsp = stack;
 	regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T);
 	regs->tf_ss = _udatasel;

Modified: projects/ppc64/sys/amd64/linux32/linux32_sysvec.c
==============================================================================
--- projects/ppc64/sys/amd64/linux32/linux32_sysvec.c	Fri Mar 12 02:56:45 2010	(r205061)
+++ projects/ppc64/sys/amd64/linux32/linux32_sysvec.c	Fri Mar 12 02:56:49 2010	(r205062)
@@ -124,9 +124,8 @@ static register_t *linux_copyout_strings
 static void	linux_prepsyscall(struct trapframe *tf, int *args, u_int *code,
 		    caddr_t *params);
 static void     linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask);
-static void	exec_linux_setregs(struct thread *td, u_long entry,
-				   u_long stack, u_long ps_strings,
-				   struct image_params *imgp);
+static void	exec_linux_setregs(struct thread *td, 
+				   struct image_params *imgp, u_long stack);
 static void	linux32_fixlimit(struct rlimit *rl, int which);
 static boolean_t linux32_trans_osrel(const Elf_Note *note, int32_t *osrel);
 
@@ -829,12 +828,7 @@ exec_linux_imgact_try(struct image_param
  * XXX copied from ia32_signal.c.
  */
 static void
-exec_linux_setregs(td, entry, stack, ps_strings, imgp)
-	struct thread *td;
-	u_long entry;
-	u_long stack;
-	u_long ps_strings;
-	struct image_params *imgp;
+exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *regs = td->td_frame;
 	struct pcb *pcb = td->td_pcb;
@@ -854,7 +848,7 @@ exec_linux_setregs(td, entry, stack, ps_
 	pcb->pcb_initial_fpucw = __LINUX_NPXCW__;
 
 	bzero((char *)regs, sizeof(struct trapframe));
-	regs->tf_rip = entry;
+	regs->tf_rip = imgp->entry_addr;
 	regs->tf_rsp = stack;
 	regs->tf_rflags = PSL_USER | (regs->tf_rflags & PSL_T);
 	regs->tf_gs = _ugssel;
@@ -864,7 +858,7 @@ exec_linux_setregs(td, entry, stack, ps_
 	regs->tf_ss = _udatasel;
 	regs->tf_flags = TF_HASSEGS;
 	regs->tf_cs = _ucode32sel;
-	regs->tf_rbx = ps_strings;
+	regs->tf_rbx = imgp->ps_strings;
 	td->td_pcb->pcb_full_iret = 1;
 	load_cr0(rcr0() | CR0_MP | CR0_TS);
 	fpstate_drop(td);

Modified: projects/ppc64/sys/arm/arm/machdep.c
==============================================================================
--- projects/ppc64/sys/arm/arm/machdep.c	Fri Mar 12 02:56:45 2010	(r205061)
+++ projects/ppc64/sys/arm/arm/machdep.c	Fri Mar 12 02:56:49 2010	(r205062)
@@ -516,16 +516,15 @@ spinlock_exit(void)
  * Clear registers on exec
  */
 void
-exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings,
-    struct image_params *imgp)
+exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *tf = td->td_frame;
 
 	memset(tf, 0, sizeof(*tf));
 	tf->tf_usr_sp = stack;
-	tf->tf_usr_lr = entry;
+	tf->tf_usr_lr = imgp->entry_addr;
 	tf->tf_svc_lr = 0x77777777;
-	tf->tf_pc = entry;
+	tf->tf_pc = imgp->entry_addr;
 	tf->tf_spsr = PSR_USR32_MODE;
 }
 

Modified: projects/ppc64/sys/compat/ia32/ia32_signal.h
==============================================================================
--- projects/ppc64/sys/compat/ia32/ia32_signal.h	Fri Mar 12 02:56:45 2010	(r205061)
+++ projects/ppc64/sys/compat/ia32/ia32_signal.h	Fri Mar 12 02:56:49 2010	(r205062)
@@ -185,5 +185,5 @@ extern char freebsd4_ia32_sigcode[];
 extern int sz_ia32_sigcode;
 extern int sz_freebsd4_ia32_sigcode;
 extern void ia32_sendsig(sig_t, struct ksiginfo *, sigset_t *);
-extern void ia32_setregs(struct thread *td, u_long entry, u_long stack,
-    u_long ps_strings, struct image_params *imgp);
+extern void ia32_setregs(struct thread *td, struct image_params *imgp,
+    u_long stack);

Modified: projects/ppc64/sys/i386/i386/machdep.c
==============================================================================
--- projects/ppc64/sys/i386/i386/machdep.c	Fri Mar 12 02:56:45 2010	(r205061)
+++ projects/ppc64/sys/i386/i386/machdep.c	Fri Mar 12 02:56:49 2010	(r205062)
@@ -1461,12 +1461,7 @@ SYSCTL_PROC(_machdep, OID_AUTO, idle, CT
  * Reset registers to default values on exec.
  */
 void
-exec_setregs(td, entry, stack, ps_strings, imgp)
-	struct thread *td;
-	u_long entry;
-	u_long stack;
-	u_long ps_strings;
-	struct image_params *imgp;
+exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *regs = td->td_frame;
 	struct pcb *pcb = td->td_pcb;
@@ -1482,7 +1477,7 @@ exec_setregs(td, entry, stack, ps_string
 		mtx_unlock_spin(&dt_lock);
   
 	bzero((char *)regs, sizeof(struct trapframe));
-	regs->tf_eip = entry;
+	regs->tf_eip = imgp->entry_addr;
 	regs->tf_esp = stack;
 	regs->tf_eflags = PSL_USER | (regs->tf_eflags & PSL_T);
 	regs->tf_ss = _udatasel;
@@ -1492,7 +1487,7 @@ exec_setregs(td, entry, stack, ps_string
 	regs->tf_cs = _ucodesel;
 
 	/* PS_STRINGS value for BSD/OS binaries.  It is 0 for non-BSD/OS. */
-	regs->tf_ebx = ps_strings;
+	regs->tf_ebx = imgp->ps_strings;
 
         /*
          * Reset the hardware debug registers if they were in use.

Modified: projects/ppc64/sys/i386/linux/linux_sysvec.c
==============================================================================
--- projects/ppc64/sys/i386/linux/linux_sysvec.c	Fri Mar 12 02:56:45 2010	(r205061)
+++ projects/ppc64/sys/i386/linux/linux_sysvec.c	Fri Mar 12 02:56:49 2010	(r205062)
@@ -105,8 +105,8 @@ static int	elf_linux_fixup(register_t **
 static void	linux_prepsyscall(struct trapframe *tf, int *args, u_int *code,
 		    caddr_t *params);
 static void     linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask);
-static void	exec_linux_setregs(struct thread *td, u_long entry,
-		    u_long stack, u_long ps_strings, struct image_params *imgp);
+static void	exec_linux_setregs(struct thread *td,
+		    struct image_params *imgp, u_long stack);
 static register_t *linux_copyout_strings(struct image_params *imgp);
 static boolean_t linux_trans_osrel(const Elf_Note *note, int32_t *osrel);
 
@@ -927,12 +927,11 @@ exec_linux_imgact_try(struct image_param
  * override the exec_setregs default(s) here.
  */
 static void
-exec_linux_setregs(struct thread *td, u_long entry,
-		   u_long stack, u_long ps_strings, struct image_params *imgp)
+exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct pcb *pcb = td->td_pcb;
 
-	exec_setregs(td, entry, stack, ps_strings, imgp);
+	exec_setregs(td, imgp, stack);
 
 	/* Linux sets %gs to 0, we default to _udatasel */
 	pcb->pcb_gs = 0;

Modified: projects/ppc64/sys/ia64/ia32/ia32_signal.c
==============================================================================
--- projects/ppc64/sys/ia64/ia32/ia32_signal.c	Fri Mar 12 02:56:45 2010	(r205061)
+++ projects/ppc64/sys/ia64/ia32/ia32_signal.c	Fri Mar 12 02:56:49 2010	(r205062)
@@ -120,8 +120,7 @@ freebsd32_sigreturn(struct thread *td, s
 
 
 void
-ia32_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings,
-    struct image_params *imgp)
+ia32_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *tf = td->td_frame;
 	vm_offset_t gdt, ldt;
@@ -130,7 +129,7 @@ ia32_setregs(struct thread *td, u_long e
 	struct segment_descriptor desc;
 	struct vmspace *vmspace = td->td_proc->p_vmspace;
 
-	exec_setregs(td, entry, stack, ps_strings, imgp);
+	exec_setregs(td, imgp, stack);
 
 	/* Non-syscall frames are cleared by exec_setregs() */
 	if (tf->tf_flags & FRAME_SYSCALL) {

Modified: projects/ppc64/sys/ia64/ia64/machdep.c
==============================================================================
--- projects/ppc64/sys/ia64/ia64/machdep.c	Fri Mar 12 02:56:45 2010	(r205061)
+++ projects/ppc64/sys/ia64/ia64/machdep.c	Fri Mar 12 02:56:49 2010	(r205062)
@@ -1328,8 +1328,7 @@ set_mcontext(struct thread *td, const mc
  * Clear registers on exec.
  */
 void
-exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings,
-    struct image_params *imgp)
+exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *tf;
 	uint64_t *ksttop, *kst;
@@ -1386,7 +1385,7 @@ exec_setregs(struct thread *td, u_long e
 		suword((caddr_t)tf->tf_special.bspstore -  8, 0);
 	}
 
-	tf->tf_special.iip = entry;
+	tf->tf_special.iip = imgp->entry_addr;
 	tf->tf_special.sp = (stack & ~15) - 16;
 	tf->tf_special.rsc = 0xf;
 	tf->tf_special.fpsr = IA64_FPSR_DEFAULT;

Modified: projects/ppc64/sys/kern/kern_exec.c
==============================================================================
--- projects/ppc64/sys/kern/kern_exec.c	Fri Mar 12 02:56:45 2010	(r205061)
+++ projects/ppc64/sys/kern/kern_exec.c	Fri Mar 12 02:56:49 2010	(r205062)
@@ -800,11 +800,10 @@ interpret:
 
 	/* Set values passed into the program in registers. */
 	if (p->p_sysent->sv_setregs)
-		(*p->p_sysent->sv_setregs)(td, imgp->entry_addr,
-		    (u_long)(uintptr_t)stack_base, imgp->ps_strings, imgp);
+		(*p->p_sysent->sv_setregs)(td, imgp, 
+		    (u_long)(uintptr_t)stack_base);
 	else
-		exec_setregs(td, imgp->entry_addr,
-		    (u_long)(uintptr_t)stack_base, imgp->ps_strings, imgp);
+		exec_setregs(td, imgp, (u_long)(uintptr_t)stack_base);
 
 	vfs_mark_atime(imgp->vp, td->td_ucred);
 

Modified: projects/ppc64/sys/mips/mips/pm_machdep.c
==============================================================================
--- projects/ppc64/sys/mips/mips/pm_machdep.c	Fri Mar 12 02:56:45 2010	(r205061)
+++ projects/ppc64/sys/mips/mips/pm_machdep.c	Fri Mar 12 02:56:49 2010	(r205062)
@@ -472,8 +472,7 @@ set_fpregs(struct thread *td, struct fpr
  * code by the MIPS elf abi).
  */
 void
-exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings,
-    struct image_params *imgp)
+exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 
 	bzero((caddr_t)td->td_frame, sizeof(struct trapframe));
@@ -482,8 +481,8 @@ exec_setregs(struct thread *td, u_long e
 	 * Make sp 64-bit aligned.
 	 */
 	td->td_frame->sp = ((register_t) stack) & ~(sizeof(__int64_t) - 1);
-	td->td_frame->pc = entry & ~3;
-	td->td_frame->t9 = entry & ~3; /* abicall req */
+	td->td_frame->pc = imgp->entry_addr & ~3;
+	td->td_frame->t9 = imgp->entry_addr & ~3; /* abicall req */
 #if 0
 //	td->td_frame->sr = SR_KSU_USER | SR_EXL | SR_INT_ENAB;
 //?	td->td_frame->sr |=  idle_mask & ALL_INT_MASK;
@@ -512,7 +511,7 @@ exec_setregs(struct thread *td, u_long e
 	td->td_frame->a0 = (register_t) stack;
 	td->td_frame->a1 = 0;
 	td->td_frame->a2 = 0;
-	td->td_frame->a3 = (register_t)ps_strings;
+	td->td_frame->a3 = (register_t)imgp->ps_strings;
 
 	td->td_md.md_flags &= ~MDTD_FPUSED;
 	if (PCPU_GET(fpcurthread) == td)

Modified: projects/ppc64/sys/pc98/pc98/machdep.c
==============================================================================
--- projects/ppc64/sys/pc98/pc98/machdep.c	Fri Mar 12 02:56:45 2010	(r205061)
+++ projects/ppc64/sys/pc98/pc98/machdep.c	Fri Mar 12 02:56:49 2010	(r205062)
@@ -1172,12 +1172,7 @@ void (*cpu_idle_hook)(void) = cpu_idle_d
  * Reset registers to default values on exec.
  */
 void
-exec_setregs(td, entry, stack, ps_strings, imgp)
-	struct thread *td;
-	u_long entry;
-	u_long stack;
-	u_long ps_strings;
-	struct image_params *imgp;
+exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *regs = td->td_frame;
 	struct pcb *pcb = td->td_pcb;
@@ -1193,7 +1188,7 @@ exec_setregs(td, entry, stack, ps_string
 		mtx_unlock_spin(&dt_lock);
   
 	bzero((char *)regs, sizeof(struct trapframe));
-	regs->tf_eip = entry;
+	regs->tf_eip = imgp->entry_addr;
 	regs->tf_esp = stack;
 	regs->tf_eflags = PSL_USER | (regs->tf_eflags & PSL_T);
 	regs->tf_ss = _udatasel;
@@ -1203,7 +1198,7 @@ exec_setregs(td, entry, stack, ps_string
 	regs->tf_cs = _ucodesel;
 
 	/* PS_STRINGS value for BSD/OS binaries.  It is 0 for non-BSD/OS. */
-	regs->tf_ebx = ps_strings;
+	regs->tf_ebx = imgp->ps_strings;
 
         /*
          * Reset the hardware debug registers if they were in use.

Modified: projects/ppc64/sys/powerpc/include/reg.h
==============================================================================
--- projects/ppc64/sys/powerpc/include/reg.h	Fri Mar 12 02:56:45 2010	(r205061)
+++ projects/ppc64/sys/powerpc/include/reg.h	Fri Mar 12 02:56:49 2010	(r205062)
@@ -64,8 +64,7 @@ struct image_params;
 
 int	fill_regs32(struct thread *, struct reg32 *);
 int	set_regs32(struct thread *, struct reg32 *);
-void	ppc32_setregs(struct thread *, u_long, u_long, u_long,
-	    struct image_params *);
+void	ppc32_setregs(struct thread *, struct image_params *, u_long);
 
 #define	fill_fpregs32(td, reg)	fill_fpregs(td,(struct fpreg *)reg)
 #define	set_fpregs32(td, reg)	set_fpregs(td,(struct fpreg *)reg)

Modified: projects/ppc64/sys/powerpc/powerpc/exec_machdep.c
==============================================================================
--- projects/ppc64/sys/powerpc/powerpc/exec_machdep.c	Fri Mar 12 02:56:45 2010	(r205061)
+++ projects/ppc64/sys/powerpc/powerpc/exec_machdep.c	Fri Mar 12 02:56:49 2010	(r205062)
@@ -486,8 +486,7 @@ set_mcontext(struct thread *td, const mc
  * Set set up registers on exec.
  */
 void
-exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings,
-    struct image_params *imgp)
+exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe	*tf;
 	struct ps_strings	arginfo;
@@ -543,13 +542,13 @@ exec_setregs(struct thread *td, u_long e
 	 * 2. Environment pointer (r11)
 	 */
 
-	(void)copyin((void *)entry, entry_desc, sizeof(entry_desc));
+	(void)copyin((void *)imgp->entry_addr, entry_desc, sizeof(entry_desc));
 	tf->srr0 = entry_desc[0] + imgp->reloc_base;
 	tf->fixreg[2] = entry_desc[1] + imgp->reloc_base;
 	tf->fixreg[11] = entry_desc[2] + imgp->reloc_base;
 	tf->srr1 = PSL_SF | PSL_MBO | PSL_USERSET | PSL_FE_DFLT;
 	#else
-	tf->srr0 = entry;
+	tf->srr0 = imgp->entry_addr;
 	tf->srr1 = PSL_MBO | PSL_USERSET | PSL_FE_DFLT;
 	#endif
 	td->td_pcb->pcb_flags = 0;
@@ -557,8 +556,7 @@ exec_setregs(struct thread *td, u_long e
 
 #ifdef COMPAT_FREEBSD32
 void
-ppc32_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings,
-    struct image_params *imgp)
+ppc32_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe		*tf;
 	struct freebsd32_ps_strings	arginfo;
@@ -578,7 +576,7 @@ ppc32_setregs(struct thread *td, u_long 
 	tf->fixreg[7] = 0;			/* termination vector */
 	tf->fixreg[8] = (register_t)FREEBSD32_PS_STRINGS; /* NetBSD extension */
 
-	tf->srr0 = entry;
+	tf->srr0 = imgp->entry_addr;
 	tf->srr1 = PSL_MBO | PSL_USERSET | PSL_FE_DFLT;
 	tf->srr1 &= ~PSL_SF;
 	td->td_pcb->pcb_flags = 0;

Modified: projects/ppc64/sys/sparc64/sparc64/machdep.c
==============================================================================
--- projects/ppc64/sys/sparc64/sparc64/machdep.c	Fri Mar 12 02:56:45 2010	(r205061)
+++ projects/ppc64/sys/sparc64/sparc64/machdep.c	Fri Mar 12 02:56:49 2010	(r205062)
@@ -968,8 +968,7 @@ ptrace_clear_single_step(struct thread *
 }
 
 void
-exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings,
-    struct image_params *imgp)
+exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *tf;
 	struct pcb *pcb;
@@ -992,8 +991,8 @@ exec_setregs(struct thread *td, u_long e
 	tf->tf_out[0] = stack;
 	tf->tf_out[3] = p->p_sysent->sv_psstrings;
 	tf->tf_out[6] = sp - SPOFF - sizeof(struct frame);
-	tf->tf_tnpc = entry + 4;
-	tf->tf_tpc = entry;
+	tf->tf_tnpc = imgp->entry_addr + 4;
+	tf->tf_tpc = imgp->entry_addr;
 	tf->tf_tstate = TSTATE_IE | TSTATE_PEF | TSTATE_MM_TSO;
 
 	td->td_retval[0] = tf->tf_out[0];

Modified: projects/ppc64/sys/sun4v/sun4v/machdep.c
==============================================================================
--- projects/ppc64/sys/sun4v/sun4v/machdep.c	Fri Mar 12 02:56:45 2010	(r205061)
+++ projects/ppc64/sys/sun4v/sun4v/machdep.c	Fri Mar 12 02:56:49 2010	(r205062)
@@ -869,8 +869,7 @@ ptrace_clear_single_step(struct thread *
 }
 
 void
-exec_setregs(struct thread *td, u_long entry, u_long stack, u_long ps_strings,
-    struct image_params *imgp)
+exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
 	struct trapframe *tf;
 	struct pcb *pcb;
@@ -898,8 +897,8 @@ exec_setregs(struct thread *td, u_long e
 	tf->tf_out[3] = p->p_sysent->sv_psstrings;
 	tf->tf_out[6] = sp - SPOFF - sizeof(struct frame);
 
-	tf->tf_tnpc = entry + 4;
-	tf->tf_tpc = entry;
+	tf->tf_tnpc = imgp->entry_addr + 4;
+	tf->tf_tpc = imgp->entry_addr;
 	tf->tf_tstate = TSTATE_IE | TSTATE_PEF | TSTATE_MM_TSO;
 
 	td->td_retval[0] = tf->tf_out[0];

Modified: projects/ppc64/sys/sys/imgact.h
==============================================================================
--- projects/ppc64/sys/sys/imgact.h	Fri Mar 12 02:56:45 2010	(r205061)
+++ projects/ppc64/sys/sys/imgact.h	Fri Mar 12 02:56:49 2010	(r205062)
@@ -81,8 +81,7 @@ struct thread;
 int	exec_check_permissions(struct image_params *);
 register_t *exec_copyout_strings(struct image_params *);
 int	exec_new_vmspace(struct image_params *, struct sysentvec *);
-void	exec_setregs(struct thread *, u_long, u_long, u_long,
-	    struct image_params *);
+void	exec_setregs(struct thread *, struct image_params *, u_long);
 int	exec_shell_imgact(struct image_params *);
 int	exec_copyin_args(struct image_args *, char *, enum uio_seg,
 	char **, char **);

Modified: projects/ppc64/sys/sys/sysent.h
==============================================================================
--- projects/ppc64/sys/sys/sysent.h	Fri Mar 12 02:56:45 2010	(r205061)
+++ projects/ppc64/sys/sys/sysent.h	Fri Mar 12 02:56:49 2010	(r205062)
@@ -98,8 +98,8 @@ struct sysentvec {
 	vm_offset_t	sv_psstrings;	/* PS_STRINGS */
 	int		sv_stackprot;	/* vm protection for stack */
 	register_t	*(*sv_copyout_strings)(struct image_params *);
-	void		(*sv_setregs)(struct thread *, u_long, u_long, u_long,
-			    struct image_params *);
+	void		(*sv_setregs)(struct thread *, struct image_params *,
+			    u_long);
 	void		(*sv_fixlimit)(struct rlimit *, int);
 	u_long		*sv_maxssiz;
 	u_int		sv_flags;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003120256.o2C2unwd069300>