]> rtime.felk.cvut.cz Git - frescor/frsh-include.git/blobdiff - frsh_core_types.h
Added the support for POSIX98 symbols (for priority inheritance in mutexes) if AQuoSA...
[frescor/frsh-include.git] / frsh_core_types.h
index 1a82a0b4e271028a06f30bfde2057c271c071d44..a78800055d2a28cc6eb5b90f77d32b9dc702be59 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_core_types.h
 //==============================================
-//  ******** *******    ******** **      **
-//  **///// /**////**  **////// /**     /**
-//  **      /**   /** /**       /**     /**
-//  ******* /*******  /*********/**********
-//  **////  /**///**  ////////**/**//////**
-//  **      /**  //**        /**/**     /**
-//  **      /**   //** ******** /**     /**
-//  //       //     // ////////  //      // 
+//  ******** *******    ********  **      **
+//  **///// /**////**  **//////  /**     /**
+//  **      /**   /** /**        /**     /**
+//  ******* /*******  /********* /**********
+//  **////  /**///**  ////////** /**//////**
+//  **      /**  //**        /** /**     /**
+//  **      /**   //** ********  /**     /**
+//  //       //     // ////////   //      //
 //
 // FRSH(FRescor ScHeduler), pronounced "fresh"
 //==============================================
 
 
-#ifndef        FRSH_CORE_TYPES_H_
-#define        FRSH_CORE_TYPES_H_
+#ifndef   FRSH_CORE_TYPES_H_
+#define   FRSH_CORE_TYPES_H_
 
+#include <stdbool.h>
 #include "frsh_configuration_parameters.h"
 #include "frsh_opaque_types.h"
 #include "frsh_shared_objects_types.h"
 #include "frsh_hierarchical_types.h"
 #include "frsh_distributed_types.h"
 #include "frsh_error.h"
-
+#include "frsh_fosa.h"
 
 /**
- * \addtogroup core
+ * @file frsh_core_types.h
  **/
-/*@{*/
 
 
 /**
- * Bool as a byte value (char)
- *
- * We will revisit this if we have a problem with bool in C++
+ * \addtogroup core
  **/
-typedef char bool;
-#define true   1
-#define false  0
-
-
-/** Kind of workload expected in servers **/
-typedef enum {FRSH_BOUNDED, FRSH_INDETERMINATE, FRSH_OVERHEAD} frsh_workload_t;                           
+/*@{*/
 
-#define FRSH_DEFAULT_WORKLOAD       FRSH_INDETERMINATE
-#define FRSH_DEFAULT_D_EQUALS_T     false
-#define FRSH_DEFAULT_DEADLINE       {0,0} //struct timespec
 
+/** Kind of workload expected in vres: bounded or indeterminate **/
+typedef enum {
+    FRSH_WT_BOUNDED       = 0,
+    FRSH_WT_INDETERMINATE = 1
+} frsh_workload_t;
 
 #define FRSH_NULL_DEADLINE     (struct timespec *)NULL
-#define FRSH_NULL_SIGNAL       0
+// #define FRSH_NULL_SIGNAL       0 /* Defined at frsh_adaption.h */
+
+/** Negotiation status: In_progress, rejected, admitted, not_requested **/
+typedef enum {FRSH_RS_IN_PROGRESS,
+              FRSH_RS_REJECTED,
+              FRSH_RS_ADMITTED,
+              FRSH_RS_NOT_REQUESTED} frsh_renegotiation_status_t;
 
-/** Possible values returned by frsh_get_renegotiation_status **/
-typedef enum {FRSH_IN_PROGRESS,
-              FRSH_REJECTED,
-              FRSH_ADMITTED,
-              FRSH_NOT_REQUESTED} frsh_renegotiation_status_t;
 
 
-/** 
- *  Server Id type, that identifies a server created to manage a given
+/**
+ *  Vres Id type, that identifies a vres created to manage a given
  *  contract
  **/
