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

Function pmap_pinit

freebsd/mips/mips/pmap.c:1130–1156  ·  view source on GitHub ↗

* Initialize a preallocated and zeroed pmap structure, * such as one in a vmspace structure. */

Source from the content-addressed store, hash-verified

1128 * such as one in a vmspace structure.
1129 */
1130int
1131pmap_pinit(pmap_t pmap)
1132{
1133 vm_offset_t ptdva;
1134 vm_page_t ptdpg;
1135 int i, req_class;
1136
1137 /*
1138 * allocate the page directory page
1139 */
1140 req_class = VM_ALLOC_NORMAL;
1141 while ((ptdpg = pmap_alloc_direct_page(NUSERPGTBLS, req_class)) ==
1142 NULL)
1143 pmap_grow_direct_page(req_class);
1144
1145 ptdva = MIPS_PHYS_TO_DIRECT(VM_PAGE_TO_PHYS(ptdpg));
1146 pmap->pm_segtab = (pd_entry_t *)ptdva;
1147 CPU_ZERO(&pmap->pm_active);
1148 for (i = 0; i < MAXCPU; i++) {
1149 pmap->pm_asid[i].asid = PMAP_ASID_RESERVED;
1150 pmap->pm_asid[i].gen = 0;
1151 }
1152 TAILQ_INIT(&pmap->pm_pvchunk);
1153 bzero(&pmap->pm_stats, sizeof pmap->pm_stats);
1154
1155 return (1);
1156}
1157
1158/*
1159 * this routine is called if the page table page is not

Callers

nothing calls this directly

Calls 3

pmap_alloc_direct_pageFunction · 0.85
pmap_grow_direct_pageFunction · 0.85
bzeroFunction · 0.85

Tested by

no test coverage detected