]> rtime.felk.cvut.cz Git - frescor/frsh-include.git/blobdiff - frsh_core.h
Adapting FRSH to the new time types and synchronising headers with phase 2
[frescor/frsh-include.git] / frsh_core.h
index d3db7dbdcdb35c131ac4264f4527b2d46a14cd73..0440e4bee6baf18b6ce29623d312177cf3449529 100644 (file)
@@ -218,14 +218,14 @@ int frsh_contract_init(frsh_contract_t *contract);
  *
  * @return 0 if no error \n
  *    FRSH_ERR_BAD_ARGUMENT :  if any of the pointers is NULL
- *    or if only one of the timespec values is 0, and also if the
+ *    or if only one of the time values is 0, and also if the
  *    workload or the contract type values are unknown in the
  *    enumerations.
  **/
 int frsh_contract_set_basic_params
   (frsh_contract_t *contract,
-   const struct timespec      *budget_min,
-   const struct timespec      *period_max,
+   const frsh_rel_time_t      *budget_min,
+   const frsh_rel_time_t      *period_max,
    const frsh_workload_t      workload,
    const frsh_contract_type_t contract_type);
 
@@ -249,8 +249,8 @@ int frsh_contract_set_basic_params
  **/
 int frsh_contract_get_basic_params
   (const frsh_contract_t *contract,
-   struct timespec  *budget_min,
-   struct timespec  *period_max,
+   frsh_rel_time_t  *budget_min,
+   frsh_rel_time_t  *period_max,
    frsh_workload_t   *workload,
    frsh_contract_type_t *contract_type);
 
@@ -330,7 +330,7 @@ int frsh_contract_get_resource_and_label
 int frsh_contract_set_timing_reqs
   (frsh_contract_t *contract,
    const bool                   d_equals_t,
-   const struct timespec        *deadline,
+   const frsh_rel_time_t        *deadline,
    const frsh_signal_t          budget_overrun_signal,
    const frsh_signal_info_t     budget_overrun_siginfo,
    const frsh_signal_t          deadline_miss_signal,
@@ -350,7 +350,7 @@ int frsh_contract_set_timing_reqs
 int frsh_contract_get_timing_reqs
   (const frsh_contract_t *contract,
    bool                    *d_equals_t,
-   struct timespec         *deadline,
+   frsh_rel_time_t         *deadline,
    frsh_signal_t           *budget_overrun_signal,
    frsh_signal_info_t      *budget_overrun_siginfo,
    frsh_signal_t           *deadline_miss_signal,
@@ -524,8 +524,8 @@ int frsh_synchobj_destroy
  **/
 int frsh_synchobj_wait
   (const frsh_synchobj_handle_t  synch_handle,
-   struct timespec               *next_budget,
-   struct timespec               *next_period,
+   frsh_rel_time_t               *next_budget,
+   frsh_rel_time_t               *next_period,
    bool                          *was_deadline_missed,
    bool                          *was_budget_overran);
 
@@ -556,10 +556,10 @@ int frsh_synchobj_wait
  **/
 int frsh_synchobj_wait_with_timeout
   (const frsh_synchobj_handle_t  synch_handle,
-   const struct timespec         *abs_timeout,
+   const frsh_abs_time_t         *abs_timeout,
    bool                          *timed_out,
-   struct timespec               *next_budget,
-   struct timespec               *next_period,
+   frsh_rel_time_t               *next_budget,
+   frsh_rel_time_t               *next_period,
    bool                          *was_deadline_missed,
    bool                          *was_budget_overran);
 
@@ -663,9 +663,9 @@ int frsh_synchobj_signal
  * @sa frsh_synchobj_wait, frsh_synchobj_wait_with_timeout
  **/
 int frsh_timed_wait
-  (const struct timespec *abs_time,
-   struct timespec       *next_budget,
-   struct timespec       *next_period,
+  (const frsh_abs_time_t *abs_time,
+   frsh_rel_time_t       *next_budget,
+   frsh_rel_time_t       *next_period,
    bool                  *was_deadline_missed,
    bool                  *was_budget_overran);
 
@@ -1371,7 +1371,19 @@ bool frsh_config_is_admission_test_enabled();
  **/
 int frsh_vres_get_usage
    (const frsh_vres_id_t vres,
-    struct timespec *spent);
+    frsh_rel_time_t *spent);
+
+
+/**
+ * frsh_vres_get_job_usage()
+ *
+ * Get the execution time of the current job of the specified virtual
+ * resource for a bounded or synchronized workload.
+ **/
+int frsh_vres_get_job_usage
+    (const frsh_vres_id_t vres,
+     frsh_rel_time_t *spent);
+
 
 /**
  * frsh_vres_get_remaining_budget()
@@ -1393,7 +1405,7 @@ int frsh_vres_get_usage
  **/
 int frsh_vres_get_remaining_budget
    (const frsh_vres_id_t vres,
-    struct timespec *budget);
+    frsh_rel_time_t *budget);
 
 
 /**
@@ -1417,8 +1429,8 @@ int frsh_vres_get_remaining_budget
  **/
 int frsh_vres_get_budget_and_period
    (const frsh_vres_id_t vres,
-    struct timespec *budget,
-    struct timespec *period);
+    frsh_rel_time_t *budget,
+    frsh_rel_time_t *period);
 
 /*@}*/
 
@@ -1475,8 +1487,8 @@ int frsh_vres_get_budget_and_period
  *     has been cancelled or it is not valid
  *
  **/
-int frsh_service_thread_set_data (const struct timespec *budget,
-                                  const struct timespec *period,
+int frsh_service_thread_set_data (const frsh_rel_time_t *budget,
+                                  const frsh_rel_time_t *period,
                                   bool                  *accepted);
 
 /**
@@ -1497,8 +1509,8 @@ int frsh_service_thread_set_data (const struct timespec *budget,
  *
  **/
 int frsh_service_thread_get_data
-   (struct timespec *budget,
-    struct timespec *period);
+   (frsh_rel_time_t *budget,
+    frsh_rel_time_t *period);
 
 
 /*@}*/