aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/amd64/amd64/vm_machdep.c11
-rw-r--r--sys/fs/procfs/procfs_dbregs.c6
-rw-r--r--sys/fs/procfs/procfs_fpregs.c6
-rw-r--r--sys/fs/procfs/procfs_regs.c6
-rw-r--r--sys/kern/sys_process.c9
5 files changed, 16 insertions, 22 deletions
diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c
index 0cc9b039a226..1e87bdc6fbf8 100644
--- a/sys/amd64/amd64/vm_machdep.c
+++ b/sys/amd64/amd64/vm_machdep.c
@@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$");
#include <sys/sf_buf.h>
#include <sys/smp.h>
#include <sys/sysctl.h>
+#include <sys/sysent.h>
#include <sys/unistd.h>
#include <sys/vnode.h>
#include <sys/vmmeter.h>
@@ -80,12 +81,6 @@ __FBSDID("$FreeBSD$");
#include <amd64/isa/isa.h>
-#ifdef COMPAT_IA32
-
-extern struct sysentvec ia32_freebsd_sysvec;
-
-#endif
-
static void cpu_reset_real(void);
#ifdef SMP
static void cpu_reset_proxy(void);
@@ -331,7 +326,7 @@ cpu_set_upcall_kse(struct thread *td, void (*entry)(void *), void *arg,
cpu_thread_clean(td);
#ifdef COMPAT_IA32
- if (td->td_proc->p_sysent == &ia32_freebsd_sysvec) {
+ if (td->td_proc->p_sysent->sv_flags & SV_ILP32) {
/*
* Set the trap frame to point at the beginning of the uts
* function.
@@ -377,7 +372,7 @@ cpu_set_user_tls(struct thread *td, void *tls_base)
return (EINVAL);
#ifdef COMPAT_IA32
- if (td->td_proc->p_sysent == &ia32_freebsd_sysvec) {
+ if (td->td_proc->p_sysent->sv_flags & SV_ILP32) {
if (td == curthread) {
critical_enter();
td->td_pcb->pcb_gsbase = (register_t)tls_base;
diff --git a/sys/fs/procfs/procfs_dbregs.c b/sys/fs/procfs/procfs_dbregs.c
index 722e4cf5be9b..efa4e14d668d 100644
--- a/sys/fs/procfs/procfs_dbregs.c
+++ b/sys/fs/procfs/procfs_dbregs.c
@@ -51,6 +51,7 @@
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/ptrace.h>
+#include <sys/sysent.h>
#include <sys/uio.h>
#include <machine/reg.h>
@@ -63,7 +64,6 @@
#include <machine/fpu.h>
#include <compat/ia32/ia32_reg.h>
-extern struct sysentvec ia32_freebsd_sysvec;
/*
* PROC(write, dbregs, td2, &r) becomes
* proc_write_dbregs(td2, &r) or
@@ -107,8 +107,8 @@ procfs_doprocdbregs(PFS_FILL_ARGS)
td2 = FIRST_THREAD_IN_PROC(p);
#ifdef COMPAT_IA32
- 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) == 0) {
PROC_UNLOCK(p);
return (EINVAL);
}
diff --git a/sys/fs/procfs/procfs_fpregs.c b/sys/fs/procfs/procfs_fpregs.c
index 25412d83e7e2..43af53e3ce59 100644
--- a/sys/fs/procfs/procfs_fpregs.c
+++ b/sys/fs/procfs/procfs_fpregs.c
@@ -45,6 +45,7 @@
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/ptrace.h>
+#include <sys/sysent.h>
#include <sys/uio.h>
#include <machine/reg.h>
@@ -57,7 +58,6 @@
#include <machine/fpu.h>
#include <compat/ia32/ia32_reg.h>
-extern struct sysentvec ia32_freebsd_sysvec;
/*
* PROC(write, fpregs, td2, &r) becomes
* proc_write_fpregs(td2, &r) or
@@ -102,8 +102,8 @@ procfs_doprocfpregs(PFS_FILL_ARGS)
/* XXXKSE: */
td2 = FIRST_THREAD_IN_PROC(p);
#ifdef COMPAT_IA32
- 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) == 0) {
PROC_UNLOCK(p);
return (EINVAL);
}
diff --git a/sys/fs/procfs/procfs_regs.c b/sys/fs/procfs/procfs_regs.c
index 481c05347160..82922fbe8974 100644
--- a/sys/fs/procfs/procfs_regs.c
+++ b/sys/fs/procfs/procfs_regs.c
@@ -45,6 +45,7 @@
#include <sys/mutex.h>
#include <sys/proc.h>
#include <sys/ptrace.h>
+#include <sys/sysent.h>
#include <sys/uio.h>
#include <machine/reg.h>
@@ -57,7 +58,6 @@
#include <machine/fpu.h>
#include <compat/ia32/ia32_reg.h>
-extern struct sysentvec ia32_freebsd_sysvec;
/*
* PROC(write, regs, td2, &r) becomes
* proc_write_regs(td2, &r) or
@@ -102,8 +102,8 @@ procfs_doprocregs(PFS_FILL_ARGS)
/* XXXKSE: */
td2 = FIRST_THREAD_IN_PROC(p);
#ifdef COMPAT_IA32
- 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) == 0) {
PROC_UNLOCK(p);
return (EINVAL);
}
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index ceae8de8e904..0ed7ce43d03b 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;
}