aboutsummaryrefslogtreecommitdiff
path: root/sys/ia64
diff options
context:
space:
mode:
authorNathan Whitehorn <nwhitehorn@FreeBSD.org>2010-03-11 14:49:06 +0000
committerNathan Whitehorn <nwhitehorn@FreeBSD.org>2010-03-11 14:49:06 +0000
commit841c0c7ec75bef3c9920cd811270f9f84791ee04 (patch)
treee7bb2301107c48074cb0dbfffd43ee1f7e425d97 /sys/ia64
parent343803ad831302c8914105ef7dec9e7544750d1e (diff)
downloadsrc-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/ia64')
-rw-r--r--sys/ia64/conf/GENERIC1
-rw-r--r--sys/ia64/conf/NOTES4
-rw-r--r--sys/ia64/ia64/exception.S2
-rw-r--r--sys/ia64/ia64/genassym.c4
-rw-r--r--sys/ia64/ia64/machdep.c6
-rw-r--r--sys/ia64/include/elf.h1
-rw-r--r--sys/ia64/include/reg.h9
7 files changed, 19 insertions, 8 deletions
diff --git a/sys/ia64/conf/GENERIC b/sys/ia64/conf/GENERIC
index b64c0143bd4c..fed28bbb6402 100644
--- a/sys/ia64/conf/GENERIC
+++ b/sys/ia64/conf/GENERIC
@@ -28,6 +28,7 @@ makeoptions DEBUG=-g # Build kernel with debug information.
options AUDIT # Security event auditing
options CD9660 # ISO 9660 Filesystem
options COMPAT_43TTY # BSD 4.3 TTY compat (sgtty)
+options COMPAT_FREEBSD32 # Compatible with FreeBSD6
options COMPAT_FREEBSD6 # Compatible with FreeBSD6
options COMPAT_FREEBSD7 # Compatible with FreeBSD7
options DDB # Support DDB
diff --git a/sys/ia64/conf/NOTES b/sys/ia64/conf/NOTES
index 873199a61b01..3f3821856b10 100644
--- a/sys/ia64/conf/NOTES
+++ b/sys/ia64/conf/NOTES
@@ -12,10 +12,10 @@
cpu ITANIUM
cpu ITANIUM2
-# option: COMPAT_IA32
+# option: COMPAT_FREEBSD32
# This option enables the support for execution of i386 (32-bit) programs on
# ia64. It is based on the ia32 emulation in the processor.
-options COMPAT_IA32
+options COMPAT_FREEBSD32
# option: LOG2_ID_PAGE_SIZE
# Specify the log2 size of the identity (direct) mappings in regions 6 and 7
diff --git a/sys/ia64/ia64/exception.S b/sys/ia64/ia64/exception.S
index 3a4ac0331bfb..2868c8a3f771 100644
--- a/sys/ia64/ia64/exception.S
+++ b/sys/ia64/ia64/exception.S
@@ -676,7 +676,7 @@ ivt_##name: \
#define IVT_END(name) \
.endp ivt_##name
-#ifdef COMPAT_IA32
+#ifdef COMPAT_FREEBSD32
#define IA32_TRAP ia32_trap
#else
#define IA32_TRAP trap
diff --git a/sys/ia64/ia64/genassym.c b/sys/ia64/ia64/genassym.c
index 9f7625279d9c..d81054b9cea1 100644
--- a/sys/ia64/ia64/genassym.c
+++ b/sys/ia64/ia64/genassym.c
@@ -61,8 +61,8 @@
#include <net/if.h>
#include <netinet/in.h>
-#ifdef COMPAT_IA32
-ASSYM(COMPAT_IA32, COMPAT_IA32);
+#ifdef COMPAT_FREEBSD32
+ASSYM(COMPAT_FREEBSD32, COMPAT_FREEBSD32);
#endif
ASSYM(DT_NULL, DT_NULL);
diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c
index cddf6c0b8f96..cb64f7fc804a 100644
--- a/sys/ia64/ia64/machdep.c
+++ b/sys/ia64/ia64/machdep.c
@@ -443,7 +443,7 @@ cpu_switch(struct thread *old, struct thread *new, struct mtx *mtx)
struct pcb *oldpcb, *newpcb;
oldpcb = old->td_pcb;
-#ifdef COMPAT_IA32
+#ifdef COMPAT_FREEBSD32
ia32_savectx(oldpcb);
#endif
if (PCPU_GET(fpcurthread) == old)
@@ -459,7 +459,7 @@ cpu_switch(struct thread *old, struct thread *new, struct mtx *mtx)
oldpcb->pcb_current_pmap =
pmap_switch(newpcb->pcb_current_pmap);
PCPU_SET(curthread, new);
-#ifdef COMPAT_IA32
+#ifdef COMPAT_FREEBSD32
ia32_restorectx(newpcb);
#endif
if (PCPU_GET(fpcurthread) == new)
@@ -479,7 +479,7 @@ cpu_throw(struct thread *old __unused, struct thread *new)
newpcb = new->td_pcb;
(void)pmap_switch(newpcb->pcb_current_pmap);
PCPU_SET(curthread, new);
-#ifdef COMPAT_IA32
+#ifdef COMPAT_FREEBSD32
ia32_restorectx(newpcb);
#endif
restorectx(newpcb);
diff --git a/sys/ia64/include/elf.h b/sys/ia64/include/elf.h
index c6a43fcdc170..27182dbcae95 100644
--- a/sys/ia64/include/elf.h
+++ b/sys/ia64/include/elf.h
@@ -43,6 +43,7 @@
#include <sys/elf_generic.h>
#define ELF_ARCH EM_IA_64
+#define ELF_ARCH32 EM_386
#define ELF_MACHINE_OK(x) ((x) == EM_IA_64)
diff --git a/sys/ia64/include/reg.h b/sys/ia64/include/reg.h
index 453c9b831412..e95db312d4a8 100644
--- a/sys/ia64/include/reg.h
+++ b/sys/ia64/include/reg.h
@@ -31,6 +31,10 @@
#include <machine/_regset.h>
+#if defined(_KERNEL) && !defined(_STANDALONE)
+#include "opt_compat.h"
+#endif
+
struct reg {
struct _special r_special;
struct _callee_saved r_preserved;
@@ -48,6 +52,11 @@ struct dbreg {
unsigned long dbr_inst[8];
};
+#ifdef COMPAT_FREEBSD32
+#include <machine/fpu.h>
+#include <compat/ia32/ia32_reg.h>
+#endif
+
#ifdef _KERNEL
struct thread;