diff options
author | Nathan Whitehorn <nwhitehorn@FreeBSD.org> | 2010-03-11 14:49:06 +0000 |
---|---|---|
committer | Nathan Whitehorn <nwhitehorn@FreeBSD.org> | 2010-03-11 14:49:06 +0000 |
commit | 841c0c7ec75bef3c9920cd811270f9f84791ee04 (patch) | |
tree | e7bb2301107c48074cb0dbfffd43ee1f7e425d97 /sys/kern/imgact_elf.c | |
parent | 343803ad831302c8914105ef7dec9e7544750d1e (diff) | |
download | src-841c0c7ec75bef3c9920cd811270f9f84791ee04.tar.gz src-841c0c7ec75bef3c9920cd811270f9f84791ee04.zip |
Provide groundwork for 32-bit binary compatibility on non-x86 platforms,
for upcoming 64-bit PowerPC and MIPS support. This renames the COMPAT_IA32
option to COMPAT_FREEBSD32, removes some IA32-specific code from MI parts
of the kernel and enhances the freebsd32 compatibility code to support
big-endian platforms.
Reviewed by: kib, jhb
Notes
Notes:
svn path=/head/; revision=205014
Diffstat (limited to 'sys/kern/imgact_elf.c')
-rw-r--r-- | sys/kern/imgact_elf.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/sys/kern/imgact_elf.c b/sys/kern/imgact_elf.c index 7e48a3b5e641..0fffb9fb4c97 100644 --- a/sys/kern/imgact_elf.c +++ b/sys/kern/imgact_elf.c @@ -75,11 +75,6 @@ __FBSDID("$FreeBSD$"); #include <machine/elf.h> #include <machine/md_var.h> -#if defined(COMPAT_IA32) && __ELF_WORD_SIZE == 32 -#include <machine/fpu.h> -#include <compat/ia32/ia32_reg.h> -#endif - #define OLD_EI_BRAND 8 static int __elfN(check_header)(const Elf_Ehdr *hdr); @@ -1303,7 +1298,9 @@ __elfN(corehdr)(td, vp, cred, numsegs, hdr, hdrsize, gzfile) } } -#if defined(COMPAT_IA32) && __ELF_WORD_SIZE == 32 +#if defined(COMPAT_FREEBSD32) && __ELF_WORD_SIZE == 32 +#include <compat/freebsd32/freebsd32.h> + typedef struct prstatus32 elf_prstatus_t; typedef struct prpsinfo32 elf_prpsinfo_t; typedef struct fpreg32 elf_prfpregset_t; @@ -1387,7 +1384,7 @@ __elfN(puthdr)(struct thread *td, void *dst, size_t *off, int numsegs) status->pr_osreldate = osreldate; status->pr_cursig = p->p_sig; status->pr_pid = thr->td_tid; -#if defined(COMPAT_IA32) && __ELF_WORD_SIZE == 32 +#if defined(COMPAT_FREEBSD32) && __ELF_WORD_SIZE == 32 fill_regs32(thr, &status->pr_reg); fill_fpregs32(thr, fpregset); #else @@ -1439,8 +1436,8 @@ __elfN(puthdr)(struct thread *td, void *dst, size_t *off, int numsegs) ehdr->e_ident[EI_ABIVERSION] = 0; ehdr->e_ident[EI_PAD] = 0; ehdr->e_type = ET_CORE; -#if defined(COMPAT_IA32) && __ELF_WORD_SIZE == 32 - ehdr->e_machine = EM_386; +#if defined(COMPAT_FREEBSD32) && __ELF_WORD_SIZE == 32 + ehdr->e_machine = ELF_ARCH32; #else ehdr->e_machine = ELF_ARCH; #endif |