summaryrefslogtreecommitdiffstats
path: root/sys/vm/device_pager.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2008-05-17 16:26:34 +0000
committeralc <alc@FreeBSD.org>2008-05-17 16:26:34 +0000
commit1e4c5769ebffc1aa3236011daf53b8ec6e91ff31 (patch)
tree501376280d4c23bcdc75d1cdd9910608f2ec5668 /sys/vm/device_pager.c
parent55aafae3bb6d6ee7a99322fa2cc2488709b72731 (diff)
downloadFreeBSD-src-1e4c5769ebffc1aa3236011daf53b8ec6e91ff31.zip
FreeBSD-src-1e4c5769ebffc1aa3236011daf53b8ec6e91ff31.tar.gz
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.
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 19ba75f..e771928 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) {
OpenPOWER on IntegriCloud