]> rtime.felk.cvut.cz Git - frescor/frsh-include.git/blobdiff - frsh_fosa_opaque.h
Uploading protected shared objects functionality
[frescor/frsh-include.git] / frsh_fosa_opaque.h
index 74a63df3893fdf195e4615fbb56ef9631f91474f..28ed4cf72db893ab06d67bb3bbff34ca1e5d78a2 100644 (file)
@@ -104,7 +104,12 @@ typedef struct {
 
 #else  /* !AQuoSA, MARTE_OS, RT_LINUX */
 
+#ifdef MARTE_OS
 typedef pthread_t FOSA_THREAD_ID_T_OPAQUE;
+#else
+//#define FOSA_MUTEX_T_OPAQUE pthread_mutex_t
+#define FOSA_THREAD_ID_T_OPAQUE pthread_t
+#endif
 
 #endif /* AQuoSA */
 
@@ -112,7 +117,6 @@ typedef pthread_attr_t FOSA_THREAD_ATTR_T_OPAQUE;
 
 typedef int FOSA_SIGNAL_T_OPAQUE;
 
-
 typedef pthread_mutex_t FOSA_MUTEX_T_OPAQUE;
 
 // The minimum and maximum signal numbers that may be used by the FRSH
@@ -136,10 +140,15 @@ typedef pthread_mutex_t FOSA_MUTEX_T_OPAQUE;
 #define FOSA_EAGAIN   EAGAIN
 
 /** FOSA ADS errors **/
+#ifdef MARTE_OS
+#define EREJECT   201 /* (for linux_lib_arch) Appsched has rejected object */
+#endif
+
 #define FOSA_EREJECT   EREJECT
 #define FOSA_EMASKED   -2
 #define FOSA_EPOLICY   -3
 
+#define FOSA_ETIMEDOUT ETIMEDOUT
 
 
 #endif /* MARTE_OS || RT_LINUX || AQuoSA */
@@ -149,8 +158,7 @@ typedef pthread_mutex_t FOSA_MUTEX_T_OPAQUE;
 ////////////////////////// VIRTUAL TIME    //////////////////////////////////////
 
 #if defined(VIRTUAL_TIME)
-#include <fosa.h>
-#include <vt_ose.h>
+#include <fosa_vt.h>
 
 #define FOSA_THREAD_ID_T_OPAQUE   vt_posix_process_t
 
@@ -165,30 +173,33 @@ typedef pthread_mutex_t FOSA_MUTEX_T_OPAQUE;
 #define FOSA_SIGNAL_MIN       8
 #define FOSA_SIGNAL_MAX       31
 
-#define FOSA_NULL_SIGNAL 0
-
-/* FOSA Errors */
+// the min. and max. priority a fosa thread can have
+#define FOSA_PRIORITY_MAX VT_PRIORITY_MIN - 1
+#define FOSA_PRIORITY_MIN VT_PRIORITY_MAX
 
-/* #include <error.h> */
+#define FOSA_NULL_SIGNAL       0
 
-/** Not enough memory available **/
-#define FOSA_ENOMEM   -2
+/* FOSA Errors and return values*/
 
 /** Invalid parameter **/
 #define FOSA_EINVAL   -1
 
+/** Not enough memory available **/
+#define FOSA_ENOMEM   -2
+
 /** Still pending information **/
 #define FOSA_EAGAIN   -3
 
-/** FOSA ADS errors **/
-#define FOSA_EREJECT   -4
-#define FOSA_EMASKED   -5
-
 /** Mutex not available **/
-#define FOSA_EBUSY        -6
+#define FOSA_EBUSY        -4
 
 /** Cond var timedout **/
-#define FOSA_ETIMEDOUT -7
+#define FOSA_ETIMEDOUT -5
+
+/** FOSA ADS errors **/
+#define FOSA_EREJECT   -6
+#define FOSA_EMASKED   -7
+
 
 /** Sched policy not correct */
 #define FOSA_EPOLICY   -8
@@ -196,6 +207,9 @@ typedef pthread_mutex_t FOSA_MUTEX_T_OPAQUE;
 /** the value given by thread_id is not valid for ADS */
 #define FOSA_ESRCH             -9
 
+/** retval if no action performed **/
+#define FOSA_NO_ACTION 0
+
 #endif /* VIRTUAL_TIME */
 //////////////////////////End of VIRTUAL TIME ///////////////////////////////////