]> rtime.felk.cvut.cz Git - frescor/frsh-include.git/blobdiff - frsh_shared_objects_types.h
flag for distributed trace
[frescor/frsh-include.git] / frsh_shared_objects_types.h
index 9b50f69f3db32d491b63238fe76bfcd76541fece..0513d5e98acb254510888d0c53043af7b44e3251 100644 (file)
@@ -1,10 +1,34 @@
 // -----------------------------------------------------------------------
+//  Copyright (C) 2006 - 2007 FRESCOR consortium partners:
+//
+//    Universidad de Cantabria,              SPAIN
+//    University of York,                    UK
+//    Scuola Superiore Sant'Anna,            ITALY
+//    Kaiserslautern University,             GERMANY
+//    Univ. Politécnica  Valencia,           SPAIN
+//    Czech Technical University in Prague,  CZECH REPUBLIC
+//    ENEA                                   SWEDEN
+//    Thales Communication S.A.              FRANCE
+//    Visual Tools S.A.                      SPAIN
+//    Rapita Systems Ltd                     UK
+//    Evidence                               ITALY
+//    
+//    See http://www.frescor.org for a link to partners' websites
+//
+//           FRESCOR project (FP6/2005/IST/5-034026) is funded
+//        in part by the European Union Sixth Framework Programme
+//        The European Union is not liable of any use that may be
+//        made of this code.
+//
+//
+//  based on previous work (FSF) done in the FIRST project
+//                       
 //   Copyright (C) 2005  Mälardalen University, SWEDEN
 //                       Scuola Superiore S.Anna, ITALY
 //                       Universidad de Cantabria, SPAIN
 //                       University of York, UK
 //
-//   FRSH API web pages: http://marte.unican.es/frsh/docs/
+//   FSF API web pages: http://marte.unican.es/fsf/docs
 //                      http://shark.sssup.it/contrib/first/docs/
 //
 //  This file is part of FRSH API
 // -----------------------------------------------------------------------
 
 //==============================================
-//  ******** *******    ******** **      **
-//  **///// /**////**  **////// /**     /**
-//  **      /**   /** /**       /**     /**
-//  ******* /*******  /*********/**********
-//  **////  /**///**  ////////**/**//////**
-//  **      /**  //**        /**/**     /**
-//  **      /**   //** ******** /**     /**
-//  //       //     // ////////  //      // 
+//  ******** *******    ********  **      **
+//  **///// /**////**  **//////  /**     /**
+//  **      /**   /** /**        /**     /**
+//  ******* /*******  /********* /**********
+//  **////  /**///**  ////////** /**//////**
+//  **      /**  //**        /** /**     /**
+//  **      /**   //** ********  /**     /**
+//  //       //     // ////////   //      // 
 //
 // FRSH(FRescor ScHeduler), pronounced "fresh"
 //==============================================
 #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];
 
 /**
- * Critical section data:  Shared object + execution time
+ * Kind of shared object: protected or unprotected
+ */
+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;                           
+
+/**
+ *  Pointer to protected operation, which takes a pointer to
+ *  the input parameters, and a pointer to the output 
+ *  parameters; the user is responsible for not exceeding the 
+ *  sizes of the respective input and output parameters data structures
+ */
+typedef void (*frsh_csect_op_t)
+          (const void * input_arg, void * output_arg);
+
+/**
+ *  A memory area
+ */
 typedef struct {
-   frsh_shared_obj_handle_t obj_handle;
-   struct timespec wcet;  //Execution time
-} frsh_critical_section_data_t;
+  size_t size;
+  void * area;
+} frsh_memory_area_data_t;
 
-/** Critical section container **/
+/** 
+ * Memory areas container 
+ **/
 typedef struct {
     int size; // = 0
-    frsh_critical_section_data_t section[FRSH_MAX_N_CRITICAL_SECTIONS];
-} frsh_critical_sections_t;
+    frsh_memory_area_data_t memory_areas[FRSH_MAX_N_MEMORY_AREAS];
+} frsh_memory_areas_t;
+
+
+/**
+ * Critical section data (opaque type)
+ **/
+typedef FRSH_CSECT_T_OPAQUE frsh_csect_t;
+
+
+/**
+ * Container of a group of critical sections, up to a maximum size
+ **/
+typedef struct {
+  int size;     // size of the group; initially=0
+  frsh_csect_t csects[FRSH_MAX_N_CRITICAL_SECTIONS]; // array of csect 
+} frsh_csects_group_t;
 
 /*@}*/