]> rtime.felk.cvut.cz Git - frescor/frsh-include.git/blobdiff - frsh_shared_objects_types.h
Adding frsh_usec_to_rel_time()
[frescor/frsh-include.git] / frsh_shared_objects_types.h
index 312a71a2f08607c2091d9ece49754112fcbf45a5..582c59c175c504516b46baa1333a679f96095fcd 100644 (file)
 #define        FRSH_SHARED_OBJECTS_TYPES_H_
 
 #include <time.h>
-#include "frsh_opaque_types.h"
+#include "frsh_core_types.h"
 #include "frsh_configuration_parameters.h"
 
+FRSH_CPP_BEGIN_DECLS
+
 /**
  * @file frsh_shared_objects_types.h
  **/
@@ -86,6 +88,9 @@
  * @{
  **/
 
+/** Mutex object.  Attributes are handled by FOSA **/
+typedef fosa_mutex_t frsh_mutex_t;
+
 
 /** 
  *  Shared object handle:  It is an opaque type (i.e. the internal
  **/
 typedef FRSH_SHAREDOBJ_HANDLE_T_OPAQUE  frsh_sharedobj_handle_t; 
 
-
-#define SHAREDOBJ_LABEL_MAXLENGTH 15
-typedef char frsh_sharedobj_label_t[SHAREDOBJ_LABEL_MAXLENGTH + 1];
-
-
+/**
+ *  Shared object textual label
+ **/
+typedef char frsh_sharedobj_label_t[FRSH_MAX_SIZE_SHARED_OBJ_LABEL + 1];
 
 /**
- * Kind of shared object protected or unprotected
+ * Kind of shared object: protected or unprotected
  */
-typedef enum {FRSH_SOK_UNPROTECTED, FRSH_SOK_PROTECTED}
-          frsh_sharedobj_kind_t;                           
+typedef enum 
+  {FRSH_SOK_UNPROTECTED, FRSH_SOK_PROTECTED}
+frsh_sharedobj_kind_t;
 
 /**
  * Kind of protected operation: read, write or unchecked
  **/
-typedef enum {FRSH_CSOK_UNCHECKED, FRSH_CSOK_READ, FRSH_CSOK_WRITE} frsh_csect_op_kind_t;                           
+typedef enum 
+  {FRSH_CSOK_UNCHECKED, FRSH_CSOK_READ, FRSH_CSOK_WRITE} 
+frsh_csect_op_kind_t;                           
 
 /**
  *  Pointer to protected operation, which takes a pointer to
@@ -127,7 +134,9 @@ typedef struct {
   void * area;
 } frsh_memory_area_data_t;
 
-/** Memory areas container **/
+/** 
+ * Memory areas container 
+ **/
 typedef struct {
     int size; // = 0
     frsh_memory_area_data_t memory_areas[FRSH_MAX_N_MEMORY_AREAS];
@@ -135,20 +144,22 @@ typedef struct {
 
 
 /**
- * Critical section data (opaque type) 
+ * Critical section data (opaque type)
  **/
-typedef FRSH_CSECT_T_OPAQUE 
-        frsh_csect_t;
+typedef FRSH_CSECT_T_OPAQUE frsh_csect_t;
 
 
 /**
- * Critical section container 
+ * Container of a group of critical sections, up to a maximum size
  **/
 typedef struct {
-    int size; // = 0
-    frsh_csect_t csects[FRSH_MAX_N_CRITICAL_SECTIONS];
+  int size;     // size of the group; initially=0
+  frsh_csect_t csects[FRSH_MAX_N_CRITICAL_SECTIONS]; // array of csect 
 } frsh_csects_group_t;
 
 /*@}*/
 
+
+FRSH_CPP_END_DECLS
+
 #endif             /* !FRSH_SHARED_OBJECTS_TYPES_H_ */