summaryrefslogtreecommitdiffstats
path: root/sys/kern/sys_process.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2009-03-02 18:43:50 +0000
committerkib <kib@FreeBSD.org>2009-03-02 18:43:50 +0000
commitc672211541895fab644fcd12bb285ea5294f85f5 (patch)
tree5f5d7fb10b6b06ba54298bb9f7cd6d0cabab9055 /sys/kern/sys_process.c
parent9c1d9573361b5e7cd3cbe74b0f747372ed7677a8 (diff)
downloadFreeBSD-src-c672211541895fab644fcd12bb285ea5294f85f5.zip
FreeBSD-src-c672211541895fab644fcd12bb285ea5294f85f5.tar.gz
Use the p_sysent->sv_flags flag SV_ILP32 to detect 32bit process
executing on 64bit kernel. This eliminates the direct comparisions of p_sysent with &ia32_freebsd_sysvec, that were left intact after r185169.
Diffstat (limited to 'sys/kern/sys_process.c')
-rw-r--r--sys/kern/sys_process.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index ceae8de..0ed7ce4 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -39,6 +39,7 @@ __FBSDID("$FreeBSD$");
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/syscallsubr.h>
+#include <sys/sysent.h>
#include <sys/sysproto.h>
#include <sys/proc.h>
#include <sys/vnode.h>
@@ -64,8 +65,6 @@ __FBSDID("$FreeBSD$");
#include <machine/fpu.h>
#include <compat/ia32/ia32_reg.h>
-extern struct sysentvec ia32_freebsd_sysvec;
-
struct ptrace_io_desc32 {
int piod_op;
u_int32_t piod_offs;
@@ -394,7 +393,7 @@ ptrace(struct thread *td, struct ptrace_args *uap)
#ifdef COMPAT_IA32
int wrap32 = 0;
- if (td->td_proc->p_sysent == &ia32_freebsd_sysvec)
+ if (SV_CURPROC_FLAG(SV_ILP32))
wrap32 = 1;
#endif
AUDIT_ARG(pid, uap->pid);
@@ -581,8 +580,8 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
* Test if we're a 32 bit client and what the target is.
* Set the wrap controls accordingly.
*/
- if (td->td_proc->p_sysent == &ia32_freebsd_sysvec) {
- if (td2->td_proc->p_sysent == &ia32_freebsd_sysvec)
+ if (SV_CURPROC_FLAG(SV_ILP32)) {
+ if (td2->td_proc->p_sysent->sv_flags & SV_ILP32)
safe = 1;
wrap32 = 1;
}
OpenPOWER on IntegriCloud