]> rtime.felk.cvut.cz Git - frescor/frsh-include.git/blobdiff - frsh_opaque_types.h
resource_id is unsigned int
[frescor/frsh-include.git] / frsh_opaque_types.h
index 199b8f05ea36aed6b6d7929452d8c41d437b970f..6fab50dfecc0ceb44dd448db31f2371542f31691 100644 (file)
@@ -1,10 +1,34 @@
 // -----------------------------------------------------------------------
-//   Copyright (C) 2005  Mälardalen University, SWEDEN
+//  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_opaque_types.h
 //==============================================
-//  ******** *******    ******** **      **
-//  **///// /**////**  **////// /**     /**
-//  **      /**   /** /**       /**     /**
-//  ******* /*******  /*********/**********
-//  **////  /**///**  ////////**/**//////**
-//  **      /**  //**        /**/**     /**
-//  **      /**   //** ******** /**     /**
-//  //       //     // ////////  //      // 
+//  ******** *******    ********  **      **
+//  **///// /**////**  **//////  /**     /**
+//  **      /**   /** /**        /**     /**
+//  ******* /*******  /********* /**********
+//  **////  /**///**  ////////** /**//////**
+//  **      /**  //**        /** /**     /**
+//  **      /**   //** ********  /**     /**
+//  //       //     // ////////   //      // 
 //
 // FRSH(FRescor ScHeduler), pronounced "fresh"
-//================================================
+//==============================================
 
 // Implementation dependent definitions
 #ifndef _FRSH_OPAQUE_TYPES_H_
 #define _FRSH_OPAQUE_TYPES_H_
 
-#include <signal.h>
+
+/**
+ * @file frsh_opaque_types.h
+ **/
 
 /**
  * @defgroup opaque Opaque types
  **/
 
 /** frsh_contract_parameters_t **/
-#define FRSH_CONTRACT_PARAMETERS_T_OPAQUE struct {   \
+#define FRSH_CONTRACT_T_OPAQUE struct { \
 \
-  /** Processor Id or Network Id **/ \
-  int                     resource_id; \
-\  
-  /** Whether processor or network **/ \
-  frsh_contract_resource_type resource_type;\
+  /** Processor Id or Network Id **/                          \
+  frsh_resource_id_t   resource_id;                             \
 \
-  /** Printable name for
-      the contract.  Unique within the local node **/ \
-  frsh_contract_id_t      contract_id; \
+  /** Whether processor or network **/                        \
+  frsh_resource_type_t resource_type;                           \
 \
-  /** Minimum budget needed to perform a job **/
-  struct timespec         budget_min; \
+  /** Printable name for the contract
+     Unique within the local node               **/         \
+  frsh_contract_label_t      contract_label;                        \
 \
-  /** Maximum period that the system system can sustain **/
-  struct timespec         period_max; \
+  /** Minimum budget needed to perform a job.  With the energy 
+      module this will be an array **/              \
+  struct timespec         budget_min;                         \
 \
-  /** Maximum budget that the server can use (and would be happy to have) **/
-  struct timespec         budget_max; \
+  /** Maximum period that the system system can sustain **/   \
+  struct timespec         period_max;                         \
+\
+  /** Maximum budget that the vres can use
+     (and would be happy to have).  With the energy module
+     this will be an array **/              \
+  struct timespec         budget_max;                         \
 \
   /** Minimum period for that
-      the system can use (and would be happy to have) **/
-  struct timespec         period_min;                \
+     the system can use (and would be happy to have) **/     \
+  struct timespec         period_min;                         \
 \
-  /** Workload_type:  bounded, indeterminate, overhead **/
-  frsh_workload_t          workload;                  \
+  /** Set of discrete values for budget and period.  With the
+      energy module this will be an array **/        \
+  frsh_utilization_set_t   utilization_set;          \
 \
-  /** Scheduling type:  Regular, background (in round-robin) or dummy **/
-  frsh_contract_type_t    contract_type;             \
+  /** Workload_type:  bounded, indeterminate, overhead **/    \
+  frsh_workload_t          workload;                          \
 \
-  /** Whether delay equals period **/
-  bool                    d_equals_t;                \
+  /** Scheduling type:  Regular, background
+     (in round-robin) or dummy             **/               \
+  frsh_contract_type_t    contract_type;                      \
 \
-  /** Deadline (will be ignored if d_equals_t is TRUE **/                                                        
-  struct timespec         deadline;                  \
+  /** Whether delay equals period **/                         \
+  bool                    d_equals_t;                         \
 \
-  /** POSIX signal parameters for the case of attempting to use too
-      much budget **/
-  int                     budget_overrun_sig_notify; \
-  union sigval            budget_overrun_sig_value;  \
+  /** Deadline (will be ignored if d_equals_t is TRUE **/     \
+  struct timespec         deadline;                           \
 \
