summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authornyan <nyan@FreeBSD.org>2002-09-24 02:22:35 +0000
committernyan <nyan@FreeBSD.org>2002-09-24 02:22:35 +0000
commit8146a5ddd70d2a3aff48d236d2885201fff0b8aa (patch)
tree23a8678c8ce98d2010bd2805f1a64902ff28d6be /sys
parentad208cd2566edbc7e2f44632cd955549bc2d5d87 (diff)
downloadFreeBSD-src-8146a5ddd70d2a3aff48d236d2885201fff0b8aa.zip
FreeBSD-src-8146a5ddd70d2a3aff48d236d2885201fff0b8aa.tar.gz
MFi386: revisions 1.536 and 1.538.
Diffstat (limited to 'sys')
-rw-r--r--sys/pc98/i386/machdep.c10
-rw-r--r--sys/pc98/pc98/machdep.c10
2 files changed, 8 insertions, 12 deletions
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.
OpenPOWER on IntegriCloud