]> rtime.felk.cvut.cz Git - frescor/frsh-include.git/blobdiff - frsh_shared_objects.h
Added Makefiles for OMK makesystem
[frescor/frsh-include.git] / frsh_shared_objects.h
index 7b73d2ed2b5b0288743134f17409c40b88a55273..76e0d893e4af6dbef2e897f6214aa3e1146f9ce1 100644 (file)
 #ifndef _FRSH_SHARED_OBJECTS_H_
 #define _FRSH_SHARED_OBJECTS_H_
 
-#include "frsh_fosa.h"
 #include "frsh_shared_objects_types.h"
 #include "frsh_core_types.h"
 
+FRSH_CPP_BEGIN_DECLS
 
 #define FRSH_SHAREDOBJS_MODULE_SUPPORTED       1
 
@@ -375,7 +375,7 @@ int frsh_sharedobj_remove
  **/
 int frsh_csect_init
     (frsh_sharedobj_handle_t obj_handle,
-     struct timespec wcet,
+     frsh_rel_time_t wcet,
      frsh_csect_t *csect);
 
 
@@ -419,7 +419,7 @@ int frsh_csect_get_sharedobj_handle
  **/
 int frsh_csect_get_wcet
     (const frsh_csect_t *csect,
-     struct timespec *wcet);
+     frsh_rel_time_t *wcet);
 
 
 /**
@@ -478,7 +478,7 @@ int frsh_csect_register_write_op
  * frsh_csect_get_op_kind()
  *
  * Returns the type of operation (read/write/unchecked) of the critical section.
-
+ *
  * @return 0 if no error \n
  *   FRSH_ERR_BAD_ARGUMENT : if csect or op_kind are NULL or csect
  *      is not correct \n
@@ -524,7 +524,7 @@ int frsh_csect_get_read_op
 /**
  * frsh_csect_get_write_op()
  *
- * Get the oparation pointer and the memory areas stored in the csect.
+ * Get the operation pointer and the memory areas stored in the csect.
  *
  * If the csect is of type read or unchecked.
  *
@@ -598,7 +598,7 @@ int frsh_csect_invoke
  * Get in the variable pointed to by blocking the maximum blocking
  * time of the operation of the referenced protected critical section.
  *
- * For read operations, the maximum blocking time is the wcet.
+ * For read or unchecked operations, the maximum blocking time is the wcet.
  *
  * For write operations, the maximum blocking time suffered by higher
  * priority tasks is the wcet of the operation plus the backup time
@@ -618,7 +618,35 @@ int frsh_csect_invoke
  **/
 int frsh_csect_get_blocking_time
     (const frsh_csect_t *csect,
-     struct timespec *blocking);
+     frsh_rel_time_t *blocking);
+
+
+/**
+ * frsh_csect_destroy()
+ * 
+ * Destroy a critical section, deallocating all the resources that may
+ * have been allocated to it.
+ **/
+int frsh_csect_destroy
+   (frsh_csect_t *csect);
+
+/**
+ * frsh_csect_register_thread()
+ * 
+ * Register the calling thread for invoking time-protected critical
+ * sections via frsh_csect_invoke.
+ **/
+int frsh_csect_register_thread();
+
+/**
+ * frsh_csect_deregister_thread()
+ * 
+ * Deregister the calling thread from being able to invoke
+ * time-protected critical sections. This operation releases system
+ * resources that may have been allocated for the thread.
+ **/
+int frsh_csect_deregister_thread();
+
 
 
 /*@}*/ /* For so_critical group */
@@ -647,7 +675,7 @@ int frsh_csect_get_blocking_time
  * @return 0 if no error \n
  *    FRSH_ERR_BAD_ARGUMENT :  if any of the pointers is NULL or 
  *    the size of the critical_sections structure is less than zero
- *    or grater than FRSH_MAX_N_CRITICAL_SECTIONS
+ *    or greater than FRSH_MAX_N_CRITICAL_SECTIONS
  * 
  **/
 int frsh_contract_set_csects
@@ -675,4 +703,6 @@ int frsh_contract_get_csects
 
 /*@}*/ /* For shared_objects group */
 
+FRSH_CPP_END_DECLS
+
 #endif // _FRSH_SHARED_OBJECTS_H_