From 8146a5ddd70d2a3aff48d236d2885201fff0b8aa Mon Sep 17 00:00:00 2001 From: nyan Date: Tue, 24 Sep 2002 02:22:35 +0000 Subject: MFi386: revisions 1.536 and 1.538. --- sys/pc98/i386/machdep.c | 10 ++++------ sys/pc98/pc98/machdep.c | 10 ++++------ 2 files changed, 8 insertions(+), 12 deletions(-) (limited to 'sys') diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c index a4aba5a..45c77ad 100644 --- a/sys/pc98/i386/machdep.c +++ b/sys/pc98/i386/machdep.c @@ -873,6 +873,10 @@ exec_setregs(td, entry, stack, ps_strings) struct trapframe *regs = td->td_frame; struct pcb *pcb = td->td_pcb; + /* Reset pc->pcb_gs and %gs before possibly invalidating it. */ + pcb->pcb_gs = _udatasel; + load_gs(_udatasel); + if (td->td_proc->p_md.md_ldt) user_ldt_free(td); @@ -889,12 +893,6 @@ exec_setregs(td, entry, stack, ps_strings) /* PS_STRINGS value for BSD/OS binaries. It is 0 for non-BSD/OS. */ regs->tf_ebx = ps_strings; - /* reset %gs as well */ - if (pcb == PCPU_GET(curpcb)) - load_gs(_udatasel); - else - pcb->pcb_gs = _udatasel; - /* * Reset the hardware debug registers if they were in use. * They won't have any meaning for the newly exec'd process. diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index a4aba5a..45c77ad 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -873,6 +873,10 @@ exec_setregs(td, entry, stack, ps_strings) struct trapframe *regs = td->td_frame; struct pcb *pcb = td->td_pcb; + /* Reset pc->pcb_gs and %gs before possibly invalidating it. */ + pcb->pcb_gs = _udatasel; + load_gs(_udatasel); + if (td->td_proc->p_md.md_ldt) user_ldt_free(td); @@ -889,12 +893,6 @@ exec_setregs(td, entry, stack, ps_strings) /* PS_STRINGS value for BSD/OS binaries. It is 0 for non-BSD/OS. */ regs->tf_ebx = ps_strings; - /* reset %gs as well */ - if (pcb == PCPU_GET(curpcb)) - load_gs(_udatasel); - else - pcb->pcb_gs = _udatasel; - /* * Reset the hardware debug registers if they were in use. * They won't have any meaning for the newly exec'd process. -- cgit v1.1