-typedef int      frsh_server_id_t;             // => 0
+typedef unsigned int      frsh_vres_id_t;             // => 0
+
+/** Contract ressource type:  processor, network, memory **/
+typedef enum {
+    FRSH_RT_PROCESSOR = 0,
+    FRSH_RT_NETWORK   = 1,
+    FRSH_RT_MEMORY    = 2,
+    FRSH_RT_DISK      = 3
+} frsh_resource_type_t;
+
+/** Ressource Id: processor_id or network_id **/
+/**********************************************/
+typedef unsigned int frsh_resource_id_t;
+
+/** Kind of contract: regular, background or dummy **/
+typedef enum {
+        FRSH_CT_REGULAR    = 0,
+        FRSH_CT_BACKGROUND = 1,
+        FRSH_CT_DUMMY      = 2
+} frsh_contract_type_t;
+
+// The name of this constant has been updated to have the FRSH_ prefix
+typedef char frsh_contract_label_t[FRSH_CONTRACT_LABEL_MAXLENGTH + 1];
 
-
-/** 
+/**
  *  Contract parameters type; it is an opaque type (i.e. the internal
  *  structure of this data type is implementation dependent). The user
  *  can access and modify the parameters of a contract only with the
  *  proper functions, and should never access the data directly.
  **/
-typedef FRSH_CONTRACT_PARAMETERS_T_OPAQUE  frsh_contract_parameters_t;
-
-
-
-/*
-struct {
-    struct timespec         budget_min;
-    struct timespec         period_max;
-    struct timespec         budget_max;
-    struct timespec         period_min;
-    frsh_workload_t          workload;
-    
-    bool                    d_equals_t;
-    struct timespec         deadline;
-    int                     budget_overrun_sig_notify;
-    union sigval            budget_overrun_sig_value;
-    int                     deadline_miss_sig_notify;
-    union sigval            deadline_miss_sig_value;
-    
-    frsh_granularity_t       granularity;
-    frsh_utilization_set_t   utilization_set;
-    int                     quality;
-    int                     importance;
-    
-    frsh_preemption_level_t  preemption_level;
-    frsh_critical_sections_t critical_sections;
-
-    frsh_sched_policy_t      policy;
-    frsh_network_id_t        network_id;
-    bool                    granted_capacity_flag;
-}
-*/
+typedef FRSH_CONTRACT_T_OPAQUE  frsh_contract_t;
+
+
+/** List of vres **/
+typedef  struct {
+  int             size;
+  frsh_vres_id_t  vres[FRSH_MAX_N_VRES];
+} frsh_vres_group_t;
 
 /** List of contracts to negotiate **/
 typedef struct {
-  int  size;
-  frsh_contract_parameters_t*  contracts[FRSH_MAX_N_SERVERS];
+    int  size;
+    frsh_contract_t*  contracts[FRSH_MAX_N_VRES];
 } frsh_contracts_group_t;
 
-/** List of servers to cancel **/
-typedef  struct {
-  int             size;
-  frsh_server_id_t servers[FRSH_MAX_N_SERVERS];
-} frsh_servers_group_t;
+typedef struct {
+    int size;
+    frsh_contract_label_t contract_labels[FRSH_MAX_N_VRES];
+} frsh_contract_labels_group_t;
 
 
 /**
  * An abstract synchronization object is defined by the application.
  * This object can be used by an application to wait for an event to
- * arrive by invoking the frsh_schedule_triggered_job() operation.  It
+ * arrive by invoking the frsh_sychobj_wait() operation.  It
  * can also be used to signal the event either causing a waiting
- * server to wake up, or the event to be queued if no server is
- *  waiting for it.
+ * vres to wake up, or the event to be queued if no vres is
+ * waiting for it.
  **/
-typedef FRSH_SYNCH_OBJ_HANDLE_T_OPAQUE frsh_synch_obj_handle_t;
+typedef FRSH_SYNCHOBJ_HANDLE_T_OPAQUE frsh_synchobj_handle_t;
 
 
 /*@}*/
 
 
-#endif             /* !FRSH_CORE_TYPES_H_ */
+#endif   /* !FRSH_CORE_TYPES_H_ */