// -----------------------------------------------------------------------
-// Copyright (C) 2006 - 2007 FRESCOR consortium partners:
+// Copyright (C) 2006 - 2008 FRESCOR consortium partners:
//
// Universidad de Cantabria, SPAIN
// University of York, UK
// 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
//
//
// 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
// 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 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.
+// This file is part of FRSH (FRescor ScHeduler)
//
-// 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.
+// 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.
//
-// 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.
// -----------------------------------------------------------------------
//==============================================
#define FRSH_SHARED_OBJECTS_TYPES_H_
#include <time.h>
-#include "frsh_opaque_types.h"
+#include "frsh_core_types.h"
#include "frsh_configuration_parameters.h"
+FRSH_CPP_BEGIN_DECLS
+
+/**
+ * @file frsh_shared_objects_types.h
+ **/
+
/**
* @addtogroup sharedobj
*
* @{
**/
-
-typedef char * frsh_sharedobj_id_t;
+/** Mutex object. Attributes are handled by FOSA **/
+typedef fosa_mutex_t frsh_mutex_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];
/**
- * Kind of shared object
+ * Kind of shared object: protected or unprotected
*/
-typedef enum {FRSH_SOK_UNPROTECTED, FRSH_SOK_PROTECTED}
- frsh_sharedobj_kind_t;
+typedef enum
+ {FRSH_SOK_UNPROTECTED, FRSH_SOK_PROTECTED}
+frsh_sharedobj_kind_t;
/**
- * Kind of protected operation
- */
-typedef enum {FRSH_CSOK_UNBOUNDED, FRSH_CSOK_READ, FRSH_CSOK_WRITE} frsh_csect_op_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
void * area;
} frsh_memory_area_data_t;
-/** Memory areas container **/
+/**
+ * Memory areas container
+ **/
typedef struct {
int size; // = 0
frsh_memory_area_data_t memory_areas[FRSH_MAX_N_MEMORY_AREAS];
/**
- * Critical section data (opaque type)
+ * Critical section data (opaque type)
**/
-typedef FRSH_CSECT_T_OPAQUE
- frsh_csect_t;
+typedef FRSH_CSECT_T_OPAQUE frsh_csect_t;
/**
- * Critical section container
+ * Container of a group of critical sections, up to a maximum size
**/
typedef struct {
- int size; // = 0
- frsh_csect_t csects[FRSH_MAX_N_CRITICAL_SECTIONS];
+ int size; // size of the group; initially=0
+ frsh_csect_t csects[FRSH_MAX_N_CRITICAL_SECTIONS]; // array of csect
} frsh_csects_group_t;
/*@}*/
+
+FRSH_CPP_END_DECLS
+
#endif /* !FRSH_SHARED_OBJECTS_TYPES_H_ */