-bin_PROGRAMS += fcb
+shared_LIBRARIES += fcb
CFLAGS += --std=gnu99 #--save-temps
}
static struct option long_opts[] = {
- { "daemon", optional_argument, NULL, 'd' },
{ "loglevel", required_argument, NULL, 'l' },
{ 0, 0, 0, 0}
};
usage(void)
{
printf("usage: fcb [ options ]\n");
- printf(" -d, --daemon [pid-file] go to background after FORB initialization\n");
printf(" -l, --loglevel <number>|<domain>=<number>,...\n");
}
return 0;
}
-int main(int argc, char *argv[])
+int forb_main(forb_orb orb, int argc, char *argv[])
{
- forb_orb orb;
struct fcb fcb_data;
fres_contract_broker fcb;
forb_executor_t executor;
};
int opt;
- while ((opt = getopt_long(argc, argv, "d::hl:", &long_opts[0], NULL)) != EOF) {
+ while ((opt = getopt_long(argc, argv, "hl:", &long_opts[0], NULL)) != EOF) {
switch (opt) {
case 'l':
if (*optarg == '?') {
error(1, EINVAL, "Error parsing -l argument at char %d\n", ret);
}
break;
- case 'd':
- opt_daemon = true;
- opt_pidfile = optarg;
- break;
case 'h':
/*default:*/
usage();
if (opt_daemon)
forb_daemon_prepare(opt_pidfile);
- orb = forb_init(&argc, &argv, &attr);
- if (!orb) error(1, errno, "FORB initialization failed");
-
#if CONFIG_FCB_INET && !CONFIG_FORB_PROTO_INET_DEFAULT
ret = register_inet_port(orb);
if (ret) error(0, errno, "INET port registration failed");
ifeq ($(CONFIG_RESOURCE_CLUSTER_TREE),y)
CFLAGS += -std=gnu99 -DFRESCOR
-bin_PROGRAMS = frm_cluster_tree
+shared_LIBRARIES = frm_cluster_tree
frm_cluster_tree_SOURCES = frm_cluster_tree.c ct_wsn.c cluster_tree_blocks.c
#frm_cluster_tree.c cluster_tree_block.c
frm_cluster_tree_CLIENT_IDL = cluster_tree_idl.idl
};
-int main(int argc, char *argv[])
+int forb_main(forb_orb orb, int argc, char *argv[])
{
- forb_orb orb;
int ret;
forb_init_attr_t attr = { .orb_id = "org.frescor.frm.cluster_tree" };
- orb = forb_init(&argc, &argv, &attr);
- if (!orb) error(1, errno, "forb_init");
fres_block_register_cluster_tree();
-bin_PROGRAMS = frm_aqcpu
+shared_LIBRARIES = frm_aqcpu
frm_aqcpu_SOURCES = frm_aqcpu.c
LOADLIBES += -L $(AQUOSA_ROOT)/lib -lqreslib -lqsuplib
LOADLIBES += -Xlinker -rpath -Xlinker $(AQUOSA_ROOT)/lib
usage(void)
{
printf("usage: frm_aqcpu [ options ]\n");
- printf(" -d, --daemon [pid-file] go to background after FORB initialization\n");
printf(" -l, --loglevel <number>|<domain>=<number>,...\n");
}
-int main(int argc, char *argv[])
+int forb_main(forb_orb orb, int argc, char *argv[])
{
- forb_orb orb;
int ret;
forb_init_attr_t attr = { .orb_id = "org.frescor.frm.aqcpu" };
int opt;
ul_logreg_domain(&ulogd_frm_aqcpu);
- while ((opt = getopt_long(argc, argv, "d::hl:", &long_opts[0], NULL)) != EOF) {
+ while ((opt = getopt_long(argc, argv, "hl:", &long_opts[0], NULL)) != EOF) {
switch (opt) {
- case 'd':
- opt_daemon = true;
- opt_pidfile = optarg;
- break;
case 'l':
ul_log_domain_arg2levels(optarg);
break;
}
}
- if (opt_daemon)
- forb_daemon_prepare(opt_pidfile);
-
- orb = forb_init(&argc, &argv, &attr);
- if (!orb) error(1, errno, "forb_init");
frm.res_id = frsh_get_local_cpu_id();
ret = frm_register_and_run(orb, &frm);
-bin_PROGRAMS = frm_cgcpu
+shared_LIBRARIES = frm_cgcpu
frm_cgcpu_SOURCES = frm_cgcpu.c
frm_cgcpu_LIBS = frm forb contract fosa rt ulut fcb_client
lib_LOADLIBES+= frsh
printf(" -l, --loglevel <number>|<domain>=<number>,...\n");
}
-int main(int argc, char *argv[])
+int forb_main(forb_orb orb, int argc, char *argv[])
{
- forb_orb orb;
FILE* fd;
int ret;
int opt;
ul_logreg_domain(&ulogd_frm_cpucg);
- while ((opt = getopt_long(argc, argv, "d::hl:", &long_opts[0], NULL)) != EOF) {
+ while ((opt = getopt_long(argc, argv, "hl:", &long_opts[0], NULL)) != EOF) {
switch (opt) {
- case 'd':
- opt_daemon = true;
- opt_pidfile = optarg;
- break;
case 'l':
ul_log_domain_arg2levels(optarg);
break;
}
}
- if (opt_daemon)
- forb_daemon_prepare(opt_pidfile);
-
- orb = forb_init(&argc, &argv, &attr);
- if (!orb) error(1, errno, "forb_init");
if (!(fd = fopen("/proc/sys/kernel/sched_rt_period_us", "r"))) {
error(1, errno, "frm_generic_run");
LFS:=$(shell getconf LFS_CFLAGS)
CFLAGS += $(LFS)
-bin_PROGRAMS = frm_diskbfq
+shared_LIBRARIES = frm_diskbfq
frm_diskbfq_SOURCES = diskbfq_mngr.c diskbfq_th.c
frm_diskbfq_LIBS = frm forb contract fosa m rt ulut fcb_client frshdiskbfq
.priv = &disk
};
-int main(int argc, char *argv[])
+int forb_main(forb_orb orb, int argc, char *argv[])
{
forb_init_attr_t attr = { .orb_id = "org.frescor.frm.diskbfq" };
- forb_orb orb;
FILE* fd;
int readers = 4;
char disk_dev[40] = {0}, *disk_name = disk_dev;
if (!*disk_name)
error(1, 0, "Disk device not specified");
- orb = forb_init(&argc, &argv, &attr);
- if (!orb) error(1, errno, "forb_init");
-
/*
* Check if BFQ I/O scheduler is available
* in the system.
default_CONFIG += CONFIG_RESOURCE_DUMMY_VERBOSE=y
LOCAL_CONFIG_H = dummy_config.h
-bin_PROGRAMS = frm_dummy
+shared_LIBRARIES = frm_dummy
frm_dummy_SOURCES = frm_dummy.c dummy_block.c
frm_dummy_CLIENT_IDL = res_dummy_idl.idl
frm_dummy_LIBS = frm forb contract fosa rt ulut fcb_client
};
static struct option long_opts[] = {
- { "daemon", optional_argument, NULL, 'd' },
{ "loglevel", 1, 0, 'l' },
- { "id", required_argument, 0, 'i' },
+// { "id", required_argument, 0, 'i' },
{ "accept-all", 0, 0, 'a' },
{ "help", 0, 0, 'h' },
{ 0, 0, 0, 0}
printf("usage: frm_dummy [ options ]\n");
printf(" -a, --accept-all Accepts all contracts\n");
printf(" -d, --daemon [pid-file] go to background after FORB initialization\n");
- printf(" -i, --id <resource id> Use a different id that the default (%d)\n", DUMMY_RESOURCE_ID);
+/* printf(" -i, --id <resource id> Use a different id that the default (%d)\n", DUMMY_RESOURCE_ID);*/
printf(" -h, --help Display this help\n");
printf(" -l, --loglevel <number>|<domain>=<number>,...\n");
}
-int main(int argc, char *argv[])
+int forb_main(forb_orb orb, int argc, char *argv[])
{
- forb_orb orb;
int ret;
forb_init_attr_t attr = { .orb_id = "org.frescor.frm.dummy" };
int opt;
- while ((opt = getopt_long(argc, argv, "ad::i:l:h", &long_opts[0], NULL)) != EOF) {
+ while ((opt = getopt_long(argc, argv, "ai:l:h", &long_opts[0], NULL)) != EOF) {
switch (opt) {
case 'a':
opt_accept_all = true;
opt_daemon = true;
opt_pidfile = optarg;
break;
- case 'i':
- opt_res_id = atoi(optarg);
- break;
+// case 'i':
+// opt_res_id = atoi(optarg);
+// break;
case 'l':
ul_log_domain_arg2levels(optarg);
break;
if (opt_daemon)
forb_daemon_prepare(opt_pidfile);
- orb = forb_init(&argc, &argv, &attr);
- if (!orb) error(1, errno, "forb_init");
-
/* Register fres_block_dummy_sched to contract handling
* functions */
fres_block_register_dummy();
ifeq ($(CONFIG_RESOURCE_FPGA),y)
LOCAL_CONFIG_H = fpga_config.h
-bin_PROGRAMS = frm_fpga
+shared_LIBRARIES = frm_fpga
frm_fpga_SOURCES = frm_fpga.c fpga_block.c
frm_fpga_CLIENT_IDL = res_fpga_idl.idl
frm_fpga_LIBS = frm forb contract fosa rt ulut fcb_client
};
-int main(int argc, char *argv[])
+int forb_main(forb_orb orb, int argc, char *argv[])
{
- forb_orb orb;
int ret;
forb_init_attr_t attr = { .orb_id = "org.frescor.frm.fpga" };
- orb = forb_init(&argc, &argv, &attr);
- if (!orb) error(1, errno, "forb_init");
/* Register fres_block_fpga to contract handling
* functions */
ifeq ($(CONFIG_RESOURCE_ITEM),y)
CFLAGS += -std=gnu99
-bin_PROGRAMS = frm_item
+shared_LIBRARIES = frm_item
frm_item_SOURCES = frm_item.c item_blocks.c FWSN.c serialsource.c
frm_item_SERVER_IDL = item_idl.idl
frm_item_LIBS = frm forb contract fosa rt ulut fcb_client m
struct item_status item_status;
-int main(int argc, char *argv[])
+int forb_main(forb_orb orb, int argc, char *argv[])
{
- forb_orb orb;
int ret;
forb_executor_t executor;
fres_resource_manager frm;
char *parametrsITEM[] ={NULL,device,platform};
forb_init_attr_t attr = { .orb_id = "org.frescor.frm.item" };
- orb = forb_init(&argc, &argv, &attr);
- if (!orb) error(1, errno, "forb_init");
-
fres_block_register_item();