summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornyan <nyan@FreeBSD.org>2012-09-23 09:13:57 +0000
committernyan <nyan@FreeBSD.org>2012-09-23 09:13:57 +0000
commit12e520c0637518e03e8165b34314162cbf27952a (patch)
tree5dc74fff15984d8571b75301d488cdfb4a48be1d
parent8578bd9c62a020eda1c87c91dedaad78c4338b6a (diff)
downloadFreeBSD-src-12e520c0637518e03e8165b34314162cbf27952a.zip
FreeBSD-src-12e520c0637518e03e8165b34314162cbf27952a.tar.gz
MFi386: revision 237445
Commit changes missed from r237435. Properly calculate the signal trampoline addresses after the shared page is enabled. Handle FreeBSD ABIs without shared page support too. MFi386: revision 238792 Introduce curpcb magic variable.
-rw-r--r--sys/pc98/pc98/machdep.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c
index 38b7a28..28763c1 100644
--- a/sys/pc98/pc98/machdep.c
+++ b/sys/pc98/pc98/machdep.c
@@ -407,7 +407,13 @@ osendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
}
regs->tf_esp = (int)fp;
- regs->tf_eip = PS_STRINGS - szosigcode;
+ if (p->p_sysent->sv_sigcode_base != 0) {
+ regs->tf_eip = p->p_sysent->sv_sigcode_base + szsigcode -
+ szosigcode;
+ } else {
+ /* a.out sysentvec does not use shared page */
+ regs->tf_eip = p->p_sysent->sv_psstrings - szosigcode;
+ }
regs->tf_eflags &= ~(PSL_T | PSL_D);
regs->tf_cs = _ucodesel;
regs->tf_ds = _udatasel;
@@ -534,7 +540,8 @@ freebsd4_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
}
regs->tf_esp = (int)sfp;
- regs->tf_eip = PS_STRINGS - szfreebsd4_sigcode;
+ regs->tf_eip = p->p_sysent->sv_sigcode_base + szsigcode -
+ szfreebsd4_sigcode;
regs->tf_eflags &= ~(PSL_T | PSL_D);
regs->tf_cs = _ucodesel;
regs->tf_ds = _udatasel;
@@ -685,7 +692,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask)
}
regs->tf_esp = (int)sfp;
- regs->tf_eip = PS_STRINGS - *(p->p_sysent->sv_szsigcode);
+ regs->tf_eip = p->p_sysent->sv_sigcode_base;
regs->tf_eflags &= ~(PSL_T | PSL_D);
regs->tf_cs = _ucodesel;
regs->tf_ds = _udatasel;
@@ -1412,7 +1419,7 @@ exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
pcb->pcb_dr3 = 0;
pcb->pcb_dr6 = 0;
pcb->pcb_dr7 = 0;
- if (pcb == PCPU_GET(curpcb)) {
+ if (pcb == curpcb) {
/*
* Clear the debug registers on the running
* CPU, otherwise they will end up affecting
OpenPOWER on IntegriCloud