]> rtime.felk.cvut.cz Git - frescor/fosa.git/blobdiff - src_ose/copies_of_changed_files/fosa_opaque_types.h
• Brief description:
[frescor/fosa.git] / src_ose / copies_of_changed_files / fosa_opaque_types.h
diff --git a/src_ose/copies_of_changed_files/fosa_opaque_types.h b/src_ose/copies_of_changed_files/fosa_opaque_types.h
new file mode 100644 (file)
index 0000000..541fca7
--- /dev/null
@@ -0,0 +1,172 @@
+// -----------------------------------------------------------------------
+//  Copyright (C) 2006 - 2007 FRESCOR consortium partners:
+//
+//    Universidad de Cantabria,              SPAIN
+//    University of York,                    UK
+//    Scuola Superiore Sant'Anna,            ITALY
+//    Kaiserslautern University,             GERMANY
+//    Univ. Politecnica  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.
+//
+//  This file is part of the FRSH implementation
+//
+//  FRSH 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 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;  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.
+// -----------------------------------------------------------------------
+//fosa_opaque_types.h
+//==============================================
+//  ********  ******    ********  **********
+//  **///// /**    **  **//////  /**     /**
+//  **      /**    ** /**        /**     /**
+//  ******* /**    ** /********* /**********
+//  **////  /**    ** ////////** /**//////**
+//  **      /**    **        /** /**     /**
+//  **      /**    **  ********  /**     /**
+//  //       /******/  ////////   //      // 
+//
+// FOSA(Frescor Operating System Adaptation layer)
+//================================================
+
+// Implementation dependent definitions
+
+#ifndef _FOSA_OPAQUE_TYPES_H_
+#define _FOSA_OPAQUE_TYPES_H_
+
+
+#if defined(RT_LINUX) || defined(MARTE_OS)
+
+#include <pthread.h>
+#include <signal.h>
+#include <time.h>
+
+#ifdef RT_LINUX
+#include <rtl_timer.h>
+#endif
+
+
+#define    FOSA_CLOCK_ID_T_OPAQUE    clockid_t
+
+#define    FOSA_TIMER_ID_T_OPAQUE    timer_t
+
+#define    FOSA_COND_T_OPAQUE        pthread_cond_t
+
+/*********
+ *  ADS
+ *********/
+
+#define FOSA_ADS_ACTIONS_T_OPAQUE  int
+/*should be posix_appsched_actions_t*/
+
+#endif // RT_LINUX || MARTE_OS
+
+
+//////////////////////////////// OSE ////////////////////////////////////
+#if defined(OSE)
+
+#include "ose.h"
+#include "sys/time.h"
+//#include "fosa_types.h" //Possible circular reference.....................
+#include "frsh_fosa.h"
+//#include "../src_ose/fosa_ose_implementation_specific.h"
+
+#define    FOSA_CLOCK_ID_T_OPAQUE    PROCESS//ok?...........................
+
+//#define    FOSA_CLOCK_REALTIME       0 //Should be used.............
+#define    CLOCK_MONOTONIC           0 //Should not be used...........
+
+#define    FOSA_OSE_MAX_COND_CUEUE         100
+/*
+ * author erth
+ *
+ * This struct is used for the condition varables. It has a maximum queue
+ * length pre allocated in memory. This might be better implemented by a 
+ * linked list or something like that. But this is for now. Then the 
+ * constant above gets unnnecessary. 
+ */
+typedef struct {
+    PROCESS pid[ FOSA_OSE_MAX_COND_CUEUE ];
+    int pid_queue_length;
+} fosa_ose_cond_t;
+
+#define    FOSA_COND_T_OPAQUE        fosa_ose_cond_t
+
+// This structure represents a timerid.
+typedef struct {
+    PROCESS             clock_id;
+    SIGSELECT           sig_no;
+    frsh_signal_info_t  info;
+    OSTMOREF            ose_tmoref;
+} fosa_ose_timer_id_t;
+    
+#define    FOSA_TIMER_ID_T_OPAQUE    fosa_ose_timer_id_t *
+
+/*********
+ *  ADS
+ *********/
+
+typedef enum { 
+    REJECT, ACTIVATE, SUSPEND, TIMEOUT, THREAD_NOTIFICATION
+} action_t;
+
+#endif
+//////////////////////////// End of OSE /////////////////////////////////
+
+
+////////////////////////// DUMMY_OS    //////////////////////////////////////
+#if defined(DUMMY_OS)
+
+/* With this define we make sure that we are truly POSIX and OSE */
+/* independent at the FRSH code.                                 */
+/*****************************************************************/
+
+#define    FOSA_CLOCK_ID_T_OPAQUE    int
+#define    FOSA_SYSTEM_CLOCK_OPAQUE  42
+
+#define    FOSA_TIMER_ID_T_OPAQUE    int
+
+#define    FOSA_COND_T_OPAQUE        int
+
+/*********
+ *  ADS
+ *********/
+
+#define FOSA_ADS_ACTIONS_T_OPAQUE  int
+
+
+
+
+#endif /* DUMMY */
+//////////////////////////End of DUMMY_OS ////////////////////////////////////
+
+#endif // _FOSA_OPAQUE_TYPES_H_