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

Function ksem_module_init

freebsd/kern/uipc_sem.c:1029–1051  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1027#endif
1028
1029static int
1030ksem_module_init(void)
1031{
1032 int error;
1033
1034 mtx_init(&sem_lock, "sem", NULL, MTX_DEF);
1035 mtx_init(&ksem_count_lock, "ksem count", NULL, MTX_DEF);
1036 sx_init(&ksem_dict_lock, "ksem dictionary");
1037 ksem_dictionary = hashinit(1024, M_KSEM, &ksem_hash);
1038 p31b_setcfg(CTL_P1003_1B_SEMAPHORES, 200112L);
1039 p31b_setcfg(CTL_P1003_1B_SEM_NSEMS_MAX, SEM_MAX);
1040 p31b_setcfg(CTL_P1003_1B_SEM_VALUE_MAX, SEM_VALUE_MAX);
1041
1042 error = syscall_helper_register(ksem_syscalls, SY_THR_STATIC_KLD);
1043 if (error)
1044 return (error);
1045#ifdef COMPAT_FREEBSD32
1046 error = syscall32_helper_register(ksem32_syscalls, SY_THR_STATIC_KLD);
1047 if (error)
1048 return (error);
1049#endif
1050 return (0);
1051}
1052
1053static void
1054ksem_module_destroy(void)

Callers 1

sem_modloadFunction · 0.85

Calls 4

mtx_initFunction · 0.85
p31b_setcfgFunction · 0.85
syscall_helper_registerFunction · 0.85
hashinitFunction · 0.70

Tested by

no test coverage detected