MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pmap_align_superpage

Function pmap_align_superpage

freebsd/mips/mips/pmap.c:3360–3378  ·  view source on GitHub ↗

* Increase the starting virtual address of the given mapping if a * different alignment might result in more superpage mappings. */

Source from the content-addressed store, hash-verified

3358 * different alignment might result in more superpage mappings.
3359 */
3360void
3361pmap_align_superpage(vm_object_t object, vm_ooffset_t offset,
3362 vm_offset_t *addr, vm_size_t size)
3363{
3364 vm_offset_t superpage_offset;
3365
3366 if (size < PDRSIZE)
3367 return;
3368 if (object != NULL && (object->flags & OBJ_COLORED) != 0)
3369 offset += ptoa(object->pg_color);
3370 superpage_offset = offset & PDRMASK;
3371 if (size - ((PDRSIZE - superpage_offset) & PDRMASK) < PDRSIZE ||
3372 (*addr & PDRMASK) == superpage_offset)
3373 return;
3374 if ((*addr & PDRMASK) < superpage_offset)
3375 *addr = (*addr & ~PDRMASK) + superpage_offset;
3376 else
3377 *addr = ((*addr + PDRMASK) & ~PDRMASK) + superpage_offset;
3378}
3379
3380#ifdef DDB
3381DB_SHOW_COMMAND(ptable, ddb_pid_dump)

Callers 1

vm_map_alignspaceFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected