aboutsummaryrefslogtreecommitdiff
path: root/sys/vm/device_pager.c
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2008-05-17 16:26:34 +0000
committerAlan Cox <alc@FreeBSD.org>2008-05-17 16:26:34 +0000
commite46cd4132c1882a63c179152684037306543d03e (patch)
tree501376280d4c23bcdc75d1cdd9910608f2ec5668 /sys/vm/device_pager.c
parentbdd9aff946672bebde1fc3f24488320292a5a3e7 (diff)
downloadsrc-e46cd4132c1882a63c179152684037306543d03e.tar.gz
src-e46cd4132c1882a63c179152684037306543d03e.zip
Preset a device object's alignment ("pg_color") based upon the
physical address of the device's memory. This enables pmap_align_superpage() to propose a virtual address for mapping the device memory that permits the use of superpage mappings.
Notes
Notes: svn path=/head/; revision=179074
Diffstat (limited to 'sys/vm/device_pager.c')
-rw-r--r--sys/vm/device_pager.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/vm/device_pager.c b/sys/vm/device_pager.c
index 19ba75f3411e..e7719283e75e 100644
--- a/sys/vm/device_pager.c
+++ b/sys/vm/device_pager.c
@@ -146,10 +146,14 @@ dev_pager_alloc(void *handle, vm_ooffset_t size, vm_prot_t prot, vm_ooffset_t fo
object = vm_pager_object_lookup(&dev_pager_object_list, handle);
if (object == NULL) {
/*
- * Allocate object and associate it with the pager.
+ * Allocate object and associate it with the pager. Initialize
+ * the object's pg_color based upon the physical address of the
+ * device's memory.
*/
mtx_unlock(&dev_pager_mtx);
object1 = vm_object_allocate(OBJT_DEVICE, pindex);
+ object1->flags |= OBJ_COLORED;
+ object1->pg_color = atop(paddr) - OFF_TO_IDX(off - PAGE_SIZE);
mtx_lock(&dev_pager_mtx);
object = vm_pager_object_lookup(&dev_pager_object_list, handle);
if (object != NULL) {