diff options
-rw-r--r-- | sys/vm/vm_map.c | 31 | ||||
-rw-r--r-- | sys/vm/vm_map.h | 9 |
2 files changed, 15 insertions, 25 deletions
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c index 853815c..04cc0ef 100644 --- a/sys/vm/vm_map.c +++ b/sys/vm/vm_map.c @@ -191,7 +191,6 @@ vm_map_zfini(void *mem, int size) { vm_map_t map; - GIANT_REQUIRED; map = (vm_map_t)mem; lockdestroy(&map->lock); @@ -202,8 +201,6 @@ vm_map_zinit(void *mem, int size) { vm_map_t map; - GIANT_REQUIRED; - map = (vm_map_t)mem; map->nentries = 0; map->size = 0; @@ -426,12 +423,6 @@ _vm_map_clear_recursive(vm_map_t map, const char *file, int line) { } -struct pmap * -vmspace_pmap(struct vmspace *vmspace) -{ - return &vmspace->vm_pmap; -} - long vmspace_resident_count(struct vmspace *vmspace) { @@ -450,8 +441,6 @@ vm_map_create(pmap_t pmap, vm_offset_t min, vm_offset_t max) { vm_map_t result; - GIANT_REQUIRED; - result = uma_zalloc(mapzone, M_WAITOK); CTR1(KTR_VM, "vm_map_create: %p", result); _vm_map_init(result, min, max); @@ -544,39 +533,35 @@ vm_map_entry_splay(vm_offset_t address, vm_map_entry_t root) if (root == NULL) return (root); lefttreemax = righttreemin = &dummy; - for (;;) { + for (;; root = y) { if (address < root->start) { - if (root->left == NULL) + if ((y = root->left) == NULL) break; - if (address < root->left->start) { + if (address < y->start) { /* Rotate right. */ - y = root->left; root->left = y->right; y->right = root; root = y; - if (root->left == NULL) + if ((y = root->left) == NULL) break; } /* Link into the new root's right tree. */ righttreemin->left = root; righttreemin = root; - root = root->left; } else if (address >= root->end) { - if (root->right == NULL) + if ((y = root->right) == NULL) break; - if (address >= root->right->end) { + if (address >= y->end) { /* Rotate left. */ - y = root->right; root->right = y->left; y->left = root; root = y; - if (root->right == NULL) + if ((y = root->right) == NULL) break; } /* Link into the new root's left tree. */ lefttreemax->right = root; lefttreemax = root; - root = root->right; } else break; } @@ -1176,8 +1161,6 @@ vm_map_submap( vm_map_entry_t entry; int result = KERN_INVALID_ARGUMENT; - GIANT_REQUIRED; - vm_map_lock(map); VM_MAP_RANGE_CHECK(map, start, end); diff --git a/sys/vm/vm_map.h b/sys/vm/vm_map.h index 02d3b47..b4c75e6 100644 --- a/sys/vm/vm_map.h +++ b/sys/vm/vm_map.h @@ -218,6 +218,14 @@ struct vmspace { }; #ifdef _KERNEL +static __inline pmap_t +vmspace_pmap(struct vmspace *vmspace) +{ + return &vmspace->vm_pmap; +} +#endif /* _KERNEL */ + +#ifdef _KERNEL /* * Macros: vm_map_lock, etc. * Function: @@ -252,7 +260,6 @@ void _vm_map_clear_recursive(vm_map_t map, const char *file, int line); #define vm_map_clear_recursive(map) \ _vm_map_clear_recursive(map, LOCK_FILE, LOCK_LINE) -struct pmap *vmspace_pmap(struct vmspace *vmspace); long vmspace_resident_count(struct vmspace *vmspace); #endif /* _KERNEL */ |