]> rtime.felk.cvut.cz Git - frescor/frsh-include.git/blobdiff - frsh_core.h
Setting FRSH_DEFAULT_WEIGHT to 1 since 0 is not supported by
[frescor/frsh-include.git] / frsh_core.h
index 9f323d51369b9a3f81c4b152f18028181a5bbdcd..6f2083e1c67d503a8be770b1751a4f0f6b8bfdae 100644 (file)
@@ -672,15 +672,17 @@ int frsh_timed_wait
  * frsh_vresperiod_wait()
  *
  * Suspend the calling thread until the start of the specified virtual
- * resource period, for a synchronized workload.
+ * resource period of a vres_id, for a synchronized workload.
  *
  * Virtual resource periods are numbered. The number of the current
  * period can be obtained through the frsh_vres_get_period_number()
  * operation.
  **/
-int frsh_vresperiod_wait
-   (const frsh_vres_id_t vres,
-    long period_num);
+int frsh_vresperiod_wait(unsigned long period_num,
+                         frsh_rel_time_t       *next_budget,
+                         frsh_rel_time_t       *next_period,
+                         bool                  *was_deadline_missed,
+                         bool                  *was_budget_overran);
 
 
 /**
@@ -846,6 +848,35 @@ int frsh_thread_create_in_background
      frsh_vres_id_t *vres_id);
 
 
+
+/**
+ * frsh_thread_join_in_background()
+ *
+ * This function is aimed for external threads to join FRSH in the
+ * least disturbing possible mode.
+ *
+ * Upon calling this function by a thread which has been created
+ * natively in the OS, it joins the framework and gets inmediately
+ * bound to an on-the-fly generated background contract.
+ *
+ * In order to gain a higher priority then it can renegotiate a
+ * contract for its vres with the needed parameters.
+ *
+ * @param[in] resource_id:   Resource (CPU) in which the vres will
+ *                           be associated.
+ *
+ * @param[in] resource_type: Resource type (should be CPU) for the
+ *                           contract.
+ *
+ * @param[in] label:         Label to be added to the contract.
+ *
+ * @param[out] vres_id:      Resulting vres_id from the on-the-fly
+ *                           generated background contract.
+ *
+ * @return  0 if successful\n
+ *          FRSH_ERR_NOT_CONTRACTED_VRES if the thread is already
+ *          bound to a vres.
+ **/
 int frsh_thread_join_in_background(frsh_resource_id_t resource_id,
                                    frsh_resource_type_t resource_type,
                                    const char *label,