]> rtime.felk.cvut.cz Git - frescor/frsh-include.git/blobdiff - frsh_core.h
Add frsh_destroy()
[frescor/frsh-include.git] / frsh_core.h
index e5076820e1af20ac9f5fa0169de10cbd006c6f4f..4681e05232278bacfebfa0d08a1983e465f61561 100644 (file)
@@ -135,6 +135,13 @@ FRSH_CPP_BEGIN_DECLS
  **/
 int frsh_init();
 
+/**
+ * frsh_destroy()
+ *
+ * Reverts the efect of frsh_init().
+ */
+void frsh_destroy();
+
 /*@}*/
 
 
@@ -309,22 +316,6 @@ int frsh_contract_get_resource_and_label
  *                       this parameter is ignored (the contract value
  *                       will be NULL_DEADLINE internally). Otherwise, it
  *                       contains the desired deadline value.
- * @param [in] budget_overrun_signal contains the number of the signal
- *                that must be raised if the budget of the vres is overrun.
- *                If the value of this parameter is FRSH_NULL_SIGNAL, no signal will
- *                be raised.
- * @param [in] budget_overrun_siginfo contains the value that will be
- *               passed to the signal "catcher" when the signal is raised.
- *               This parameters is not used if the budget_overrun_signal
- *               parameter is set to FRSH_NULL_SIGNAL.
- * @param [in] deadline_miss_signal contains the number of the
- *               signal that must be raised if the deadline of the
- *               vres is missed. If the value of this parameter is
- *               FRSH_NULL_SIGNAL, no signal is raised.
- * @param [in] deadline_miss_siginfo contains the value that will be
- *                passed to the signal "catcher" when the signal is
- *                raised.  This parameter is not used if the
- *                deadline_signal parameter is set to NULL_SIGNAL
  *
  * @return  0 if successful\n
  *     FRSH_ERR_BAD_ARGUMENT :  if contract is NULL \b or \n
@@ -338,11 +329,7 @@ int frsh_contract_get_resource_and_label
 int frsh_contract_set_timing_reqs
   (frsh_contract_t *contract,
    const bool                   d_equals_t,
-   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,
-   const frsh_signal_info_t     deadline_miss_siginfo);
+   const frsh_rel_time_t        *deadline);
 
 /**
  * frsh_contract_get_timing_reqs()
@@ -358,11 +345,7 @@ int frsh_contract_set_timing_reqs
 int frsh_contract_get_timing_reqs
   (const frsh_contract_t *contract,
    bool                    *d_equals_t,
-   frsh_rel_time_t         *deadline,
-   frsh_signal_t           *budget_overrun_signal,
-   frsh_signal_info_t      *budget_overrun_siginfo,
-   frsh_signal_t           *deadline_miss_signal,
-   frsh_signal_info_t      *deadline_miss_siginfo);
+   frsh_rel_time_t         *deadline);
 
 
 /*@}*/
@@ -964,6 +947,38 @@ int frsh_thread_bind
  **/
 int frsh_thread_unbind(const frsh_thread_id_t thread);
 
+/**
+ * frsh_vres_set_notification()
+ *
+ * This function setups notification signals for CPU vres. It is
+ * necessary to call this function before bounding the thread to the
+ * vres.
+ * 
+ * @param [in] budget_overrun_signal contains the number of the signal
+ *                that must be raised if the budget of the vres is
+ *                overrun by the thread.
+ *                If the value of this parameter is FRSH_NULL_SIGNAL, no signal will
+ *                be raised.
+ * @param [in] budget_overrun_siginfo contains the value that will be
+ *               passed to the signal "catcher" when the signal is raised.
+ *               This parameters is not used if the budget_overrun_signal
+ *               parameter is set to FRSH_NULL_SIGNAL.
+ * @param [in] deadline_miss_signal contains the number of the
+ *               signal that must be raised if the deadline of the
+ *               vres is missed. If the value of this parameter is
+ *               FRSH_NULL_SIGNAL, no signal is raised.
+ * @param [in] deadline_miss_siginfo contains the value that will be
+ *                passed to the signal "catcher" when the signal is
+ *                raised.  This parameter is not used if the
+ *                deadline_signal parameter is set to NULL_SIGNAL
+ **/
+int frsh_vres_set_notification(
+       frsh_vres_id_t vres,
+       const frsh_signal_t          budget_overrun_signal,
+       const frsh_signal_info_t     budget_overrun_siginfo,
+       const frsh_signal_t          deadline_miss_signal,
+       const frsh_signal_info_t     deadline_miss_siginfo);
+
 /**
  * frsh_thread_get_vres_id()
  *
@@ -1567,6 +1582,19 @@ int frsh_service_thread_get_data
 //threads
 
 
+////////////////////////////////////////////////////////////////////////
+//           OTHER
+////////////////////////////////////////////////////////////////////////
+
+/**
+ * Returns resource id of local CPU.
+ *
+ * The ID is determined from environment variable FRSH_CPU_ID or, if
+ * that is not defined, the compile time default (defined in
+ * config.target/omk).
+ */
+frsh_resource_id_t frsh_get_local_cpu_id(void);
+
 FRSH_CPP_END_DECLS
 
 #endif // _FRSH_CORE_H_