diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c index 7116c2fa1f7c..2edd269dc26c 100644 --- a/sys/vm/vm_mmap.c +++ b/sys/vm/vm_mmap.c @@ -414,12 +414,10 @@ ommap(struct thread *td, struct ommap_args *uap) #define OMAP_FIXED 0x0100 prot = cvtbsdprot[uap->prot & 0x7]; -#ifdef COMPAT_FREEBSD32 -#if defined(__amd64__) +#if (defined(COMPAT_FREEBSD32) && defined(__amd64__)) || defined(__i386__) if (i386_read_exec && SV_PROC_FLAG(td->td_proc, SV_ILP32) && prot != 0) prot |= PROT_EXEC; -#endif #endif flags = 0; if (uap->flags & OMAP_ANON) diff --git a/sys/vm/vm_unix.c b/sys/vm/vm_unix.c index f481364e0866..58e14b16c93f 100644 --- a/sys/vm/vm_unix.c +++ b/sys/vm/vm_unix.c @@ -180,11 +180,9 @@ kern_break(struct thread *td, uintptr_t *addr) } #endif prot = VM_PROT_RW; -#ifdef COMPAT_FREEBSD32 -#if defined(__amd64__) +#if (defined(COMPAT_FREEBSD32) && defined(__amd64__)) || defined(__i386__) if (i386_read_exec && SV_PROC_FLAG(td->td_proc, SV_ILP32)) prot |= VM_PROT_EXECUTE; -#endif #endif rv = vm_map_insert(map, NULL, 0, old, new, prot, VM_PROT_ALL, 0); if (rv != KERN_SUCCESS) {