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

Function exec_prealloc_args_kva

freebsd/kern/kern_exec.c:1299–1313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1297static u_int exec_args_gen;
1298
1299static void
1300exec_prealloc_args_kva(void *arg __unused)
1301{
1302 struct exec_args_kva *argkva;
1303 u_int i;
1304
1305 SLIST_INIT(&exec_args_kva_freelist);
1306 mtx_init(&exec_args_kva_mtx, "exec args kva", NULL, MTX_DEF);
1307 for (i = 0; i < exec_map_entries; i++) {
1308 argkva = malloc(sizeof(*argkva), M_PARGS, M_WAITOK);
1309 argkva->addr = kmap_alloc_wait(exec_map, exec_map_entry_size);
1310 argkva->gen = exec_args_gen;
1311 SLIST_INSERT_HEAD(&exec_args_kva_freelist, argkva, next);
1312 }
1313}
1314SYSINIT(exec_args_kva, SI_SUB_EXEC, SI_ORDER_ANY, exec_prealloc_args_kva, NULL);
1315
1316static vm_offset_t

Callers

nothing calls this directly

Calls 3

mtx_initFunction · 0.85
mallocFunction · 0.85
kmap_alloc_waitFunction · 0.85

Tested by

no test coverage detected