#include "frsh_opaque_types.h"
#include "frsh_configuration_parameters.h"
+/**
+ * @file frsh_shared_objects_types.h
+ **/
+
/**
* @addtogroup sharedobj
*
**/
-typedef char * frsh_shared_obj_id_t;
-
-
/**
* Shared object handle: It is an opaque type (i.e. the internal
* structure of this data type is implementation dependent).
**/
-typedef FRSH_SHARED_OBJ_HANDLE_T_OPAQUE frsh_shared_obj_handle_t;
+typedef FRSH_SHAREDOBJ_HANDLE_T_OPAQUE frsh_sharedobj_handle_t;
+/**
+ * Shared object textual label
+ **/
+typedef char frsh_sharedobj_label_t[FRSH_MAX_SIZE_SHARED_OBJ_LABEL + 1];
/**
- * Kind of shared object
+ * Kind of shared object: protected or unprotected
*/
-typedef enum {FRSH_UNPROTECTED, FRSH_PROTECTED}
- frsh_shared_obj_kind_t;
+typedef enum
+ {FRSH_SOK_UNPROTECTED, FRSH_SOK_PROTECTED}
+frsh_sharedobj_kind_t;
/**
- * Kind of protected operation
- */
-typedef enum {FRSH_OP_UNPROTECTED, FRSH_OP_READ, FRSH_OP_WRITE}
- frsh_shared_obj_op_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;
/**
* Pointer to protected operation, which takes a pointer to
* parameters; the user is responsible for not exceeding the
* sizes of the respective input and output parameters data structures
*/
-typedef void (*frsh_shared_obj_op_t)
+typedef void (*frsh_csect_op_t)
(const void * input_arg, void * output_arg);
/**
void * area;
} frsh_memory_area_data_t;
-/** Memory areas container **/
+/**
+ * Memory areas container
+ **/
typedef struct {
int size; // = 0
- frsh_memory_area_data_t section[FRSH_MAX_N_MEMORY_AREAS];
+ frsh_memory_area_data_t memory_areas[FRSH_MAX_N_MEMORY_AREAS];
} frsh_memory_areas_t;
/**
- * Critical section data (opaque type)
+ * Critical section data (opaque type)
**/
-typedef FRSH_CRITICAL_SECTION_DATA_T_OPAQUE
- frsh_critical_section_data_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_critical_section_data_t section[FRSH_MAX_N_CRITICAL_SECTIONS];
-} frsh_critical_sections_t;
+ int size; // size of the group; initially=0
+ frsh_csect_t csects[FRSH_MAX_N_CRITICAL_SECTIONS]; // array of csect
+} frsh_csects_group_t;
/*@}*/