diff options
author | jeff <jeff@FreeBSD.org> | 2011-03-21 09:40:01 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2011-03-21 09:40:01 +0000 |
commit | 2d7d8c05e7404fbebf1f0fe24c13bc5bb58d2338 (patch) | |
tree | 79d67d85de5b498560d0272509bd0b1bfccf7d86 /sys/vm/vm_map.c | |
parent | 3420a736119b646db3defc2c3e24d534e35d73a0 (diff) | |
download | FreeBSD-src-2d7d8c05e7404fbebf1f0fe24c13bc5bb58d2338.zip FreeBSD-src-2d7d8c05e7404fbebf1f0fe24c13bc5bb58d2338.tar.gz |
- Merge changes to the base system to support OFED. These include
a wider arg2 for sysctl, updates to vlan code, IFT_INFINIBAND,
and other miscellaneous small features.
Diffstat (limited to 'sys/vm/vm_map.c')
-rw-r--r-- | sys/vm/vm_map.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 79d90f5..22fbda1 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -2324,7 +2324,11 @@ vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, unsigned int last_timestamp; int rv; boolean_t fictitious, need_wakeup, result, user_wire; + vm_prot_t prot; + prot = 0; + if (flags & VM_MAP_WIRE_WRITE) + prot |= VM_PROT_WRITE; user_wire = (flags & VM_MAP_WIRE_USER) ? TRUE : FALSE; vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); @@ -2392,20 +2396,17 @@ vm_map_wire(vm_map_t map, vm_offset_t start, vm_offset_t end, * above.) */ entry->eflags |= MAP_ENTRY_IN_TRANSITION; - /* - * - */ - if (entry->wired_count == 0) { - if ((entry->protection & (VM_PROT_READ|VM_PROT_EXECUTE)) - == 0) { - entry->eflags |= MAP_ENTRY_WIRE_SKIPPED; - if ((flags & VM_MAP_WIRE_HOLESOK) == 0) { - end = entry->end; - rv = KERN_INVALID_ADDRESS; - goto done; - } - goto next_entry; + if ((entry->protection & (VM_PROT_READ | VM_PROT_EXECUTE)) == 0 + || (entry->protection & prot) != prot) { + entry->eflags |= MAP_ENTRY_WIRE_SKIPPED; + if ((flags & VM_MAP_WIRE_HOLESOK) == 0) { + end = entry->end; + rv = KERN_INVALID_ADDRESS; + goto done; } + goto next_entry; + } + if (entry->wired_count == 0) { entry->wired_count++; saved_start = entry->start; saved_end = entry->end; |