diff options
author | kib <kib@FreeBSD.org> | 2008-11-22 12:36:15 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2008-11-22 12:36:15 +0000 |
commit | 8fad2283b3211a15c495b42689a5b65d91b96f3b (patch) | |
tree | c5e6cdb7219d5ec854c9a25a01e8ddfce232c5e9 /sys/kern | |
parent | 45f7975419230cdc3b0ba2cffb4b5fdebf5607bd (diff) | |
download | FreeBSD-src-8fad2283b3211a15c495b42689a5b65d91b96f3b.zip FreeBSD-src-8fad2283b3211a15c495b42689a5b65d91b96f3b.tar.gz |
Add sv_flags field to struct sysentvec with intention to provide description
of the ABI of the currently executing image. Change some places to test
the flags instead of explicit comparing with address of known sysentvec
structures to determine ABI features.
Discussed with: dchagin, imp, jhb, peter
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/imgact_aout.c | 8 | ||||
-rw-r--r-- | sys/kern/kern_thr.c | 4 | ||||
-rw-r--r-- | sys/kern/uipc_socket.c | 7 |
3 files changed, 11 insertions, 8 deletions
diff --git a/sys/kern/imgact_aout.c b/sys/kern/imgact_aout.c index f4e4614..6c2f627 100644 --- a/sys/kern/imgact_aout.c +++ b/sys/kern/imgact_aout.c @@ -82,7 +82,13 @@ struct sysentvec aout_sysvec = { .sv_copyout_strings = exec_copyout_strings, .sv_setregs = exec_setregs, .sv_fixlimit = NULL, - .sv_maxssiz = NULL + .sv_maxssiz = NULL, + .sv_flags = SV_ABI_FREEBSD | SV_AOUT | +#if defined(__i386__) + SV_IA32 | SV_ILP32 +#else +#error Choose SV_XXX flags for the platform +#endif }; static int diff --git a/sys/kern/kern_thr.c b/sys/kern/kern_thr.c index dade1c2..3802259 100644 --- a/sys/kern/kern_thr.c +++ b/sys/kern/kern_thr.c @@ -57,14 +57,12 @@ __FBSDID("$FreeBSD$"); #ifdef COMPAT_IA32 -extern struct sysentvec ia32_freebsd_sysvec; - static inline int suword_lwpid(void *addr, lwpid_t lwpid) { int error; - if (curproc->p_sysent != &ia32_freebsd_sysvec) + if (SV_CURPROC_FLAG(SV_LP64)) error = suword(addr, lwpid); else error = suword32(addr, lwpid); diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index e712503..53c800e 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -136,9 +136,8 @@ __FBSDID("$FreeBSD$"); #ifdef COMPAT_IA32 #include <sys/mount.h> +#include <sys/sysent.h> #include <compat/freebsd32/freebsd32.h> - -extern struct sysentvec ia32_freebsd_sysvec; #endif static int soreceive_rcvoob(struct socket *so, struct uio *uio, @@ -2280,7 +2279,7 @@ sosetopt(struct socket *so, struct sockopt *sopt) case SO_SNDTIMEO: case SO_RCVTIMEO: #ifdef COMPAT_IA32 - if (curthread->td_proc->p_sysent == &ia32_freebsd_sysvec) { + if (SV_CURPROC_FLAG(SV_ILP32)) { struct timeval32 tv32; error = sooptcopyin(sopt, &tv32, sizeof tv32, @@ -2461,7 +2460,7 @@ integer: tv.tv_sec = optval / hz; tv.tv_usec = (optval % hz) * tick; #ifdef COMPAT_IA32 - if (curthread->td_proc->p_sysent == &ia32_freebsd_sysvec) { + if (SV_CURPROC_FLAG(SV_ILP32)) { struct timeval32 tv32; CP(tv, tv32, tv_sec); |