From 1e124ec538abd89755a07370b3e298c5d4e275bc Mon Sep 17 00:00:00 2001 From: dchagin Date: Wed, 26 Jan 2011 20:03:58 +0000 Subject: Add macro to test the sv_flags of any process. Change some places to test the flags instead of explicit comparing with address of known sysentvec structures. MFC after: 1 month --- sys/fs/procfs/procfs_dbregs.c | 2 +- sys/fs/procfs/procfs_fpregs.c | 2 +- sys/fs/procfs/procfs_map.c | 4 ++-- sys/fs/procfs/procfs_regs.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'sys/fs/procfs') diff --git a/sys/fs/procfs/procfs_dbregs.c b/sys/fs/procfs/procfs_dbregs.c index 68945ef..de5dc76 100644 --- a/sys/fs/procfs/procfs_dbregs.c +++ b/sys/fs/procfs/procfs_dbregs.c @@ -107,7 +107,7 @@ procfs_doprocdbregs(PFS_FILL_ARGS) td2 = FIRST_THREAD_IN_PROC(p); #ifdef COMPAT_FREEBSD32 if (SV_CURPROC_FLAG(SV_ILP32)) { - if ((td2->td_proc->p_sysent->sv_flags & SV_ILP32) == 0) { + if (SV_PROC_FLAG(td2->td_proc, 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 541efed..c89c8e7 100644 --- a/sys/fs/procfs/procfs_fpregs.c +++ b/sys/fs/procfs/procfs_fpregs.c @@ -106,7 +106,7 @@ procfs_doprocfpregs(PFS_FILL_ARGS) td2 = FIRST_THREAD_IN_PROC(p); #ifdef COMPAT_FREEBSD32 if (SV_CURPROC_FLAG(SV_ILP32)) { - if ((td2->td_proc->p_sysent->sv_flags & SV_ILP32) == 0) { + if (SV_PROC_FLAG(td2->td_proc, SV_ILP32) == 0) { PROC_UNLOCK(p); return (EINVAL); } diff --git a/sys/fs/procfs/procfs_map.c b/sys/fs/procfs/procfs_map.c index 5b322eb..4396aca 100644 --- a/sys/fs/procfs/procfs_map.c +++ b/sys/fs/procfs/procfs_map.c @@ -100,8 +100,8 @@ procfs_doprocmap(PFS_FILL_ARGS) return (EOPNOTSUPP); #ifdef COMPAT_FREEBSD32 - if (curproc->p_sysent->sv_flags & SV_ILP32) { - if (!(p->p_sysent->sv_flags & SV_ILP32)) + if (SV_CURPROC_FLAG(SV_ILP32)) { + if (!(SV_PROC_FLAG(p, SV_ILP32))) return (EOPNOTSUPP); wrap32 = 1; } diff --git a/sys/fs/procfs/procfs_regs.c b/sys/fs/procfs/procfs_regs.c index 605d1c6..3f78478 100644 --- a/sys/fs/procfs/procfs_regs.c +++ b/sys/fs/procfs/procfs_regs.c @@ -106,7 +106,7 @@ procfs_doprocregs(PFS_FILL_ARGS) td2 = FIRST_THREAD_IN_PROC(p); #ifdef COMPAT_FREEBSD32 if (SV_CURPROC_FLAG(SV_ILP32)) { - if ((td2->td_proc->p_sysent->sv_flags & SV_ILP32) == 0) { + if ((SV_PROC_FLAG(td2->td_proc, SV_ILP32)) == 0) { PROC_UNLOCK(p); return (EINVAL); } -- cgit v1.1