]> rtime.felk.cvut.cz Git - frescor/fosa.git/blobdiff - include/fosa_opaque_types.h
move all the time related issues to FOSA absolute and relative data types.
[frescor/fosa.git] / include / fosa_opaque_types.h
index d6146c7de2ac67735cf9498a929180161a2a7af1..bf2ee76cb093b28bb7ef62a8c401837e3d85a795 100644 (file)
@@ -71,6 +71,7 @@
 #include <stdbool.h>
 
 #include "fosa_cpp_macros.h"
+#include "fosa_opaque_types_time.h"
 
 ///////////////////////  MARTE_OS /////////////////////////////
 
 
 FOSA_CPP_BEGIN_DECLS
 
-/* Time */
-/********/
-// typedef struct timespec fosa_rel_time_t;
-// typedef struct timespec fosa_abs_time_t;
 
 /* Thread and signals */
 /**********************/
@@ -117,16 +114,16 @@ typedef pthread_cond_t FOSA_COND_T_OPAQUE;
 
 /* Application defined Scheduling */
 /**********************************/
-typedef struct {
-    posix_appsched_actions_t actions;
-    struct timespec *timeout_ptr;
-    struct timespec timeout;
-    bool rejected;
-    bool suspended;
-    bool activated;
-} fosa_ads_actions_internal_t;
+#define FOSA_ADS_ACTIONS_T_OPAQUE  struct \
+{ \
+    posix_appsched_actions_t actions; \
+    struct timespec *timeout_ptr; \
+    struct timespec timeout; \
+    bool rejected; \
+    bool suspended; \
+    bool activated; \
+} 
 
-#define FOSA_ADS_ACTIONS_T_OPAQUE fosa_ads_actions_internal_t
 
 /* Local jump */
 /**************/
@@ -178,11 +175,6 @@ typedef struct {
 #include <errno.h>
 #include <rtl_timer.h>
 
-/* Time */
-/********/
-// typedef struct timespec fosa_rel_time_t;
-// typedef struct timespec fosa_abs_time_t;
-
 
 /* Threads and signals */
 /***********************/
@@ -235,10 +227,6 @@ typedef pthread_mutex_t FOSA_MUTEX_T_OPAQUE;
 
 #ifdef OSE
 
-/* Time */
-/********/
-// typedef struct timespec fosa_rel_time_t;
-// typedef struct timespec fosa_abs_time_t;
 
 
 /* Put OSE dependent includes and defines here */
@@ -251,9 +239,13 @@ typedef pthread_mutex_t FOSA_MUTEX_T_OPAQUE;
 
 #ifdef AQuoSA
 
-#define __USE_UNIX98
+#include <unistd.h>
+#include <linux/unistd.h>
 
+#define _XOPEN_SOURCE 500
+#define __USE_UNIX98
 #include <pthread.h>
+
 #include <signal.h>
 #include <errno.h>
 #include <time.h>
@@ -372,8 +364,10 @@ enum _fosa_clocks_e {
 };
 
 enum _fosa_signal_limits_e {
-  FOSA_SIGNAL_MIN = SIGRTMIN,
-  FOSA_SIGNAL_MAX = SIGRTMIN + 0,
+  LONGJMP_NSIG = 3,
+  LONGJMP_FIRSTSIG = SIGRTMAX - LONGJMP_NSIG + 1,
+  FOSA_SIGNAL_MAX = LONGJMP_FIRSTSIG - 1,
+  FOSA_SIGNAL_MIN = FOSA_SIGNAL_MAX,
 };
 
 enum _fosa_errors_e {