5 #include <frsh_resources.h>
7 #ifdef FRSH_DISTRIBUTED_MODULE_SUPPORTED
8 #include <frsh_distributed.h>
11 #ifdef CONFIG_RESOURCE_DUMMY
12 #include <res_dummy.h>
15 struct frsh_forb frsh_forb_global;
17 static void *sch_executor_thread(void *arg)
19 return (void*)forb_executor_run(&frsh_forb_global.sch_executor);
27 frsh_forb_global.orb = forb_init(NULL, NULL, "frsh");
28 if (!frsh_forb_global.orb) {
29 if (errno) return errno;
33 frsh_forb_global.fcb = forb_resolve_reference(frsh_forb_global.orb,
34 fres_contract_broker_reg_name);
35 if (!frsh_forb_global.fcb) {
36 ret = FRES_ERR_FCB_NOT_RUNNING;
40 /* Initialize resource schedulers */
41 ret = forb_executor_init(&frsh_forb_global.sch_executor);
44 #ifdef CONFIG_RESOURCE_DUMMY
45 ret = frs_dummy_init(frsh_forb_global.orb, frsh_forb_global.fcb,
46 &frsh_forb_global.sch_executor);
50 #ifdef FRSH_DISTRIBUTED_MODULE_SUPPORTED
51 ret = frsh_distributed_init();
54 /* Run resource schedulers */
55 fosa_thread_create(&frsh_forb_global.sch_executor_thread, NULL,
56 sch_executor_thread, NULL);