diff options
Diffstat (limited to 'vm/vm_map.c')
-rw-r--r-- | vm/vm_map.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/vm/vm_map.c b/vm/vm_map.c index eaf09ec1..f533a627 100644 --- a/vm/vm_map.c +++ b/vm/vm_map.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012 Richard Braun. + * Copyright (c) 2011, 2012, 2013 Richard Braun. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,11 +36,11 @@ #include <kern/kmem.h> #include <kern/list.h> #include <kern/macros.h> +#include <kern/mutex.h> #include <kern/panic.h> #include <kern/param.h> #include <kern/printk.h> #include <kern/rbtree.h> -#include <kern/spinlock.h> #include <kern/stddef.h> #include <kern/stdint.h> #include <machine/pmap.h> @@ -781,7 +781,7 @@ vm_map_enter(struct vm_map *map, struct vm_object *object, uint64_t offset, struct vm_map_request request; int error; - spinlock_lock(&map->lock); + mutex_lock(&map->lock); error = vm_map_prepare(map, object, offset, *startp, size, align, flags, &request); @@ -794,14 +794,14 @@ vm_map_enter(struct vm_map *map, struct vm_object *object, uint64_t offset, if (error) goto error_enter; - spinlock_unlock(&map->lock); + mutex_unlock(&map->lock); *startp = request.start; return 0; error_enter: vm_map_reset_find_cache(map); - spinlock_unlock(&map->lock); + mutex_unlock(&map->lock); return error; } @@ -862,7 +862,7 @@ vm_map_remove(struct vm_map *map, unsigned long start, unsigned long end) assert(end <= map->end); assert(start < end); - spinlock_lock(&map->lock); + mutex_lock(&map->lock); entry = vm_map_lookup_nearest(map, start); @@ -884,7 +884,7 @@ vm_map_remove(struct vm_map *map, unsigned long start, unsigned long end) vm_map_reset_find_cache(map); out: - spinlock_unlock(&map->lock); + mutex_unlock(&map->lock); } static void @@ -894,7 +894,7 @@ vm_map_init(struct vm_map *map, struct pmap *pmap, unsigned long start, assert(vm_page_aligned(start)); assert(vm_page_aligned(end)); - spinlock_init(&map->lock); + mutex_init(&map->lock); list_init(&map->entry_list); rbtree_init(&map->entry_tree); map->nr_entries = 0; |