summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2005-07-13 15:12:19 +0000
committerjhb <jhb@FreeBSD.org>2005-07-13 15:12:19 +0000
commit6c122e4c770d0229ef32962da0c99f4d4a8f0e89 (patch)
tree37ec533cc884259f190872c67660e069ac0aa8ad /sys/compat
parent93ddbfdfbc6ec84d58a16b9c083aaaf8780faf7c (diff)
downloadFreeBSD-src-6c122e4c770d0229ef32962da0c99f4d4a8f0e89.zip
FreeBSD-src-6c122e4c770d0229ef32962da0c99f4d4a8f0e89.tar.gz
Wrap the ia64-specific freebsd32_mmap_partial() hack in Giant for now
since it calls into VFS and VM. This makes the freebsd32_mmap() routine MP safe and the extra Giants here can be revisited later. Glanced at by: marcel MFC after: 3 days
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/freebsd32/freebsd32_misc.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/compat/freebsd32/freebsd32_misc.c b/sys/compat/freebsd32/freebsd32_misc.c
index de4881e..b84e9dd 100644
--- a/sys/compat/freebsd32/freebsd32_misc.c
+++ b/sys/compat/freebsd32/freebsd32_misc.c
@@ -397,6 +397,7 @@ freebsd32_mmap(struct thread *td, struct freebsd32_mmap_args *uap)
start = addr;
end = addr + len;
+ mtx_lock(&Giant);
if (start != trunc_page(start)) {
error = freebsd32_mmap_partial(td, start,
round_page(start), prot,
@@ -427,11 +428,14 @@ freebsd32_mmap(struct thread *td, struct freebsd32_mmap_args *uap)
prot |= VM_PROT_WRITE;
map = &td->td_proc->p_vmspace->vm_map;
rv = vm_map_remove(map, start, end);
- if (rv != KERN_SUCCESS)
+ if (rv != KERN_SUCCESS) {
+ mtx_unlock(&Giant);
return (EINVAL);
+ }
rv = vm_map_find(map, 0, 0,
&start, end - start, FALSE,
prot, VM_PROT_ALL, 0);
+ mtx_unlock(&Giant);
if (rv != KERN_SUCCESS)
return (EINVAL);
r.fd = fd;
@@ -445,6 +449,7 @@ freebsd32_mmap(struct thread *td, struct freebsd32_mmap_args *uap)
td->td_retval[0] = addr;
return (0);
}
+ mtx_unlock(&Giant);
if (end == start) {
/*
* After dealing with the ragged ends, there
OpenPOWER on IntegriCloud