From e46cd4132c1882a63c179152684037306543d03e Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sat, 17 May 2008 16:26:34 +0000 Subject: 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. --- sys/vm/device_pager.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'sys/vm/device_pager.c') 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) { -- cgit v1.2.3