Post by Julian ElischerI certainly agree.. can it be changed please?
I've waited a while to see what other opinions would be expressed on this
topic. I believe there is sufficient support to rename COMPAT_FREEBSD32
to something else based on responses in the mailing lists.
I am sorry if some may wish to label this a "bikeshead". But we seem to
have many folks disliking "COMPAT_FREEBSD32".
Based on responses to the topic of COMPAT_FREEBSD32, the following
were the suggestions offered:
COMPAT_ARCH32, COMPAT_ARCH_32BIT, COMPAT_32BIT_ARCH, COMPAT_32BIT,
COMPAT_FREEBSD32BIT
I went with the first as it seemed the most direct to me, but I find
all but the last are suitable as well. (The last is probably too close
to COMPAT_FREEBSDn given we do have other suggestions.)
This patch was produced by checking out a fresh tree and running this
command from the top level:
wcfind sys -type f | xargs fgrep -l COMPAT_FREEBSD32 | xargs \
sed -i '' \
-e 's/COMPAT_FREEBSD32/COMPAT_ARCH32/g' \
-e 's/compat_freebsd32/compat_arch32/g'
svn revert -R sys/compat/freebsd32
Thoughts?
--
-- David (***@FreeBSD.org)
Index: conf/options.amd64
===================================================================
--- conf/options.amd64 (revision 205451)
+++ conf/options.amd64 (working copy)
@@ -11,7 +11,7 @@ MP_WATCHDOG
# Options for emulators. These should only be used at config time, so
# they are handled like options for static filesystems
# (see src/sys/conf/options), except for broken debugging options.
-COMPAT_FREEBSD32 opt_compat.h
+COMPAT_ARCH32 opt_compat.h
#IBCS2 opt_dontuse.h
#COMPAT_LINUX opt_dontuse.h
COMPAT_LINUX32 opt_compat.h
Index: conf/options.ia64
===================================================================
--- conf/options.ia64 (revision 205451)
+++ conf/options.ia64 (working copy)
@@ -9,7 +9,7 @@ LOG2_PAGE_SIZE opt_global.h
UWX_TRACE_ENABLE opt_global.h
-COMPAT_FREEBSD32 opt_compat.h
+COMPAT_ARCH32 opt_compat.h
EXCEPTION_TRACING opt_xtrace.h
Index: conf/files.ia64
===================================================================
--- conf/files.ia64 (revision 205451)
+++ conf/files.ia64 (working copy)
@@ -28,11 +28,11 @@ ukbdmap.h optional ukbd_dflt_keymap \
no-obj no-implicit-rule before-depend \
clean "ukbdmap.h"
#
-compat/freebsd32/freebsd32_ioctl.c optional compat_freebsd32
-compat/freebsd32/freebsd32_misc.c optional compat_freebsd32
-compat/freebsd32/freebsd32_syscalls.c optional compat_freebsd32
-compat/freebsd32/freebsd32_sysent.c optional compat_freebsd32
-compat/ia32/ia32_sysvec.c optional compat_freebsd32
+compat/freebsd32/freebsd32_ioctl.c optional compat_arch32
+compat/freebsd32/freebsd32_misc.c optional compat_arch32
+compat/freebsd32/freebsd32_syscalls.c optional compat_arch32
+compat/freebsd32/freebsd32_sysent.c optional compat_arch32
+compat/ia32/ia32_sysvec.c optional compat_arch32
contrib/ia64/libuwx/src/uwx_bstream.c standard
contrib/ia64/libuwx/src/uwx_context.c standard
contrib/ia64/libuwx/src/uwx_env.c standard
@@ -68,10 +68,10 @@ ia64/acpica/madt.c optional acpi
ia64/disasm/disasm_decode.c standard
ia64/disasm/disasm_extract.c standard
ia64/disasm/disasm_format.c standard
-ia64/ia32/ia32_misc.c optional compat_freebsd32
-ia64/ia32/ia32_reg.c optional compat_freebsd32
-ia64/ia32/ia32_signal.c optional compat_freebsd32
-ia64/ia32/ia32_trap.c optional compat_freebsd32
+ia64/ia32/ia32_misc.c optional compat_arch32
+ia64/ia32/ia32_reg.c optional compat_arch32
+ia64/ia32/ia32_signal.c optional compat_arch32
+ia64/ia32/ia32_trap.c optional compat_arch32
ia64/ia64/autoconf.c standard
ia64/ia64/bus_machdep.c standard
ia64/ia64/busdma_machdep.c standard
@@ -117,7 +117,7 @@ ia64/isa/isa_dma.c optional isa
ia64/pci/pci_cfgreg.c optional pci
isa/syscons_isa.c optional sc
isa/vga_isa.c optional vga
-kern/imgact_elf32.c optional compat_freebsd32
+kern/imgact_elf32.c optional compat_arch32
libkern/bcmp.c standard
libkern/ffsl.c standard
libkern/fls.c standard
Index: conf/files.amd64
===================================================================
--- conf/files.amd64 (revision 205451)
+++ conf/files.amd64 (working copy)
@@ -227,20 +227,20 @@ kern/link_elf_obj.c standard
#
# IA32 binary support
#
-#amd64/ia32/ia32_exception.S optional compat_freebsd32
-amd64/ia32/ia32_reg.c optional compat_freebsd32
-amd64/ia32/ia32_signal.c optional compat_freebsd32
-amd64/ia32/ia32_sigtramp.S optional compat_freebsd32
-amd64/ia32/ia32_syscall.c optional compat_freebsd32
-amd64/ia32/ia32_misc.c optional compat_freebsd32
-compat/freebsd32/freebsd32_ioctl.c optional compat_freebsd32
-compat/freebsd32/freebsd32_misc.c optional compat_freebsd32
-compat/freebsd32/freebsd32_syscalls.c optional compat_freebsd32
-compat/freebsd32/freebsd32_sysent.c optional compat_freebsd32
-compat/ia32/ia32_sysvec.c optional compat_freebsd32
+#amd64/ia32/ia32_exception.S optional compat_arch32
+amd64/ia32/ia32_reg.c optional compat_arch32
+amd64/ia32/ia32_signal.c optional compat_arch32
+amd64/ia32/ia32_sigtramp.S optional compat_arch32
+amd64/ia32/ia32_syscall.c optional compat_arch32
+amd64/ia32/ia32_misc.c optional compat_arch32
+compat/freebsd32/freebsd32_ioctl.c optional compat_arch32
+compat/freebsd32/freebsd32_misc.c optional compat_arch32
+compat/freebsd32/freebsd32_syscalls.c optional compat_arch32
+compat/freebsd32/freebsd32_sysent.c optional compat_arch32
+compat/ia32/ia32_sysvec.c optional compat_arch32
compat/linprocfs/linprocfs.c optional linprocfs
compat/linsysfs/linsysfs.c optional linsysfs
-kern/imgact_elf32.c optional compat_freebsd32
+kern/imgact_elf32.c optional compat_arch32
#
# Linux/i386 binary support
#
Index: kern/kern_jail.c
===================================================================
--- kern/kern_jail.c (revision 205451)
+++ kern/kern_jail.c (working copy)
@@ -734,7 +734,7 @@ kern_jail_set(struct thread *td, struct
}
}
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
if (td->td_proc->p_sysent->sv_flags & SV_ILP32) {
uint32_t hid32;
@@ -1961,7 +1961,7 @@ kern_jail_get(struct thread *td, struct
error = vfs_setopts(opts, "host.hostuuid", pr->pr_hostuuid);
if (error != 0 && error != ENOENT)
goto done_deref;
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
if (td->td_proc->p_sysent->sv_flags & SV_ILP32) {
uint32_t hid32 = pr->pr_hostid;
Index: kern/sysv_msg.c
===================================================================
--- kern/sysv_msg.c (revision 205451)
+++ kern/sysv_msg.c (working copy)
@@ -165,7 +165,7 @@ static struct syscall_helper_data msg_sy
SYSCALL_INIT_LAST
};
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
#include <compat/freebsd32/freebsd32.h>
#include <compat/freebsd32/freebsd32_ipc.h>
#include <compat/freebsd32/freebsd32_proto.h>
@@ -274,7 +274,7 @@ msginit()
error = syscall_helper_register(msg_syscalls);
if (error != 0)
return (error);
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
error = syscall32_helper_register(msg32_syscalls);
if (error != 0)
return (error);
@@ -292,7 +292,7 @@ msgunload()
#endif
syscall_helper_unregister(msg_syscalls);
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
syscall32_helper_unregister(msg32_syscalls);
#endif
@@ -1304,7 +1304,7 @@ SYSCTL_INT(_kern_ipc, OID_AUTO, msgseg,
SYSCTL_PROC(_kern_ipc, OID_AUTO, msqids, CTLFLAG_RD,
NULL, 0, sysctl_msqids, "", "Message queue IDs");
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
int
freebsd32_msgsys(struct thread *td, struct freebsd32_msgsys_args *uap)
{
Index: kern/uipc_mqueue.c
===================================================================
--- kern/uipc_mqueue.c (revision 205451)
+++ kern/uipc_mqueue.c (working copy)
@@ -2563,7 +2563,7 @@ static struct syscall_helper_data mq_sys
SYSCALL_INIT_LAST
};
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
#include <compat/freebsd32/freebsd32.h>
#include <compat/freebsd32/freebsd32_proto.h>
#include <compat/freebsd32/freebsd32_syscall.h>
@@ -2711,7 +2711,7 @@ mqinit(void)
error = syscall_helper_register(mq_syscalls);
if (error != 0)
return (error);
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
error = syscall32_helper_register(mq32_syscalls);
if (error != 0)
return (error);
@@ -2723,7 +2723,7 @@ static int
mqunload(void)
{
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
syscall32_helper_unregister(mq32_syscalls);
#endif
syscall_helper_unregister(mq_syscalls);
Index: kern/kern_umtx.c
===================================================================
--- kern/kern_umtx.c (revision 205451)
+++ kern/kern_umtx.c (working copy)
@@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$");
#include <machine/cpu.h>
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
#include <compat/freebsd32/freebsd32_proto.h>
#endif
@@ -818,7 +818,7 @@ do_unlock_umtx(struct thread *td, struct
return (0);
}
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
/*
* Lock a umtx object.
@@ -3269,7 +3269,7 @@ _umtx_op(struct thread *td, struct _umtx
return (EINVAL);
}
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
int
freebsd32_umtx_lock(struct thread *td, struct freebsd32_umtx_lock_args *uap)
/* struct umtx *umtx */
Index: kern/kern_thr.c
===================================================================
--- kern/kern_thr.c (revision 205451)
+++ kern/kern_thr.c (working copy)
@@ -55,7 +55,7 @@ __FBSDID("$FreeBSD$");
#include <security/audit/audit.h>
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
static inline int
suword_lwpid(void *addr, lwpid_t lwpid)
Index: kern/uipc_syscalls.c
===================================================================
--- kern/uipc_syscalls.c (revision 205451)
+++ kern/uipc_syscalls.c (working copy)
@@ -70,7 +70,7 @@ __FBSDID("$FreeBSD$");
#ifdef KTRACE
#include <sys/ktrace.h>
#endif
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
#include <compat/freebsd32/freebsd32_util.h>
#endif
@@ -2517,7 +2517,7 @@ sctp_generic_sendmsg_iov(td, uap)
if (error)
goto sctp_bad1;
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
if (SV_CURPROC_FLAG(SV_ILP32))
error = freebsd32_copyiniov((struct iovec32 *)uap->iov,
uap->iovlen, &iov, EMSGSIZE);
@@ -2625,7 +2625,7 @@ sctp_generic_recvmsg(td, uap)
if (error) {
return (error);
}
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
if (SV_CURPROC_FLAG(SV_ILP32))
error = freebsd32_copyiniov((struct iovec32 *)uap->iov,
uap->iovlen, &iov, EMSGSIZE);
Index: kern/sysv_sem.c
===================================================================
--- kern/sysv_sem.c (revision 205451)
+++ kern/sysv_sem.c (working copy)
@@ -226,7 +226,7 @@ static struct syscall_helper_data sem_sy
SYSCALL_INIT_LAST
};
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
#include <compat/freebsd32/freebsd32.h>
#include <compat/freebsd32/freebsd32_ipc.h>
#include <compat/freebsd32/freebsd32_proto.h>
@@ -295,7 +295,7 @@ seminit(void)
error = syscall_helper_register(sem_syscalls);
if (error != 0)
return (error);
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
error = syscall32_helper_register(sem32_syscalls);
if (error != 0)
return (error);
@@ -312,7 +312,7 @@ semunload(void)
if (semtot != 0)
return (EBUSY);
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
syscall32_helper_unregister(sem32_syscalls);
#endif
syscall_helper_unregister(sem_syscalls);
@@ -1479,7 +1479,7 @@ freebsd7___semctl(struct thread *td, str
#endif /* COMPAT_FREEBSD{4,5,6,7} */
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
int
freebsd32_semsys(struct thread *td, struct freebsd32_semsys_args *uap)
@@ -1645,4 +1645,4 @@ freebsd32_semctl(struct thread *td, stru
return (error);
}
-#endif /* COMPAT_FREEBSD32 */
+#endif /* COMPAT_ARCH32 */
Index: kern/uipc_socket.c
===================================================================
--- kern/uipc_socket.c (revision 205451)
+++ kern/uipc_socket.c (working copy)
@@ -136,7 +136,7 @@ __FBSDID("$FreeBSD$");
#include <vm/uma.h>
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
#include <sys/mount.h>
#include <sys/sysent.h>
#include <compat/freebsd32/freebsd32.h>
@@ -2507,7 +2507,7 @@ sosetopt(struct socket *so, struct socko
case SO_SNDTIMEO:
case SO_RCVTIMEO:
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
if (SV_CURPROC_FLAG(SV_ILP32)) {
struct timeval32 tv32;
@@ -2688,7 +2688,7 @@ integer:
tv.tv_sec = optval / hz;
tv.tv_usec = (optval % hz) * tick;
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
if (SV_CURPROC_FLAG(SV_ILP32)) {
struct timeval32 tv32;
Index: kern/imgact_elf.c
===================================================================
--- kern/imgact_elf.c (revision 205451)
+++ kern/imgact_elf.c (working copy)
@@ -1298,7 +1298,7 @@ __elfN(corehdr)(td, vp, cred, numsegs, h
}
}
-#if defined(COMPAT_FREEBSD32) && __ELF_WORD_SIZE == 32
+#if defined(COMPAT_ARCH32) && __ELF_WORD_SIZE == 32
#include <compat/freebsd32/freebsd32.h>
typedef struct prstatus32 elf_prstatus_t;
@@ -1384,7 +1384,7 @@ __elfN(puthdr)(struct thread *td, void *
status->pr_osreldate = osreldate;
status->pr_cursig = p->p_sig;
status->pr_pid = thr->td_tid;
-#if defined(COMPAT_FREEBSD32) && __ELF_WORD_SIZE == 32
+#if defined(COMPAT_ARCH32) && __ELF_WORD_SIZE == 32
fill_regs32(thr, &status->pr_reg);
fill_fpregs32(thr, fpregset);
#else
@@ -1436,7 +1436,7 @@ __elfN(puthdr)(struct thread *td, void *
ehdr->e_ident[EI_ABIVERSION] = 0;
ehdr->e_ident[EI_PAD] = 0;
ehdr->e_type = ET_CORE;
-#if defined(COMPAT_FREEBSD32) && __ELF_WORD_SIZE == 32
+#if defined(COMPAT_ARCH32) && __ELF_WORD_SIZE == 32
ehdr->e_machine = ELF_ARCH32;
#else
ehdr->e_machine = ELF_ARCH;
Index: kern/sysv_shm.c
===================================================================
--- kern/sysv_shm.c (revision 205451)
+++ kern/sysv_shm.c (working copy)
@@ -831,7 +831,7 @@ static struct syscall_helper_data shm_sy
SYSCALL_INIT_LAST
};
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
#include <compat/freebsd32/freebsd32.h>
#include <compat/freebsd32/freebsd32_ipc.h>
#include <compat/freebsd32/freebsd32_proto.h>
@@ -896,7 +896,7 @@ shminit()
error = syscall_helper_register(shm_syscalls);
if (error != 0)
return (error);
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
error = syscall32_helper_register(shm32_syscalls);
if (error != 0)
return (error);
@@ -914,7 +914,7 @@ shmunload()
if (shm_nused > 0)
return (EBUSY);
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
syscall32_helper_unregister(shm32_syscalls);
#endif
syscall_helper_unregister(shm_syscalls);
@@ -1039,7 +1039,7 @@ shmsys(td, uap)
#endif /* i386 && (COMPAT_FREEBSD4 || COMPAT_43) */
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
int
freebsd32_shmsys(struct thread *td, struct freebsd32_shmsys_args *uap)
Index: kern/uipc_sem.c
===================================================================
--- kern/uipc_sem.c (revision 205451)
+++ kern/uipc_sem.c (working copy)
@@ -380,13 +380,13 @@ ksem_create_copyout_semid(struct thread
int compat32)
{
semid_t semid;
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
int32_t semid32;
#endif
void *ptr;
size_t ptrs;
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
if (compat32) {
semid32 = fd;
ptr = &semid32;
@@ -397,7 +397,7 @@ ksem_create_copyout_semid(struct thread
ptr = &semid;
ptrs = sizeof(semid);
compat32 = 0; /* silence gcc */
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
}
#endif
@@ -874,7 +874,7 @@ static struct syscall_helper_data ksem_s
SYSCALL_INIT_LAST
};
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
#include <compat/freebsd32/freebsd32.h>
#include <compat/freebsd32/freebsd32_proto.h>
#include <compat/freebsd32/freebsd32_signal.h>
@@ -955,7 +955,7 @@ ksem_module_init(void)
error = syscall_helper_register(ksem_syscalls);
if (error)
return (error);
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
error = syscall32_helper_register(ksem32_syscalls);
if (error)
return (error);
@@ -967,7 +967,7 @@ static void
ksem_module_destroy(void)
{
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
syscall32_helper_unregister(ksem32_syscalls);
#endif
syscall_helper_unregister(ksem_syscalls);
Index: kern/vfs_aio.c
===================================================================
--- kern/vfs_aio.c (revision 205451)
+++ kern/vfs_aio.c (working copy)
@@ -435,7 +435,7 @@ static struct syscall_helper_data aio_sy
SYSCALL_INIT_LAST
};
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
#include <sys/mount.h>
#include <sys/socket.h>
#include <compat/freebsd32/freebsd32.h>
@@ -508,7 +508,7 @@ aio_onceonly(void)
error = syscall_helper_register(aio_syscalls);
if (error)
return (error);
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
error = syscall32_helper_register(aio32_syscalls);
if (error)
return (error);
@@ -535,7 +535,7 @@ aio_unload(void)
if (!unloadable)
return (EOPNOTSUPP);
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
syscall32_helper_unregister(aio32_syscalls);
#endif
syscall_helper_unregister(aio_syscalls);
@@ -2577,7 +2577,7 @@ filt_lio(struct knote *kn, long hint)
return (lj->lioj_flags & LIOJ_KEVENT_POSTED);
}
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
struct __aiocb_private32 {
int32_t status;
Index: kern/sys_process.c
===================================================================
--- kern/sys_process.c (revision 205451)
+++ kern/sys_process.c (working copy)
@@ -62,7 +62,7 @@ __FBSDID("$FreeBSD$");
#include <vm/vm_pager.h>
#include <vm/vm_param.h>
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
#include <sys/procfs.h>
struct ptrace_io_desc32 {
@@ -170,7 +170,7 @@ proc_write_fpregs(struct thread *td, str
PROC_ACTION(set_fpregs(td, fpregs));
}
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
/* For 32 bit binaries, we need to expose the 32 bit regs layouts. */
int
proc_read_regs32(struct thread *td, struct reg32 *regs32)
@@ -471,7 +471,7 @@ ptrace_vm_entry(struct thread *td, struc
return (error);
}
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
static int
ptrace_vm_entry32(struct thread *td, struct proc *p,
struct ptrace_vm_entry32 *pve32)
@@ -498,7 +498,7 @@ ptrace_vm_entry32(struct thread *td, str
pve32->pve_pathlen = pve.pve_pathlen;
return (error);
}
-#endif /* COMPAT_FREEBSD32 */
+#endif /* COMPAT_ARCH32 */
/*
* Process debugging system call.
@@ -512,7 +512,7 @@ struct ptrace_args {
};
#endif
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
/*
* This CPP subterfuge is to try and reduce the number of ifdefs in
* the body of the code.
@@ -547,7 +547,7 @@ ptrace(struct thread *td, struct ptrace_
struct dbreg dbreg;
struct fpreg fpreg;
struct reg reg;
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
struct dbreg32 dbreg32;
struct fpreg32 fpreg32;
struct reg32 reg32;
@@ -557,7 +557,7 @@ ptrace(struct thread *td, struct ptrace_
} r;
void *addr;
int error = 0;
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
int wrap32 = 0;
if (SV_CURPROC_FLAG(SV_ILP32))
@@ -625,7 +625,7 @@ ptrace(struct thread *td, struct ptrace_
#undef COPYIN
#undef COPYOUT
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
/*
* PROC_READ(regs, td2, addr);
* becomes either:
@@ -659,7 +659,7 @@ kern_ptrace(struct thread *td, int req,
int error, write, tmp, num;
int proctree_locked = 0;
lwpid_t tid = 0, *buf;
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
int wrap32 = 0, safe = 0;
struct ptrace_io_desc32 *piod32 = NULL;
#endif
@@ -747,7 +747,7 @@ kern_ptrace(struct thread *td, int req,
tid = td2->td_tid;
}
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
/*
* Test if we're a 32 bit client and what the target is.
* Set the wrap controls accordingly.
@@ -1015,7 +1015,7 @@ kern_ptrace(struct thread *td, int req,
break;
case PT_IO:
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
if (wrap32) {
piod32 = addr;
iov.iov_base = (void *)(uintptr_t)piod32->piod_addr;
@@ -1035,7 +1035,7 @@ kern_ptrace(struct thread *td, int req,
uio.uio_iovcnt = 1;
uio.uio_segflg = UIO_USERSPACE;
uio.uio_td = td;
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
tmp = wrap32 ? piod32->piod_op : piod->piod_op;
#else
tmp = piod->piod_op;
@@ -1056,7 +1056,7 @@ kern_ptrace(struct thread *td, int req,
}
PROC_UNLOCK(p);
error = proc_rwmem(p, &uio);
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
if (wrap32)
piod32->piod_len -= uio.uio_resid;
else
@@ -1145,7 +1145,7 @@ kern_ptrace(struct thread *td, int req,
case PT_VM_ENTRY:
PROC_UNLOCK(p);
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
if (wrap32)
error = ptrace_vm_entry32(td, p, addr);
else
Index: kern/sysv_ipc.c
===================================================================
--- kern/sysv_ipc.c (revision 205451)
+++ kern/sysv_ipc.c (working copy)
@@ -179,7 +179,7 @@ ipcperm_new2old(struct ipc_perm *new, st
}
#endif
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
#include <sys/mount.h>
#include <sys/socket.h>
#include <compat/freebsd32/freebsd32.h>
Index: kern/kern_module.c
===================================================================
--- kern/kern_module.c (revision 205451)
+++ kern/kern_module.c (working copy)
@@ -446,7 +446,7 @@ modfind(struct thread *td, struct modfin
MODULE_VERSION(kernel, __FreeBSD_version);
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
#include <sys/mount.h>
#include <sys/socket.h>
#include <compat/freebsd32/freebsd32_util.h>
Index: ia64/ia64/exception.S
===================================================================
--- ia64/ia64/exception.S (revision 205451)
+++ ia64/ia64/exception.S (working copy)
@@ -676,7 +676,7 @@ ivt_##name: \
#define IVT_END(name) \
.endp ivt_##name
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
#define IA32_TRAP ia32_trap
#else
#define IA32_TRAP trap
Index: ia64/ia64/genassym.c
===================================================================
--- ia64/ia64/genassym.c (revision 205451)
+++ ia64/ia64/genassym.c (working copy)
@@ -61,8 +61,8 @@
#include <net/if.h>
#include <netinet/in.h>
-#ifdef COMPAT_FREEBSD32
-ASSYM(COMPAT_FREEBSD32, COMPAT_FREEBSD32);
+#ifdef COMPAT_ARCH32
+ASSYM(COMPAT_ARCH32, COMPAT_ARCH32);
#endif
ASSYM(DT_NULL, DT_NULL);
Index: ia64/ia64/machdep.c
===================================================================
--- ia64/ia64/machdep.c (revision 205451)
+++ ia64/ia64/machdep.c (working copy)
@@ -440,7 +440,7 @@ cpu_switch(struct thread *old, struct th
struct pcb *oldpcb, *newpcb;
oldpcb = old->td_pcb;
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
ia32_savectx(oldpcb);
#endif
if (PCPU_GET(fpcurthread) == old)
@@ -459,7 +459,7 @@ cpu_switch(struct thread *old, struct th
PCPU_SET(curthread, new);
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
ia32_restorectx(newpcb);
#endif
@@ -487,7 +487,7 @@ cpu_throw(struct thread *old __unused, s
PCPU_SET(curthread, new);
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
ia32_restorectx(newpcb);
#endif
Index: ia64/include/reg.h
===================================================================
--- ia64/include/reg.h (revision 205451)
+++ ia64/include/reg.h (working copy)
@@ -52,7 +52,7 @@ struct dbreg {
unsigned long dbr_inst[8];
};
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
#include <machine/fpu.h>
#include <compat/ia32/ia32_reg.h>
#endif
Index: ia64/conf/NOTES
===================================================================
--- ia64/conf/NOTES (revision 205451)
+++ ia64/conf/NOTES (working copy)
@@ -12,10 +12,10 @@
cpu ITANIUM
cpu ITANIUM2
-# option: COMPAT_FREEBSD32
+# option: COMPAT_ARCH32
# 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_FREEBSD32
+options COMPAT_ARCH32
# option: LOG2_ID_PAGE_SIZE
# Specify the log2 size of the identity (direct) mappings in regions 6 and 7
Index: modules/procfs/Makefile
===================================================================
--- modules/procfs/Makefile (revision 205451)
+++ modules/procfs/Makefile (working copy)
@@ -35,7 +35,7 @@ opt_compat.h:
echo "#define COMPAT_FREEBSD5 1" >> ${.TARGET}
echo "#define COMPAT_FREEBSD6 1" >> ${.TARGET}
.if ${MACHINE_ARCH} == "amd64"
- echo "#define COMPAT_FREEBSD32 1" >> ${.TARGET}
+ echo "#define COMPAT_ARCH32 1" >> ${.TARGET}
echo "#define COMPAT_LINUX32 1" >> ${.TARGET}
.endif
.endif
Index: modules/linux/Makefile
===================================================================
--- modules/linux/Makefile (revision 205451)
+++ modules/linux/Makefile (working copy)
@@ -2,7 +2,7 @@
.if ${MACHINE_ARCH} == "amd64"
SFX= 32
-CFLAGS+=-DCOMPAT_FREEBSD32 -DCOMPAT_LINUX32
+CFLAGS+=-DCOMPAT_ARCH32 -DCOMPAT_LINUX32
.endif
.PATH: ${.CURDIR}/../../compat/linux ${.CURDIR}/../../${MACHINE_ARCH}/linux${SFX}
Index: fs/procfs/procfs_fpregs.c
===================================================================
--- fs/procfs/procfs_fpregs.c (revision 205451)
+++ fs/procfs/procfs_fpregs.c (working copy)
@@ -53,7 +53,7 @@
#include <fs/pseudofs/pseudofs.h>
#include <fs/procfs/procfs.h>
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
#include <sys/procfs.h>
#include <machine/fpu.h>
@@ -83,7 +83,7 @@ procfs_doprocfpregs(PFS_FILL_ARGS)
int error;
struct fpreg r;
struct thread *td2;
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
struct fpreg32 r32;
int wrap32 = 0;
#endif
@@ -100,7 +100,7 @@ procfs_doprocfpregs(PFS_FILL_ARGS)
/* XXXKSE: */
td2 = FIRST_THREAD_IN_PROC(p);
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
if (SV_CURPROC_FLAG(SV_ILP32)) {
if ((td2->td_proc->p_sysent->sv_flags & SV_ILP32) == 0) {
PROC_UNLOCK(p);
Index: fs/procfs/procfs_regs.c
===================================================================
--- fs/procfs/procfs_regs.c (revision 205451)
+++ fs/procfs/procfs_regs.c (working copy)
@@ -53,7 +53,7 @@
#include <fs/pseudofs/pseudofs.h>
#include <fs/procfs/procfs.h>
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
#include <sys/procfs.h>
#include <machine/fpu.h>
@@ -83,7 +83,7 @@ procfs_doprocregs(PFS_FILL_ARGS)
int error;
struct reg r;
struct thread *td2;
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
struct reg32 r32;
int wrap32 = 0;
#endif
@@ -100,7 +100,7 @@ procfs_doprocregs(PFS_FILL_ARGS)
/* XXXKSE: */
td2 = FIRST_THREAD_IN_PROC(p);
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
if (SV_CURPROC_FLAG(SV_ILP32)) {
if ((td2->td_proc->p_sysent->sv_flags & SV_ILP32) == 0) {
PROC_UNLOCK(p);
Index: fs/procfs/procfs_dbregs.c
===================================================================
--- fs/procfs/procfs_dbregs.c (revision 205451)
+++ fs/procfs/procfs_dbregs.c (working copy)
@@ -59,7 +59,7 @@
#include <fs/pseudofs/pseudofs.h>
#include <fs/procfs/procfs.h>
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
#include <sys/procfs.h>
#include <machine/fpu.h>
@@ -89,7 +89,7 @@ procfs_doprocdbregs(PFS_FILL_ARGS)
int error;
struct dbreg r;
struct thread *td2;
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
struct dbreg32 r32;
int wrap32 = 0;
#endif
@@ -105,7 +105,7 @@ procfs_doprocdbregs(PFS_FILL_ARGS)
}
td2 = FIRST_THREAD_IN_PROC(p);
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
if (SV_CURPROC_FLAG(SV_ILP32)) {
if ((td2->td_proc->p_sysent->sv_flags & SV_ILP32) == 0) {
PROC_UNLOCK(p);
Index: fs/procfs/procfs_ioctl.c
===================================================================
--- fs/procfs/procfs_ioctl.c (revision 205451)
+++ fs/procfs/procfs_ioctl.c (working copy)
@@ -42,7 +42,7 @@
#include <fs/pseudofs/pseudofs.h>
#include <fs/procfs/procfs.h>
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
struct procfs_status32 {
int state; /* Running, stopped, something else? */
int flags; /* Any flags */
@@ -62,7 +62,7 @@ int
procfs_ioctl(PFS_IOCTL_ARGS)
{
struct procfs_status *ps;
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
struct procfs_status32 *ps32;
#endif
int error, flags, sig;
@@ -142,7 +142,7 @@ procfs_ioctl(PFS_IOCTL_ARGS)
ps->why = p->p_step ? p->p_stype : 0;
ps->val = p->p_step ? p->p_xstat : 0;
break;
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
case PIOCWAIT32:
while (p->p_step == 0 && (p->p_flag & P_WEXIT) == 0) {
/* sleep until p stops */
Index: fs/procfs/procfs_map.c
===================================================================
--- fs/procfs/procfs_map.c (revision 205451)
+++ fs/procfs/procfs_map.c (working copy)
@@ -47,7 +47,7 @@
#include <sys/proc.h>
#include <sys/resourcevar.h>
#include <sys/sbuf.h>
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
#include <sys/sysent.h>
#endif
#include <sys/uio.h>
@@ -86,7 +86,7 @@ procfs_doprocmap(PFS_FILL_ARGS)
struct uidinfo *uip;
int error, vfslocked;
unsigned int last_timestamp;
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
int wrap32 = 0;
#endif
@@ -99,7 +99,7 @@ procfs_doprocmap(PFS_FILL_ARGS)
if (uio->uio_rw != UIO_READ)
return (EOPNOTSUPP);
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
if (curproc->p_sysent->sv_flags & SV_ILP32) {
if (!(p->p_sysent->sv_flags & SV_ILP32))
return (EOPNOTSUPP);
@@ -209,7 +209,7 @@ procfs_doprocmap(PFS_FILL_ARGS)
"0x%lx 0x%lx %d %d %p %s%s%s %d %d 0x%x %s %s %s %s %s %d\n",
(u_long)e_start, (u_long)e_end,
resident, privateresident,
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
wrap32 ? NULL : obj, /* Hide 64 bit value */
#else
obj,
Index: amd64/include/reg.h
===================================================================
--- amd64/include/reg.h (revision 205451)
+++ amd64/include/reg.h (working copy)
@@ -120,7 +120,7 @@ struct dbreg {
#define DBREG_DRX(d,x) ((d)->dr[(x)]) /* reference dr0 - dr15 by
register number */
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
#include <machine/fpu.h>
#include <compat/ia32/ia32_reg.h>
#endif
Index: amd64/linux32/linux32_sysvec.c
===================================================================
--- amd64/linux32/linux32_sysvec.c (revision 205451)
+++ amd64/linux32/linux32_sysvec.c (working copy)
@@ -34,8 +34,8 @@
__FBSDID("$FreeBSD$");
#include "opt_compat.h"
-#ifndef COMPAT_FREEBSD32
-#error "Unable to compile Linux-emulator due to missing COMPAT_FREEBSD32 option!"
+#ifndef COMPAT_ARCH32
+#error "Unable to compile Linux-emulator due to missing COMPAT_ARCH32 option!"
#endif
#define __ELF_WORD_SIZE 32
Index: amd64/conf/XENHVM
===================================================================
--- amd64/conf/XENHVM (revision 205451)
+++ amd64/conf/XENHVM (working copy)
@@ -45,7 +45,7 @@ options PROCFS # Process filesystem (
options PSEUDOFS # Pseudo-filesystem framework
options GEOM_PART_GPT # GUID Partition Tables.
options GEOM_LABEL # Provides labelization
-options COMPAT_FREEBSD32 # Compatible with i386 binaries
+options COMPAT_ARCH32 # Compatible with i386 binaries
options COMPAT_FREEBSD4 # Compatible with FreeBSD4
options COMPAT_FREEBSD5 # Compatible with FreeBSD5
options COMPAT_FREEBSD6 # Compatible with FreeBSD6
Index: amd64/conf/NOTES
===================================================================
--- amd64/conf/NOTES (revision 205451)
+++ amd64/conf/NOTES (working copy)
@@ -483,7 +483,7 @@ options PMAP_SHPGPERPROC=201
#XXX these 32 bit binaries is added.
# Enable 32-bit runtime support for FreeBSD/i386 binaries.
-options COMPAT_FREEBSD32
+options COMPAT_ARCH32
# Enable iBCS2 runtime support for SCO and ISC binaries
#XXX#options IBCS2
@@ -494,7 +494,7 @@ options COMPAT_FREEBSD32
# Enable Linux ABI emulation
#XXX#options COMPAT_LINUX
-# Enable 32-bit Linux ABI emulation (requires COMPAT_43 and COMPAT_FREEBSD32)
+# Enable 32-bit Linux ABI emulation (requires COMPAT_43 and COMPAT_ARCH32)
options COMPAT_LINUX32
# Enable the linux-like proc filesystem support (requires COMPAT_LINUX32
Index: amd64/conf/GENERIC
===================================================================
--- amd64/conf/GENERIC (revision 205451)
+++ amd64/conf/GENERIC (working copy)
@@ -44,7 +44,7 @@ options PROCFS # Process filesystem (
options PSEUDOFS # Pseudo-filesystem framework
options GEOM_PART_GPT # GUID Partition Tables.
options GEOM_LABEL # Provides labelization
-options COMPAT_FREEBSD32 # Compatible with i386 binaries
+options COMPAT_ARCH32 # Compatible with i386 binaries
options COMPAT_FREEBSD4 # Compatible with FreeBSD4
options COMPAT_FREEBSD5 # Compatible with FreeBSD5
options COMPAT_FREEBSD6 # Compatible with FreeBSD6
Index: amd64/amd64/db_trace.c
===================================================================
--- amd64/amd64/db_trace.c (revision 205451)
+++ amd64/amd64/db_trace.c (working copy)
@@ -319,7 +319,7 @@ db_nextframe(struct amd64_frame **fp, db
frame_type = INTERRUPT;
else if (strcmp(name, "Xfast_syscall") == 0)
frame_type = SYSCALL;
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
else if (strcmp(name, "Xint0x80_syscall") == 0)
frame_type = SYSCALL;
#endif
Index: amd64/amd64/vm_machdep.c
===================================================================
--- amd64/amd64/vm_machdep.c (revision 205451)
+++ amd64/amd64/vm_machdep.c (working copy)
@@ -439,7 +439,7 @@ cpu_set_upcall_kse(struct thread *td, vo
*/
cpu_thread_clean(td);
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
if (td->td_proc->p_sysent->sv_flags & SV_ILP32) {
/*
* Set the trap frame to point at the beginning of the uts
@@ -490,7 +490,7 @@ cpu_set_user_tls(struct thread *td, void
if ((u_int64_t)tls_base >= VM_MAXUSER_ADDRESS)
return (EINVAL);
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
if (td->td_proc->p_sysent->sv_flags & SV_ILP32) {
td->td_pcb->pcb_gsbase = (register_t)tls_base;
return (0);
Index: amd64/amd64/exception.S
===================================================================
--- amd64/amd64/exception.S (revision 205451)
+++ amd64/amd64/exception.S (working copy)
@@ -572,7 +572,7 @@ ENTRY(fork_trampoline)
* included.
*/
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
.data
.p2align 4
.text
Index: sys/ptrace.h
===================================================================
--- sys/ptrace.h (revision 205451)
+++ sys/ptrace.h (working copy)
@@ -158,7 +158,7 @@ int proc_read_dbregs(struct thread *_td,
int proc_write_dbregs(struct thread *_td, struct dbreg *_dbreg);
int proc_sstep(struct thread *_td);
int proc_rwmem(struct proc *_p, struct uio *_uio);
-#ifdef COMPAT_FREEBSD32
+#ifdef COMPAT_ARCH32
struct reg32;
struct fpreg32;
struct dbreg32;