diff options
author | kib <kib@FreeBSD.org> | 2008-09-07 16:39:21 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2008-09-07 16:39:21 +0000 |
commit | a568a3185ee59bb37249a48388136cdb5bb0b5d0 (patch) | |
tree | 45e4f50c5c45b1c39b7b473d00236d0146aa9e03 /sys | |
parent | 3988a6e0e0d960f18b808a6e4560e7207a069255 (diff) | |
download | FreeBSD-src-a568a3185ee59bb37249a48388136cdb5bb0b5d0.zip FreeBSD-src-a568a3185ee59bb37249a48388136cdb5bb0b5d0.tar.gz |
Segment registers are stored in the uc_mcontext member of the struct
l_ucontext. To restore the registers content, trampoline needs to
dereference uc_mcontext instead of taking some undefined values from
l_ucontext.
Submitted by: Dmitry Chagin <dchagin@>
MFC after: 1 week
Diffstat (limited to 'sys')
-rw-r--r-- | sys/amd64/linux32/linux32_genassym.c | 3 | ||||
-rw-r--r-- | sys/amd64/linux32/linux32_locore.s | 5 | ||||
-rw-r--r-- | sys/i386/linux/linux_genassym.c | 1 | ||||
-rw-r--r-- | sys/i386/linux/linux_locore.s | 3 |
4 files changed, 7 insertions, 5 deletions
diff --git a/sys/amd64/linux32/linux32_genassym.c b/sys/amd64/linux32/linux32_genassym.c index de7726d..fd708dc 100644 --- a/sys/amd64/linux32/linux32_genassym.c +++ b/sys/amd64/linux32/linux32_genassym.c @@ -9,9 +9,8 @@ __FBSDID("$FreeBSD$"); ASSYM(LINUX_SIGF_HANDLER, offsetof(struct l_sigframe, sf_handler)); ASSYM(LINUX_SIGF_SC, offsetof(struct l_sigframe, sf_sc)); -ASSYM(LINUX_SC_GS, offsetof(struct l_sigcontext, sc_gs)); -ASSYM(LINUX_SC_FS, offsetof(struct l_sigcontext, sc_fs)); ASSYM(LINUX_SC_ES, offsetof(struct l_sigcontext, sc_es)); ASSYM(LINUX_SC_DS, offsetof(struct l_sigcontext, sc_ds)); ASSYM(LINUX_RT_SIGF_HANDLER, offsetof(struct l_rt_sigframe, sf_handler)); ASSYM(LINUX_RT_SIGF_UC, offsetof(struct l_rt_sigframe, sf_sc)); +ASSYM(LINUX_RT_SIGF_SC, offsetof(struct l_ucontext, uc_mcontext)); diff --git a/sys/amd64/linux32/linux32_locore.s b/sys/amd64/linux32/linux32_locore.s index 8055e56..9183374 100644 --- a/sys/amd64/linux32/linux32_locore.s +++ b/sys/amd64/linux32/linux32_locore.s @@ -23,8 +23,9 @@ NON_GPROF_ENTRY(linux_sigcode) linux_rt_sigcode: call *LINUX_RT_SIGF_HANDLER(%esp) leal LINUX_RT_SIGF_UC(%esp),%ebx /* linux ucp */ - movl LINUX_SC_ES(%ebx),%es - movl LINUX_SC_DS(%ebx),%ds + leal LINUX_RT_SIGF_SC(%ebx),%ecx /* linux sigcontext */ + movl LINUX_SC_ES(%ecx),%es + movl LINUX_SC_DS(%ecx),%ds push %eax /* fake ret addr */ movl $LINUX_SYS_linux_rt_sigreturn,%eax /* linux_rt_sigreturn() */ int $0x80 /* enter kernel with args */ diff --git a/sys/i386/linux/linux_genassym.c b/sys/i386/linux/linux_genassym.c index 3a36432..1e84572 100644 --- a/sys/i386/linux/linux_genassym.c +++ b/sys/i386/linux/linux_genassym.c @@ -13,3 +13,4 @@ ASSYM(LINUX_SC_GS, offsetof(struct l_sigcontext, sc_gs)); ASSYM(LINUX_SC_EFLAGS, offsetof(struct l_sigcontext, sc_eflags)); ASSYM(LINUX_RT_SIGF_HANDLER, offsetof(struct l_rt_sigframe, sf_handler)); ASSYM(LINUX_RT_SIGF_UC, offsetof(struct l_rt_sigframe, sf_sc)); +ASSYM(LINUX_RT_SIGF_SC, offsetof(struct l_ucontext, uc_mcontext)); diff --git a/sys/i386/linux/linux_locore.s b/sys/i386/linux/linux_locore.s index 1c23b3a..044e8e2 100644 --- a/sys/i386/linux/linux_locore.s +++ b/sys/i386/linux/linux_locore.s @@ -19,7 +19,8 @@ NON_GPROF_ENTRY(linux_sigcode) linux_rt_sigcode: call *LINUX_RT_SIGF_HANDLER(%esp) leal LINUX_RT_SIGF_UC(%esp),%ebx /* linux ucp */ - movl LINUX_SC_GS(%ebx),%gs + leal LINUX_RT_SIGF_SC(%ebx),%ecx /* linux sigcontext */ + movl LINUX_SC_GS(%ecx),%gs push %eax /* fake ret addr */ movl $LINUX_SYS_linux_rt_sigreturn,%eax /* linux_rt_sigreturn() */ int $0x80 /* enter kernel with args */ |