static void xnsched_register_class(struct xnsched_class *sched_class) { sched_class->next = xnsched_class_highest; xnsched_class_highest = sched_class; /* * Classes shall be registered by increasing priority order, * idle first and up. */ XENO_BUGON(NUCLEUS, sched_class->next && sched_class->next->weight > sched_class->weight); xnloginfo("scheduling class %s registered.\n", sched_class->name); }
void __exit __xeno_sys_exit(void) { xnpod_shutdown(XNPOD_NORMAL_EXIT); #ifndef __XENO_SIM__ /* Must take place before xnpod_umount(). */ xnshadow_cleanup(); #endif xntbase_umount(); xnpod_umount(); xnarch_exit(); #ifndef __XENO_SIM__ xnheap_umount(); #ifdef CONFIG_XENO_OPT_PIPE xnpipe_umount(); #endif xnheap_destroy_mapped(&__xnsys_global_ppd.sem_heap, NULL, NULL); #endif /* !__XENO_SIM__ */ xnloginfo("real-time nucleus unloaded.\n"); }
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; }