* Abuse the pte nodes for unmapped kva to thread a kva freelist through. * Requirements: * - Must deal with pages in order to ensure that none of the PG_* bits * are ever set, PG_V in particular. * - Assumes we can write to ptes without pte_store() atomic ops, even * on PAE systems. This should be ok. * - Assumes nothing will ever test these addresses for 0 to indicate * no map
| 920 | * Because PG_V is never set, there can be no mappings to invalidate. |
| 921 | */ |
| 922 | static vm_offset_t |
| 923 | pmap_ptelist_alloc(vm_offset_t *head) |
| 924 | { |
| 925 | pt_entry_t *pte; |
| 926 | vm_offset_t va; |
| 927 | |
| 928 | va = *head; |
| 929 | if (va == 0) |
| 930 | panic("pmap_ptelist_alloc: exhausted ptelist KVA"); |
| 931 | pte = vtopte(va); |
| 932 | *head = *pte; |
| 933 | if (*head & PG_V) |
| 934 | panic("pmap_ptelist_alloc: va with PG_V set!"); |
| 935 | *pte = 0; |
| 936 | return (va); |
| 937 | } |
| 938 | |
| 939 | static void |
| 940 | pmap_ptelist_free(vm_offset_t *head, vm_offset_t va) |
no test coverage detected