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.
This commit is contained in:
parent
bdd9aff946
commit
e46cd4132c
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user