/* * Turn on indications for standard (non-configurable) kernel features. */ static void p31b_set_standard(void *dummy) { p31b_setcfg(CTL_P1003_1B_FSYNC, 200112L); p31b_setcfg(CTL_P1003_1B_MAPPED_FILES, 200112L); p31b_setcfg(CTL_P1003_1B_SHARED_MEMORY_OBJECTS, 200112L); p31b_setcfg(CTL_P1003_1B_PAGESIZE, PAGE_SIZE); }
static int sched_attach(void) { int ret = ksched_attach(&ksched); if (ret == 0) p31b_setcfg(CTL_P1003_1B_PRIORITY_SCHEDULING, 200112L); return ret; }
static int ksem_module_init(void) { int error; mtx_init(&sem_lock, "sem", NULL, MTX_DEF); mtx_init(&ksem_count_lock, "ksem count", NULL, MTX_DEF); sx_init(&ksem_dict_lock, "ksem dictionary"); ksem_dictionary = hashinit(1024, M_KSEM, &ksem_hash); p31b_setcfg(CTL_P1003_1B_SEM_NSEMS_MAX, SEM_MAX); p31b_setcfg(CTL_P1003_1B_SEM_VALUE_MAX, SEM_VALUE_MAX); error = syscall_helper_register(ksem_syscalls); if (error) return (error); #ifdef COMPAT_FREEBSD32 error = syscall32_helper_register(ksem32_syscalls); if (error) return (error); #endif return (0); }
/* * Turn on indications for standard (non-configurable) kernel features. */ static void p31b_set_standard(void *dummy) { p31b_setcfg(CTL_P1003_1B_FSYNC, 200112L); p31b_setcfg(CTL_P1003_1B_MAPPED_FILES, 200112L); p31b_setcfg(CTL_P1003_1B_SHARED_MEMORY_OBJECTS, 200112L); p31b_setcfg(CTL_P1003_1B_PAGESIZE, PAGE_SIZE); if (!p31b_iscfg(CTL_P1003_1B_AIO_LISTIO_MAX)) p31b_setcfg(CTL_P1003_1B_AIO_LISTIO_MAX, -1); if (!p31b_iscfg(CTL_P1003_1B_AIO_MAX)) p31b_setcfg(CTL_P1003_1B_AIO_MAX, -1); if (!p31b_iscfg(CTL_P1003_1B_AIO_PRIO_DELTA_MAX)) p31b_setcfg(CTL_P1003_1B_AIO_PRIO_DELTA_MAX, -1); }
static void ksem_module_destroy(void) { #ifdef COMPAT_FREEBSD32 syscall32_helper_unregister(ksem32_syscalls); #endif syscall_helper_unregister(ksem_syscalls); p31b_setcfg(CTL_P1003_1B_SEMAPHORES, 0); hashdestroy(ksem_dictionary, M_KSEM, ksem_hash); sx_destroy(&ksem_dict_lock); mtx_destroy(&ksem_count_lock); mtx_destroy(&sem_lock); p31b_unsetcfg(CTL_P1003_1B_SEM_VALUE_MAX); p31b_unsetcfg(CTL_P1003_1B_SEM_NSEMS_MAX); }
static void p31binit(void *notused) { (void) sched_attach(); p31b_setcfg(CTL_P1003_1B_PAGESIZE, PAGE_SIZE); }