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

Function shared_page_init

freebsd/kern/kern_sharedpage.c:116–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

114}
115
116static void
117shared_page_init(void *dummy __unused)
118{
119 vm_page_t m;
120 vm_offset_t addr;
121
122 sx_init(&shared_page_alloc_sx, "shpsx");
123 shared_page_obj = vm_pager_allocate(OBJT_PHYS, 0, PAGE_SIZE,
124 VM_PROT_DEFAULT, 0, NULL);
125 VM_OBJECT_WLOCK(shared_page_obj);
126 m = vm_page_grab(shared_page_obj, 0, VM_ALLOC_ZERO);
127 VM_OBJECT_WUNLOCK(shared_page_obj);
128 vm_page_valid(m);
129 vm_page_xunbusy(m);
130 addr = kva_alloc(PAGE_SIZE);
131 pmap_qenter(addr, &m, 1);
132 shared_page_mapping = (char *)addr;
133}
134
135SYSINIT(shp, SI_SUB_EXEC, SI_ORDER_FIRST, (sysinit_cfunc_t)shared_page_init,
136 NULL);

Callers

nothing calls this directly

Calls 5

vm_pager_allocateFunction · 0.85
vm_page_grabFunction · 0.85
vm_page_validFunction · 0.85
kva_allocFunction · 0.85
pmap_qenterFunction · 0.50

Tested by

no test coverage detected