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

Function pmap_pte2list_alloc

freebsd/arm/arm/pmap-v6.c:1500–1515  ·  view source on GitHub ↗

* Abuse the pte2 nodes for unmapped kva to thread a kva freelist through. * Requirements: * - Must deal with pages in order to ensure that none of the PTE2_* bits * are ever set, PTE2_V in particular. * - Assumes we can write to pte2s without pte2_store() atomic ops. * - Assumes nothing will ever test these addresses for 0 to indicate * no mapping instead of correctly checkin

Source from the content-addressed store, hash-verified

1498 * Because PTE2_V is never set, there can be no mappings to invalidate.
1499 */
1500static vm_offset_t
1501pmap_pte2list_alloc(vm_offset_t *head)
1502{
1503 pt2_entry_t *pte2p;
1504 vm_offset_t va;
1505
1506 va = *head;
1507 if (va == 0)
1508 panic("pmap_ptelist_alloc: exhausted ptelist KVA");
1509 pte2p = pt2map_entry(va);
1510 *head = *pte2p;
1511 if (*head & PTE2_V)
1512 panic("%s: va with PTE2_V set!", __func__);
1513 *pte2p = 0;
1514 return (va);
1515}
1516
1517static void
1518pmap_pte2list_free(vm_offset_t *head, vm_offset_t va)

Callers 1

get_pv_entryFunction · 0.85

Calls 2

pt2map_entryFunction · 0.85
panicFunction · 0.50

Tested by

no test coverage detected