void __exit rtdm_skin_exit(void) { #ifdef CONFIG_RTAI_RTDM_SELECT xnselect_umount(); #endif rtai_timers_cleanup(); rtdm_dev_cleanup(); reset_rt_fun_ext_index(rtdm, RTDM_INDX); #ifdef CONFIG_PROC_FS rtdm_proc_cleanup(); #endif /* CONFIG_PROC_FS */ printk("RTDM stopped.\n"); }
int __init rtdm_skin_init(void) { int err; rtai_timers_init(); if(set_rt_fun_ext_index(rtdm, RTDM_INDX)) { printk("LXRT extension %d already in use. Recompile RTDM with a different extension index\n", RTDM_INDX); return -EACCES; } if ((err = rtdm_dev_init())) { goto fail; } xnintr_mount(); #ifdef CONFIG_RTAI_RTDM_SELECT if (xnselect_mount()) { goto cleanup_core; } #endif #ifdef CONFIG_PROC_FS if ((err = rtdm_proc_init())) { goto cleanup_core; } #endif /* CONFIG_PROC_FS */ printk("RTDM started.\n"); return 0; cleanup_core: #ifdef CONFIG_RTAI_RTDM_SELECT xnselect_umount(); #endif rtdm_dev_cleanup(); #ifdef CONFIG_PROC_FS rtdm_proc_cleanup(); #endif /* CONFIG_PROC_FS */ fail: return err; }
int __init __xeno_sys_init(void) { int ret; xnmod_sysheap_size = module_param_value(sysheap_size_arg) * 1024; ret = xnarch_init(); if (ret) goto fail; #ifndef __XENO_SIM__ ret = xnheap_init_mapped(&__xnsys_global_ppd.sem_heap, CONFIG_XENO_OPT_GLOBAL_SEM_HEAPSZ * 1024, XNARCH_SHARED_HEAP_FLAGS); if (ret) goto cleanup_arch; xnheap_set_label(&__xnsys_global_ppd.sem_heap, "global sem heap"); xnheap_init_vdso(); init_hostrt(); #endif /* !__XENO_SIM__ */ #ifdef __KERNEL__ xnpod_mount(); xnintr_mount(); #ifdef CONFIG_XENO_OPT_PIPE ret = xnpipe_mount(); if (ret) goto cleanup_proc; #endif /* CONFIG_XENO_OPT_PIPE */ #ifdef CONFIG_XENO_OPT_SELECT ret = xnselect_mount(); if (ret) goto cleanup_pipe; #endif /* CONFIG_XENO_OPT_SELECT */ ret = xnshadow_mount(); if (ret) goto cleanup_select; ret = xnheap_mount(); if (ret) goto cleanup_shadow; #endif /* __KERNEL__ */ xntbase_mount(); xnloginfo("real-time nucleus v%s (%s) loaded.\n", XENO_VERSION_STRING, XENO_VERSION_NAME); #ifdef CONFIG_XENO_OPT_DEBUG xnloginfo("debug mode enabled.\n"); #endif initq(&xnmod_glink_queue); xeno_nucleus_status = 0; xnarch_cpus_and(nkaffinity, nkaffinity, xnarch_supported_cpus); return 0; #ifdef __KERNEL__ cleanup_shadow: xnshadow_cleanup(); cleanup_select: #ifdef CONFIG_XENO_OPT_SELECT xnselect_umount(); cleanup_pipe: #endif /* CONFIG_XENO_OPT_SELECT */ #ifdef CONFIG_XENO_OPT_PIPE xnpipe_umount(); cleanup_proc: #endif /* CONFIG_XENO_OPT_PIPE */ xnpod_umount(); cleanup_arch: xnarch_exit(); #endif /* __KERNEL__ */ fail: xnlogerr("system init failed, code %d.\n", ret); xeno_nucleus_status = ret; return ret; }