summaryrefslogtreecommitdiffstats
path: root/sys/dev/agp
diff options
context:
space:
mode:
authorattilio <attilio@FreeBSD.org>2013-02-20 12:03:20 +0000
committerattilio <attilio@FreeBSD.org>2013-02-20 12:03:20 +0000
commit15bf891afe5ecb096114725fc8e6dc1cc3ef70d6 (patch)
tree430a1525becbd2674f05fbcf81b84fccc4aa7865 /sys/dev/agp
parent1f1e13ca0304c5d3cab0d4c118678ec546f935bc (diff)
downloadFreeBSD-src-15bf891afe5ecb096114725fc8e6dc1cc3ef70d6.zip
FreeBSD-src-15bf891afe5ecb096114725fc8e6dc1cc3ef70d6.tar.gz
Rename VM_OBJECT_LOCK(), VM_OBJECT_UNLOCK() and VM_OBJECT_TRYLOCK() to
their "write" versions. Sponsored by: EMC / Isilon storage division
Diffstat (limited to 'sys/dev/agp')
-rw-r--r--sys/dev/agp/agp.c16
-rw-r--r--sys/dev/agp/agp_i810.c8
2 files changed, 12 insertions, 12 deletions
diff --git a/sys/dev/agp/agp.c b/sys/dev/agp/agp.c
index 5284248..9c943cc 100644
--- a/sys/dev/agp/agp.c
+++ b/sys/dev/agp/agp.c
@@ -545,7 +545,7 @@ agp_generic_bind_memory(device_t dev, struct agp_memory *mem,
* because vm_page_grab() may sleep and we can't hold a mutex
* while sleeping.
*/
- VM_OBJECT_LOCK(mem->am_obj);
+ VM_OBJECT_WLOCK(mem->am_obj);
for (i = 0; i < mem->am_size; i += PAGE_SIZE) {
/*
* Find a page from the object and wire it
@@ -558,14 +558,14 @@ agp_generic_bind_memory(device_t dev, struct agp_memory *mem,
VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_RETRY);
AGP_DPF("found page pa=%#jx\n", (uintmax_t)VM_PAGE_TO_PHYS(m));
}
- VM_OBJECT_UNLOCK(mem->am_obj);
+ VM_OBJECT_WUNLOCK(mem->am_obj);
mtx_lock(&sc->as_lock);
if (mem->am_is_bound) {
device_printf(dev, "memory already bound\n");
error = EINVAL;
- VM_OBJECT_LOCK(mem->am_obj);
+ VM_OBJECT_WLOCK(mem->am_obj);
i = 0;
goto bad;
}
@@ -574,7 +574,7 @@ agp_generic_bind_memory(device_t dev, struct agp_memory *mem,
* Bind the individual pages and flush the chipset's
* TLB.
*/
- VM_OBJECT_LOCK(mem->am_obj);
+ VM_OBJECT_WLOCK(mem->am_obj);
for (i = 0; i < mem->am_size; i += PAGE_SIZE) {
m = vm_page_lookup(mem->am_obj, OFF_TO_IDX(i));
@@ -602,7 +602,7 @@ agp_generic_bind_memory(device_t dev, struct agp_memory *mem,
}
vm_page_wakeup(m);
}
- VM_OBJECT_UNLOCK(mem->am_obj);
+ VM_OBJECT_WUNLOCK(mem->am_obj);
/*
* Flush the cpu cache since we are providing a new mapping
@@ -632,7 +632,7 @@ bad:
vm_page_unwire(m, 0);
vm_page_unlock(m);
}
- VM_OBJECT_UNLOCK(mem->am_obj);
+ VM_OBJECT_WUNLOCK(mem->am_obj);
return error;
}
@@ -659,14 +659,14 @@ agp_generic_unbind_memory(device_t dev, struct agp_memory *mem)
*/
for (i = 0; i < mem->am_size; i += AGP_PAGE_SIZE)
AGP_UNBIND_PAGE(dev, mem->am_offset + i);
- VM_OBJECT_LOCK(mem->am_obj);
+ VM_OBJECT_WLOCK(mem->am_obj);
for (i = 0; i < mem->am_size; i += PAGE_SIZE) {
m = vm_page_lookup(mem->am_obj, atop(i));
vm_page_lock(m);
vm_page_unwire(m, 0);
vm_page_unlock(m);
}
- VM_OBJECT_UNLOCK(mem->am_obj);
+ VM_OBJECT_WUNLOCK(mem->am_obj);
agp_flush_cache();
AGP_FLUSH_TLB(dev);
diff --git a/sys/dev/agp/agp_i810.c b/sys/dev/agp/agp_i810.c
index 30c0dca..63679e8 100644
--- a/sys/dev/agp/agp_i810.c
+++ b/sys/dev/agp/agp_i810.c
@@ -1968,10 +1968,10 @@ agp_i810_alloc_memory(device_t dev, int type, vm_size_t size)
* Allocate and wire down the page now so that we can
* get its physical address.
*/
- VM_OBJECT_LOCK(mem->am_obj);
+ VM_OBJECT_WLOCK(mem->am_obj);
m = vm_page_grab(mem->am_obj, 0, VM_ALLOC_NOBUSY |
VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_RETRY);
- VM_OBJECT_UNLOCK(mem->am_obj);
+ VM_OBJECT_WUNLOCK(mem->am_obj);
mem->am_physical = VM_PAGE_TO_PHYS(m);
} else {
/* Our allocation is already nicely wired down for us.
@@ -2006,12 +2006,12 @@ agp_i810_free_memory(device_t dev, struct agp_memory *mem)
/*
* Unwire the page which we wired in alloc_memory.
*/
- VM_OBJECT_LOCK(mem->am_obj);
+ VM_OBJECT_WLOCK(mem->am_obj);
m = vm_page_lookup(mem->am_obj, 0);
vm_page_lock(m);
vm_page_unwire(m, 0);
vm_page_unlock(m);
- VM_OBJECT_UNLOCK(mem->am_obj);
+ VM_OBJECT_WUNLOCK(mem->am_obj);
} else {
contigfree(sc->argb_cursor, mem->am_size, M_AGP);
sc->argb_cursor = NULL;
OpenPOWER on IntegriCloud