]> rtime.felk.cvut.cz Git - frescor/frsh.git/blobdiff - resources/cpu_aquosa/mngr/frm_aqcpu.c
forb: executable resources and fcb changed into dynamic libs
[frescor/frsh.git] / resources / cpu_aquosa / mngr / frm_aqcpu.c
index 50fef9f2fb4b8b7b9f84985da865a692d8dc0afc..51c32d7817d6eaeeaf6ec80e83ffee63759a09a9 100644 (file)
@@ -90,18 +90,18 @@ static int aqcpu_admtest(struct fres_sa_scenario *scenario, void *priv,
 
                sum_utilization+= budget*100/period;
        }
-       *schedulable = sum_utilization < 100;
+       *schedulable = sum_utilization <= 88; // 100;
        if (*schedulable) {
                scenario->utilization = sum_utilization;
        }
-       printf("=> %s\n", *schedulable?"schedulable":"not schedulable");
+       ul_logmsg("=> %s\n", *schedulable?"schedulable":"not schedulable");
                
        return 0;
 }
 
-static const struct fres_res_manager frm = {
+static struct fres_res_manager frm = {
        .res_type = FRSH_RT_PROCESSOR,
-       .res_id = 0,
+       .res_id = FRSH_CPU_ID_DEFAULT,
        .admission_test = aqcpu_admtest,
        .name = "AQuoSA",
        .priv = NULL
@@ -119,16 +119,17 @@ usage(void)
        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;
+       bool opt_daemon = false;
+       char *opt_pidfile = NULL;
 
        ul_logreg_domain(&ulogd_frm_aqcpu);
 
-       while ((opt = getopt_long(argc, argv, "l:", &long_opts[0], NULL)) != EOF) {
+       while ((opt = getopt_long(argc, argv, "hl:", &long_opts[0], NULL)) != EOF) {
                switch (opt) {
                        case 'l':
                                ul_log_domain_arg2levels(optarg);
@@ -140,9 +141,8 @@ int main(int argc, char *argv[])
                }
        }
        
-       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);
 
        if (ret != 0) {