]> rtime.felk.cvut.cz Git - frescor/frsh-include.git/blobdiff - frsh_core_types.h
Added missing #include <frsh_cpp_macros.h>
[frescor/frsh-include.git] / frsh_core_types.h
index e0c72810a8423e089531bcc5959c65d4d9de7a51..8c9ec55d63b7bea6756392e4b96430a21d033f10 100644 (file)
@@ -1,5 +1,5 @@
 // -----------------------------------------------------------------------
-//  Copyright (C) 2006 - 2007 FRESCOR consortium partners:
+//  Copyright (C) 2006 - 2008 FRESCOR consortium partners:
 //
 //    Universidad de Cantabria,              SPAIN
 //    University of York,                    UK
 //   FSF API web pages: http://marte.unican.es/fsf/docs
 //                      http://shark.sssup.it/contrib/first/docs/
 //
-//  This file is part of FRSH API
+//   This file is part of FRSH (FRescor ScHeduler)
 //
-//  FRSH API is free software; you can  redistribute it and/or  modify
-//  it under the terms of  the GNU General Public License as published by
-//  the Free Software Foundation;  either  version 2, or (at  your option)
-//  any later version.
+//  FRSH is free software; you can redistribute it and/or modify it
+//  under terms of the GNU General Public License as published by the
+//  Free Software Foundation; either version 2, or (at your option) any
+//  later version.  FRSH is distributed in the hope that it will be
+//  useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+//  of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+//  General Public License for more details. You should have received a
+//  copy of the GNU General Public License along with FRSH; see file
+//  COPYING. If not, write to the Free Software Foundation, 675 Mass Ave,
+//  Cambridge, MA 02139, USA.
 //
-//  FRSH API  is distributed  in  the hope  that  it  will  be useful,  but
-//  WITHOUT  ANY  WARRANTY;     without  even the   implied   warranty  of
-//  MERCHANTABILITY  or  FITNESS FOR  A  PARTICULAR PURPOSE. See  the  GNU
-//  General Public License for more details.
-//
-//  You should have  received a  copy of  the  GNU  General Public License
-//  distributed  with  FRSH API;  see file COPYING.   If not,  write to the
-//  Free Software  Foundation,  59 Temple Place  -  Suite 330,  Boston, MA
-//  02111-1307, USA.
-//
-//  As a special exception, if you include this header file into source
-//  files to be compiled, this header file does not by itself cause
-//  the resulting executable to be covered by the GNU General Public
-//  License.  This exception does not however invalidate any other
-//  reasons why the executable file might be covered by the GNU General
-//  Public License.
+//  As a special exception, including FRSH header files in a file,
+//  instantiating FRSH generics or templates, or linking other files
+//  with FRSH objects to produce an executable application, does not
+//  by itself cause the resulting executable application to be covered
+//  by the GNU General Public License. This exception does not
+//  however invalidate any other reasons why the executable file might be
+//  covered by the GNU Public License.
 // -----------------------------------------------------------------------
 //frsh_core_types.h
 //==============================================
@@ -74,6 +71,7 @@
 #define   FRSH_CORE_TYPES_H_
 
 #include <stdbool.h>
+#include "frsh_time_types.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"
+
+#include "fosa.h"
+
+FRSH_CPP_BEGIN_DECLS
 
 /**
  * @file frsh_core_types.h
 /*@{*/
 
 
+/** identifier of a frsh thread **/
+typedef fosa_thread_id_t frsh_thread_id_t;
+
+
+/** thread attributes object **/
+typedef fosa_thread_attr_t frsh_thread_attr_t;
+
+/**
+ *  The type references a function that may become a thread's
+ *  code
+ **/
+typedef fosa_thread_code_t frsh_thread_code_t;
+
+
+/** signal number; it is an integer type **/
+typedef fosa_signal_t frsh_signal_t;
+
+#define FRSH_NULL_SIGNAL      FOSA_NULL_SIGNAL
+
+
+#define FRSH_SIGNAL_MIN       FOSA_SIGNAL_MIN
+#define FRSH_SIGNAL_MAX       FOSA_SIGNAL_MAX
+
+
+typedef fosa_signal_info_t frsh_signal_info_t;
+
+
 /** Kind of workload expected in vres: bounded or indeterminate **/
 typedef enum {
     FRSH_WT_BOUNDED       = 0,
-    FRSH_WT_INDETERMINATE = 1
+    FRSH_WT_INDETERMINATE = 1,
+    FRSH_WT_SYNCHRONIZED  = 2
 } frsh_workload_t;
+/**
+ * In the synchronized workload the virtual resource hosts one or more
+ * threads that synchronize the execution of their jobs with the start
+ * of the virtual resource's period. In this kind of workload, once
+ * the threads that were activated at the beginning of the period
+ * finish their current job, the virtual resource may return any
+ * unused capacity to the system. This kind of workload can be
+ * scheduled using a regular periodic server that has the properties
+ * of being simple, having less overhead, and being able to increase
+ * the schedulability of periodic synchronized threads
+ **/
 
-#define FRSH_NULL_DEADLINE     (struct timespec *)NULL
+#define FRSH_NULL_DEADLINE     (frsh_rel_time_t *)NULL
 // #define FRSH_NULL_SIGNAL       0 /* Defined at frsh_adaption.h */
 
 /** Negotiation status: In_progress, rejected, admitted, not_requested **/
@@ -129,7 +169,7 @@ typedef enum {
 
 /** Ressource Id: processor_id or network_id **/
 /**********************************************/
-typedef unsigned int frsh_resource_id_t;
+typedef fosa_resource_id_t frsh_resource_id_t;
 
 /** Kind of contract: regular, background or dummy **/
 typedef enum {
@@ -139,7 +179,6 @@ typedef enum {
 } frsh_contract_type_t;
 
 // 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];
 
 /**
@@ -182,5 +221,6 @@ typedef FRSH_SYNCHOBJ_HANDLE_T_OPAQUE frsh_synchobj_handle_t;
 
 /*@}*/
 
+FRSH_CPP_END_DECLS
 
 #endif   /* !FRSH_CORE_TYPES_H_ */