diff options
author | kib <kib@FreeBSD.org> | 2008-03-13 10:54:38 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2008-03-13 10:54:38 +0000 |
commit | be9c86776fd3d1b746e9d680bf5baac3baf55f1f (patch) | |
tree | 52d0fc80556549589a35e0500475ca1c8a6bf459 /sys/amd64 | |
parent | 5fad0ab9147faabf630933d7c4a60891c8e5a3e2 (diff) | |
download | FreeBSD-src-be9c86776fd3d1b746e9d680bf5baac3baf55f1f.zip FreeBSD-src-be9c86776fd3d1b746e9d680bf5baac3baf55f1f.tar.gz |
Since version 4.3, gcc changed its behaviour concerning the i386/amd64
ABI and the direction flag, that is it now assumes that the direction
flag is cleared at the entry of a function and it doesn't clear once
more if needed. This new behaviour conforms to the i386/amd64 ABI.
Modify the signal handler frame setup code to clear the DF {e,r}flags
bit on the amd64/i386 for the signal handlers.
jhb@ noted that it might break old apps if they assumed DF == 1 would be
preserved in the signal handlers, but that such apps should be rare and
that older versions of gcc would not generate such apps.
Submitted by: Aurelien Jarno <aurelien aurel32 net>
PR: 121422
Reviewed by: jhb
MFC after: 2 weeks
Diffstat (limited to 'sys/amd64')
-rw-r--r-- | sys/amd64/amd64/machdep.c | 2 | ||||
-rw-r--r-- | sys/amd64/ia32/ia32_signal.c | 4 | ||||
-rw-r--r-- | sys/amd64/linux32/linux32_sysvec.c | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index df831a1..2e03579 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -357,7 +357,7 @@ sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) regs->tf_rsp = (long)sfp; regs->tf_rip = PS_STRINGS - *(p->p_sysent->sv_szsigcode); - regs->tf_rflags &= ~PSL_T; + regs->tf_rflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucodesel; PROC_LOCK(p); mtx_lock(&psp->ps_mtx); diff --git a/sys/amd64/ia32/ia32_signal.c b/sys/amd64/ia32/ia32_signal.c index 1d693b4..a6d82a4 100644 --- a/sys/amd64/ia32/ia32_signal.c +++ b/sys/amd64/ia32/ia32_signal.c @@ -391,7 +391,7 @@ freebsd4_ia32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) regs->tf_rsp = (uintptr_t)sfp; regs->tf_rip = FREEBSD32_PS_STRINGS - sz_freebsd4_ia32_sigcode; - regs->tf_rflags &= ~PSL_T; + regs->tf_rflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucode32sel; regs->tf_ss = _udatasel; load_ds(_udatasel); @@ -511,7 +511,7 @@ ia32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) regs->tf_rsp = (uintptr_t)sfp; regs->tf_rip = FREEBSD32_PS_STRINGS - *(p->p_sysent->sv_szsigcode); - regs->tf_rflags &= ~PSL_T; + regs->tf_rflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucode32sel; regs->tf_ss = _udatasel; load_ds(_udatasel); diff --git a/sys/amd64/linux32/linux32_sysvec.c b/sys/amd64/linux32/linux32_sysvec.c index 3906852..9259092 100644 --- a/sys/amd64/linux32/linux32_sysvec.c +++ b/sys/amd64/linux32/linux32_sysvec.c @@ -401,7 +401,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) regs->tf_rsp = PTROUT(fp); regs->tf_rip = LINUX32_PS_STRINGS - *(p->p_sysent->sv_szsigcode) + linux_sznonrtsigcode; - regs->tf_rflags &= ~PSL_T; + regs->tf_rflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucode32sel; regs->tf_ss = _udatasel; load_ds(_udatasel); @@ -523,7 +523,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) */ regs->tf_rsp = PTROUT(fp); regs->tf_rip = LINUX32_PS_STRINGS - *(p->p_sysent->sv_szsigcode); - regs->tf_rflags &= ~PSL_T; + regs->tf_rflags &= ~(PSL_T | PSL_D); regs->tf_cs = _ucode32sel; regs->tf_ss = _udatasel; load_ds(_udatasel); |