summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/i386/machdep.c10
-rw-r--r--sys/i386/linux/linux_sysvec.c9
2 files changed, 7 insertions, 12 deletions
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index 1ef94ea..695b656 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -1461,11 +1461,7 @@ SYSCTL_PROC(_machdep, OID_AUTO, idle, CTLTYPE_STRING | CTLFLAG_RW, 0, 0,
* Reset registers to default values on exec.
*/
void
-exec_setregs(td, entry, stack, ps_strings)
- struct thread *td;
- u_long entry;
- u_long stack;
- u_long ps_strings;
+exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
{
struct trapframe *regs = td->td_frame;
struct pcb *pcb = td->td_pcb;
@@ -1481,7 +1477,7 @@ exec_setregs(td, entry, stack, ps_strings)
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;
@@ -1491,7 +1487,7 @@ exec_setregs(td, entry, stack, ps_strings)
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.
diff --git a/sys/i386/linux/linux_sysvec.c b/sys/i386/linux/linux_sysvec.c
index 069b5bb..3f0c6f4 100644
--- a/sys/i386/linux/linux_sysvec.c
+++ b/sys/i386/linux/linux_sysvec.c
@@ -105,8 +105,8 @@ static int elf_linux_fixup(register_t **stack_base,
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);
+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_params *imgp)
* 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)
+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);
+ exec_setregs(td, imgp, stack);
/* Linux sets %gs to 0, we default to _udatasel */
pcb->pcb_gs = 0;
OpenPOWER on IntegriCloud