aboutsummaryrefslogtreecommitdiff
path: root/sys/pci/agp_i810.c
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2003-06-13 08:11:14 +0000
committerAlan Cox <alc@FreeBSD.org>2003-06-13 08:11:14 +0000
commitd7ae6bd2216895169fe76cea591864a0fbcb04b5 (patch)
tree00ad28fa3ae5274f9fed34be35fbfb888aee5345 /sys/pci/agp_i810.c
parent004bd28e408bc0fe10468514bcf2225c6a813185 (diff)
downloadsrc-d7ae6bd2216895169fe76cea591864a0fbcb04b5.tar.gz
src-d7ae6bd2216895169fe76cea591864a0fbcb04b5.zip
Add vm object locking.
Notes
Notes: svn path=/head/; revision=116288
Diffstat (limited to 'sys/pci/agp_i810.c')
-rw-r--r--sys/pci/agp_i810.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/pci/agp_i810.c b/sys/pci/agp_i810.c
index d8e4d05e936b..0f845d9a5932 100644
--- a/sys/pci/agp_i810.c
+++ b/sys/pci/agp_i810.c
@@ -584,8 +584,11 @@ agp_i810_alloc_memory(device_t dev, int type, vm_size_t size)
* get its physical address.
*/
vm_page_t m;
+
+ VM_OBJECT_LOCK(mem->am_obj);
m = vm_page_grab(mem->am_obj, 0,
VM_ALLOC_WIRED | VM_ALLOC_ZERO | VM_ALLOC_RETRY);
+ VM_OBJECT_UNLOCK(mem->am_obj);
if ((m->flags & PG_ZERO) == 0)
pmap_zero_page(m);
vm_page_lock_queues();
@@ -616,7 +619,11 @@ agp_i810_free_memory(device_t dev, struct agp_memory *mem)
/*
* Unwire the page which we wired in alloc_memory.
*/
- vm_page_t m = vm_page_lookup(mem->am_obj, 0);
+ vm_page_t m;
+
+ VM_OBJECT_LOCK(mem->am_obj);
+ m = vm_page_lookup(mem->am_obj, 0);
+ VM_OBJECT_UNLOCK(mem->am_obj);
vm_page_lock_queues();
vm_page_unwire(m, 0);
vm_page_unlock_queues();