-  /** POSIX signal parameters for the case a deadline is missed **/
-  int                     deadline_miss_sig_notify;  \
-  union sigval            deadline_miss_sig_value;   \
+  /** Signal parameters for the case of
+      attempting to use too much budget       **/             \
+  frsh_signal_t           budget_overrun_signal;          \
+  frsh_signal_info_t      budget_overrun_siginfo;           \
 \
-  /** Wether the range of period and budget is specified in a
-      continuous way (max-min) or as a set of discrete values **/
-  frsh_granularity_t       granularity;               \
-
-  /** Set of discrete values for budget and period **/
-  frsh_utilization_set_t   utilization_set;           \
-
-  /** Non-cooperative parameter for fair capacity distribution **/
+  /** Signal parameters for the case a deadline
+     is missed **/                                           \
+  frsh_signal_t           deadline_miss_signal;           \
+  frsh_signal_info_t      deadline_miss_siginfo;            \
+\
+  /** Wether the range of period and budget is specified
+      in a continuous way (max-min) or as a set of
+      discrete values                                    **/  \
+  frsh_granularity_t       granularity;                       \
+\
+  /** Non-cooperative parameter for fair capacity
+      distribution                                **/         \
   int                     importance;                \
-
-  /** Cooperative parameter for fair capacity distribution **/
-  int                     quality;                   \
-
-  /** If > 0 it describes a duration for which the allocated 
-      budget and capacity will be maintained across negotiations 
-      and will not be affected for dynamic spare capacity **/
-  struct timespec         stability_time;                 \ 
-                                                    \
-  /** Low level parameter related with the elegibility to preempt
-      other threads **/
-  frsh_preemption_level_t  preemption_level;          \
-
-  /** Set of critical sections that the server executes besides the
-      normal budget **/
-  frsh_critical_sections_t critical_sections;         \
-                                                     \
-  /** Internal scheduling policy within the server for 
-      hierarchical scheduling systems **/
-  frsh_sched_policy_t      policy;                    \
+\
+  /** Cooperative parameter for fair capacity
+      distribution **/                                        \
+  int                     weight;                   \
+\
+  /** If > 0 it describes a duration for which
+      the allocated budget and capacity will be
+      maintained across negotiations  and will
+      not be affected for dynamic spare capacity    **/       \
+  struct timespec         stability_time;  \
+\
+  /** Low level parameter related with the elegibility
+      preempt other threads                            **/    \
+  frsh_preemption_level_t  preemption_level;                  \
+\
+  /** Set of critical sections that the vres executes
+      besides the normal budget                        **/   \
+  frsh_csects_group_t critical_sections;                 \
+\
+  /** Internal scheduling policy within the vres for
+      hierarchical scheduling systems                  **/    \
+  frsh_sched_policy_t      policy;                            \
+\
+  /** Protocol info for distributed systems.  We store it
+      as a pointer+size.  It's internal meaning is imple-
+      mentation dependent.                              **/    \
+  frsh_protocol_info_t    protocol_info; \
+  frsh_endpoint_queueing_info_t    queueing_info; \
+\
+  /** Maximum loss rate
+      Percentage of packet loss in the network that is 
+      tolerated by the application **/                       \
+int                     max_loss_rate; \
+\
+ /** Minimum memory size to be reserved **/ \
+size_t                  minimum_memory; \
+\
+/** Maximum memory size to be reserved  **/ \
+size_t                  maximum_memory; \
 }
 
 
-#define FRSH_SYNCH_OBJ_HANDLE_T_OPAQUE int
+typedef int FRSH_SYNCHOBJ_HANDLE_T_OPAQUE;
+
+typedef int FRSH_SHAREDOBJ_HANDLE_T_OPAQUE;
 
-#define FRSH_SHARED_OBJ_HANDLE_T_OPAQUE int
+/**
+ * Critical section data
+ * - comon parameters
+ *     op_kind;     // kind of operation (READ or WRITE)
+ *     obj_handle;  // handle to shared object
+ *     wcet;        // Execution time
+ *     blocking;    // Blocking time (execution time + protection overheads)
+ * - attributes used only for protected shared objects
+ *     op;          // pointer to the operation
+ * - attributes used only for protected write operations
+ *     areas;       // memory areas to be protected
+ * 
+ **/
+#define FRSH_CSECT_T_OPAQUE struct { \
+  frsh_csect_op_kind_t op_kind;                 \
+  frsh_sharedobj_handle_t obj_handle;               \
+  struct timespec wcet;                              \
+  struct timespec blocking;                              \
+  frsh_csect_op_t op;                           \
+  frsh_memory_areas_t areas;                         \
+}
 
 
 //opaque types for frsh endpoints
-#define FRSH_SEND_ENDPOINT_T_OPAQUE int
+typedef int FRSH_SEND_ENDPOINT_T_OPAQUE;
 
-#define FRSH_RECEIVE_ENDPOINT_T_OPAQUE int
+typedef int FRSH_RECEIVE_ENDPOINT_T_OPAQUE;
 
 /*@}*/