]> rtime.felk.cvut.cz Git - frescor/fosa.git/blobdiff - include/fosa_types.h
Migrating FOSA trunk to d-ac2v2. Phase 1 moving FRSH-FOSA to FOSA
[frescor/fosa.git] / include / fosa_types.h
index 67dfdc54e029a65fd650d966670baa68eef39fdf..d46651a10055ef4f60ebbe49a506409f2b354f66 100644 (file)
 #define        _FOSA_TYPES_H_
 
 #include "fosa_opaque_types.h"
-#include "frsh_fosa.h"
+/**
+ * @addtogroup threadandsignals
+ *
+ * @{
+ **/  
+
+/* Coming from FRSH-FOSA */
+
+/** identifier of a FOSA thread **/
+typedef FOSA_THREAD_ID_T_OPAQUE fosa_thread_id_t;
+
+
+/** thread attributes object **/
+typedef FOSA_THREAD_ATTR_T_OPAQUE fosa_thread_attr_t;
+
+typedef FOSA_SIGNAL_T_OPAQUE fosa_signal_t;
+
+/** 
+ *  The type references a function that may become a thread's
+ *  code
+ **/
+typedef void * (*fosa_thread_code_t) (void *);
+
+
+/** information associated to a signal **/
+#if defined(VIRTUAL_TIME)
+
+#include <vt_ose.h>
+typedef vt_posix_signal_info_t fosa_signal_info_t;
+
+#else
+
+typedef union {int sival_int; void * sival_ptr; } fosa_signal_info_t;
+/* typedef FOSA_SIGNAL_INFO_T_OPAQUE fosa_signal_info_t; */
+
+#endif
+
+/* @} */
+
+
 /**
  * @addtogroup clocksandtimers
  *
@@ -91,6 +130,9 @@ typedef    FOSA_TIMER_ID_T_OPAQUE    fosa_timer_id_t;
  * @{
  **/
 // a condition variable
+/** Mutex object.  Attributes are handled by FOSA **/
+typedef    FOSA_MUTEX_T_OPAQUE       fosa_mutex_t;
+
 typedef    FOSA_COND_T_OPAQUE        fosa_cond_t;
 /*@}*/
 
@@ -277,27 +319,27 @@ typedef int fosa_ads_urgency_t;
 typedef struct {
    void (*init) (void * sched_data, void * arg);
    void (*new_thread) (void * sched_data,
-            frsh_thread_id_t thread,
+            fosa_thread_id_t thread,
             fosa_ads_actions_t * actions,
             struct timespec *current_time);
    void (*thread_terminate) (void * sched_data,
-            frsh_thread_id_t thread,
+            fosa_thread_id_t thread,
             fosa_ads_actions_t * actions,
             struct timespec *current_time);
    void (*thread_ready) (void * sched_data,
-            frsh_thread_id_t thread,
+            fosa_thread_id_t thread,
             fosa_ads_actions_t * actions,
             struct timespec *current_time);
    void (*thread_block) (void * sched_data,
-            frsh_thread_id_t thread,
+            fosa_thread_id_t thread,
             fosa_ads_actions_t * actions,
             struct timespec *current_time);
   //void (*thread_yield) (void * sched_data,
-  //          frsh_thread_id_t thread,
+  //          fosa_thread_id_t thread,
   //          fosa_ads_actions_t * actions,
   //          struct timespec *current_time);
    void (*change_sched_param_thread) (void * sched_data,
-            frsh_thread_id_t thread,
+            fosa_thread_id_t thread,
             fosa_ads_actions_t * actions,
             struct timespec *current_time);
   //void msg_from_scheduler(void * sched_data,
@@ -306,18 +348,18 @@ typedef struct {
   //          fosa_ads_actions_t * actions,
   //          struct timespec *current_time);
   //void (*explicit_call) (void * sched_data,
-  //          frsh_thread_id_t thread,
+  //          fosa_thread_id_t thread,
   //         int user_event_code,
   //         fosa_ads_actions_t * actions,
   //         struct timespec *current_time);
   void (*explicit_call_with_data) (void * sched_data,
-           frsh_thread_id_t thread,
+           fosa_thread_id_t thread,
            const void * msg, size_t msg_size,
            void *reply, size_t *reply_size,
            fosa_ads_actions_t * actions,
            struct timespec *current_time);
   void (*notification_for_thread) (void * sched_data,
-           frsh_thread_id_t thread,
+           fosa_thread_id_t thread,
            fosa_clock_id_t clock,
            fosa_ads_actions_t * actions,
            struct timespec *current_time);
@@ -325,22 +367,22 @@ typedef struct {
            fosa_ads_actions_t * actions,
            struct timespec *current_time);
   void (*signal) (void * sched_data,
-          frsh_signal_t signal,
-           frsh_signal_info_t siginfo,
+          fosa_signal_t signal,
+           fosa_signal_info_t siginfo,
            fosa_ads_actions_t * actions,
            struct timespec *current_time);
   //void (*priority_inherit) (void * sched_data,
-  //         frsh_thread_id_t thread,
+  //         fosa_thread_id_t thread,
   //         int sched_priority,
   //         fosa_ads_actions_t * actions,
   //         struct timespec *current_time);
   //void (*priority_uninherit) (void * sched_data,
-  //         frsh_thread_id_t thread,
+  //         fosa_thread_id_t thread,
   //         int sched_priority,
   //         fosa_ads_actions_t * actions,
   //         struct timespec *current_time);
   void (*appsched_error) (void * sched_data,
-          frsh_thread_id_t thread,
+          fosa_thread_id_t thread,
           fosa_ads_error_cause_t cause,
            fosa_ads_actions_t * actions);
 } fosa_ads_scheduler_ops_t;