]> rtime.felk.cvut.cz Git - frescor/fwp.git/commitdiff
Added aquosa sched ops
authorMartin <molnar@sum.(none)>
Wed, 3 Sep 2008 14:43:12 +0000 (16:43 +0200)
committerMartin <molnar@sum.(none)>
Wed, 3 Sep 2008 14:43:12 +0000 (16:43 +0200)
frsh/frsh_resource.c
frsh/frsh_resource.h
frsh/frsh_vres.h
frsh_aquosa/scheduler.c [new file with mode: 0644]
frsh_aquosa/vres.c [new file with mode: 0644]

index 92e7c66642c9754223fdfdfd8b7a6e4549e7f8c7..89fc9a0f4644ae11e15427b41f8d595f42a567ea 100644 (file)
@@ -1,20 +1,10 @@
 #include "frsh_resource.h"
 
-frsh_resource_t* frsh_resources[FRSH_RESOURCE_NUM+1];
-
-int frsh_resource_register(frsh_resource_type_t type, frsh_resource_t* resource)
-{
-       if (frsh_resources[type]) {
-               errno = EPERM;
-               return (-errno);
-       } else
-               frsh_resources[type] = resource;
-
-       return 0;
-}
-
-int frsh_resource_unregister(frsh_resource_type_t type)
-{
-       frsh_resources[type] = NULL;
-       return 0;
-}
+struct frsh_sched_ops* frsh_sched_ops[FRSH_RESOURCE_NUM+1] = {
+               NULL,
+               &frsh_aquosa_sched_ops,
+               NULL,
+               NULL,
+               NULL,
+               NULL
+};
index 36809e72260cb096289da0598ab678af3384b593..dfe65a419d5281065d6f49e33812b55a4efd191c 100644 (file)
 
 #include "frsh_err.h"
 
-struct frsh_contract_ops; 
-
 typedef enum {
-       FRSH_DUMMY      = 0,
-       FRSH_CPU        = 1,
-       FRSH_MEMORY     = 2,
-       FRSH_DISK       = 3,
+       FRSH_DUMMY      = 0, /* reserved */
+       FRSH_CPU        = 1, /* reserved */
+       FRSH_MEMORY     = 2, /* reserved */
+       FRSH_DISK       = 3, /* reserved */
        FRSH_CAN        = 4,
        FRSH_WIFI       = 5,
 } frsh_resource_type_t;
 
-typedef struct frsh_resource {
-       struct frsh_contract_ops  *contract_ops;
-       //Should call connect/disconnect from manager
-       //int (*init)();
-       //int (*del)
-} frsh_resource_t;
-
-int frsh_resource_register(frsh_resource_type_t type, frsh_resource_t* resource);
-int frsh_resource_unregister(frsh_resource_type_t type);
+typedef unsigned int frsh_vres_d_t;
 
 #endif /* FRSH_RESOURCE_H */
index 76da64493c61e34f5b031e8d340bb9e1edc2d026..4db64222e77a81385b7da632b05f3a2018c578e0 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 /* FRSH descriptor type */
-typedef unsigned int frsh_vres_d_t;
+//typedef unsigned int frsh_vres_d_t;
 
 /*typedef struct frsh_vres_ops{
                write;
diff --git a/frsh_aquosa/scheduler.c b/frsh_aquosa/scheduler.c
new file mode 100644 (file)
index 0000000..f57d7fb
--- /dev/null
@@ -0,0 +1,39 @@
+#include "frsh_scheduler.h"
+#include "qres_lib.h"
+
+int aquosa_sched_init()
+{
+       qos_rv rv;
+
+       if (qres_init() != QOS_OK) {
+               return -1;
+       }
+       
+       /* register to DTM */
+       return 0
+}
+
+int aquosa_sched_exit()
+{
+       qos_rv rv;
+
+       rv = qres_cleanup();
+       return qos_rv_int(rv);
+}
+
+int aquosa_create_vres(contract_handle_t contract)
+{
+       // parse contract and create vres by calling
+       // qos_rv qres_create_server(qres_params_t *p_params,
+       //                              qres_sid_t *p_sid);
+               
+}
+
+frsh_sched_ops aquosa_sched_ops = {
+       .init = aquosa_init();
+       .exit = aquosa_exit();
+       .create_vres = aquosa_create_vres();
+       .cancel_vres = aquosa_cancel_vres();
+       .change_vres = aquosa_change_vres();
+};
+
diff --git a/frsh_aquosa/vres.c b/frsh_aquosa/vres.c
new file mode 100644 (file)
index 0000000..f79da29
--- /dev/null
@@ -0,0 +1,3 @@
+#include "frsh_vres.h"
+
+