]> rtime.felk.cvut.cz Git - frescor/frsh-include.git/blobdiff - frsh_core_types.h
endpoint is passed by value now, created frsh_distributed_init
[frescor/frsh-include.git] / frsh_core_types.h
index 1629ace0385ddcd6e9deb2aa63d3ddad847f0364..1bf5e5485046eeb204b0ac364f86ae493c4066af 100644 (file)
@@ -12,7 +12,7 @@
 //    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
@@ -22,7 +22,7 @@
 //
 //
 //  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
 //  **////  /**///**  ////////** /**//////**
 //  **      /**  //**        /** /**     /**
 //  **      /**   //** ********  /**     /**
-//  //       //     // ////////   //      // 
+//  //       //     // ////////   //      //
 //
 // 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_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_WT_BOUNDED, FRSH_WT_INDETERMINATE} frsh_workload_t;                           
+/*@{*/
 
-#define FRSH_DEFAULT_WORKLOAD       FRSH_WT_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,
+    FRSH_WT_INDETERMINATE
+} frsh_workload_t;
 
 #define FRSH_NULL_DEADLINE     (struct timespec *)NULL
 // #define FRSH_NULL_SIGNAL       0 /* Defined at frsh_adaption.h */
 
-/** Possible values returned by frsh_get_renegotiation_status **/
+/** Negotiation status: In_progress, rejected, admitted, not_requested **/
 typedef enum {FRSH_RS_IN_PROGRESS,
               FRSH_RS_REJECTED,
               FRSH_RS_ADMITTED,
@@ -118,26 +113,35 @@ typedef enum {FRSH_RS_IN_PROGRESS,
 
 
 
-/** 
- *  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_vres_id_t;             // => 0
+typedef unsigned int      frsh_vres_id_t;             // => 0
 
-/** Contract ressource type:  processor or network **/
-typedef enum {FRSH_RT_PROCESSOR, FRSH_RT_NETWORK} frsh_resource_type_t;
+/** Contract ressource type:  processor, network, memory **/
+typedef enum {
+    FRSH_RT_PROCESSOR,
+    FRSH_RT_NETWORK,
+    FRSH_RT_MEMORY
+} frsh_resource_type_t;
 
 /** Ressource Id: processor_id or network_id **/
 /**********************************************/
-typedef int frsh_resource_id_t;
+typedef unsigned int frsh_resource_id_t;
 
-/** Kind of contract **/
+/** This defines 1 resource_id value for systems that have only one
+    resource of a kind. **/
+#define FRSH_RESOURCE_ID_DEFAULT 0
+
+/** Kind of contract: regular, background or dummy **/
 typedef enum {FRSH_CT_REGULAR, FRSH_CT_BACKGROUND, FRSH_CT_DUMMY} frsh_contract_type_t;
 
-#define CONTRACT_ID_MAXLENGTH 15
-typedef char frsh_contract_id_t[CONTRACT_ID_MAXLENGTH];
+// The name of this constant has been updated to have the FRSH_ prefix
+#define FRSH_CONTRACT_LABEL_MAXLENGTH 15
+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
@@ -160,8 +164,8 @@ typedef struct {
 
 typedef struct {
     int size;
-    frsh_contract_id_t contract_ids[FRSH_MAX_N_VRES];
-} frsh_contract_ids_group_t;
+    frsh_contract_label_t contract_labels[FRSH_MAX_N_VRES];
+} frsh_contract_labels_group_t;
 
 
 /**
@@ -178,4 +182,4 @@ typedef FRSH_SYNCHOBJ_HANDLE_T_OPAQUE frsh_synchobj_handle_t;
 /*@}*/
 
 
-#endif             /* !FRSH_CORE_TYPES_H_ */
+#endif   /* !FRSH_CORE_TYPES_H_ */