diff options
author | tjr <tjr@FreeBSD.org> | 2004-08-16 07:28:16 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2004-08-16 07:28:16 +0000 |
commit | 6d0528abdfecb0a45eec1ee51b594803b1e11866 (patch) | |
tree | 8df9260c749ffef486077cca195f2e786112fc5d /sys/compat/linux/linux_signal.c | |
parent | e6930a385cee9ccad60b87c385ea268f880443c3 (diff) | |
download | FreeBSD-src-6d0528abdfecb0a45eec1ee51b594803b1e11866.zip FreeBSD-src-6d0528abdfecb0a45eec1ee51b594803b1e11866.tar.gz |
Changes to MI Linux emulation code necessary to run 32-bit Linux binaries
on AMD64, and the general case where the emulated platform has different
size pointers than we use natively:
- declare certain structure members as l_uintptr_t and use the new PTRIN
and PTROUT macros to convert to and from native pointers.
- declare some structures __packed on amd64 when the layout would differ
from that used on i386.
- include <machine/../linux32/linux.h> instead of <machine/../linux/linux.h>
if compiling with COMPAT_LINUX32. This will need to be revisited before
32-bit and 64-bit Linux emulation support can coexist in the same kernel.
- other small scattered changes.
This should be a no-op on i386 and Alpha.
Diffstat (limited to 'sys/compat/linux/linux_signal.c')
-rw-r--r-- | sys/compat/linux/linux_signal.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/sys/compat/linux/linux_signal.c b/sys/compat/linux/linux_signal.c index ba2b460..2bb7250 100644 --- a/sys/compat/linux/linux_signal.c +++ b/sys/compat/linux/linux_signal.c @@ -38,8 +38,15 @@ __FBSDID("$FreeBSD$"); #include <sys/syscallsubr.h> #include <sys/sysproto.h> +#include "opt_compat.h" + +#if !COMPAT_LINUX32 #include <machine/../linux/linux.h> #include <machine/../linux/linux_proto.h> +#else +#include <machine/../linux32/linux.h> +#include <machine/../linux32/linux32_proto.h> +#endif #include <compat/linux/linux_signal.h> #include <compat/linux/linux_util.h> @@ -90,7 +97,7 @@ linux_to_bsd_sigaction(l_sigaction_t *lsa, struct sigaction *bsa) { linux_to_bsd_sigset(&lsa->lsa_mask, &bsa->sa_mask); - bsa->sa_handler = lsa->lsa_handler; + bsa->sa_handler = PTRIN(lsa->lsa_handler); bsa->sa_flags = 0; if (lsa->lsa_flags & LINUX_SA_NOCLDSTOP) bsa->sa_flags |= SA_NOCLDSTOP; @@ -113,8 +120,12 @@ bsd_to_linux_sigaction(struct sigaction *bsa, l_sigaction_t *lsa) { bsd_to_linux_sigset(&bsa->sa_mask, &lsa->lsa_mask); +#if COMPAT_LINUX32 + lsa->lsa_handler = (uintptr_t)bsa->sa_handler; +#else lsa->lsa_handler = bsa->sa_handler; - lsa->lsa_restorer = NULL; /* unsupported */ +#endif + lsa->lsa_restorer = 0; /* unsupported */ lsa->lsa_flags = 0; if (bsa->sa_flags & SA_NOCLDSTOP) lsa->lsa_flags |= LINUX_SA_NOCLDSTOP; @@ -185,7 +196,7 @@ linux_signal(struct thread *td, struct linux_signal_args *args) LINUX_SIGEMPTYSET(nsa.lsa_mask); error = linux_do_sigaction(td, args->sig, &nsa, &osa); - td->td_retval[0] = (int)osa.lsa_handler; + td->td_retval[0] = (int)(intptr_t)osa.lsa_handler; return (error); } |