| 1314 | SYSINIT(exec_args_kva, SI_SUB_EXEC, SI_ORDER_ANY, exec_prealloc_args_kva, NULL); |
| 1315 | |
| 1316 | static vm_offset_t |
| 1317 | exec_alloc_args_kva(void **cookie) |
| 1318 | { |
| 1319 | struct exec_args_kva *argkva; |
| 1320 | |
| 1321 | argkva = (void *)atomic_readandclear_ptr( |
| 1322 | (uintptr_t *)DPCPU_PTR(exec_args_kva)); |
| 1323 | if (argkva == NULL) { |
| 1324 | mtx_lock(&exec_args_kva_mtx); |
| 1325 | while ((argkva = SLIST_FIRST(&exec_args_kva_freelist)) == NULL) |
| 1326 | (void)mtx_sleep(&exec_args_kva_freelist, |
| 1327 | &exec_args_kva_mtx, 0, "execkva", 0); |
| 1328 | SLIST_REMOVE_HEAD(&exec_args_kva_freelist, next); |
| 1329 | mtx_unlock(&exec_args_kva_mtx); |
| 1330 | } |
| 1331 | *(struct exec_args_kva **)cookie = argkva; |
| 1332 | return (argkva->addr); |
| 1333 | } |
| 1334 | |
| 1335 | static void |
| 1336 | exec_release_args_kva(struct exec_args_kva *argkva, u_int gen) |
no test coverage detected