]> rtime.felk.cvut.cz Git - frescor/frsh-include.git/blobdiff - frsh_fosa.h
endpoint is passed by value now, created frsh_distributed_init
[frescor/frsh-include.git] / frsh_fosa.h
index 5afa85f23f047c5628416a55ca4fc25a9524dd7c..cf66db0019e6a1c097012444109e386ecdb655b0 100644 (file)
 #ifndef        FRSH_FOSA_H_
 #define        FRSH_FOSA_H_
 
+#include <stdlib.h> /* For size_t */
 #include "frsh_fosa_opaque.h"
 
+/**
+ * @file frsh_fosa.h
+ **/
+
+
 /**
  * @defgroup frshfosa FRSH FOSA public interfaces
  *
@@ -77,6 +83,8 @@
  *         -DRT_LINUX
  *         -DOSE
  *         -DMARTE_OS
+ *         -DAQuoSA
+ *                -DVIRTUAL_TIME
  *
  * This module contains the FOSA part exposed by the FRSH_API and
  * visible for the application.
  * @{
  **/
 
+/**
+ * Bool as a byte value (char)
+ *
+ * We will revisit this if we have a problem with bool in C++
+ **/
 
 
 /** identifier of a frsh thread **/
@@ -99,6 +112,13 @@ typedef FOSA_THREAD_ID_T_OPAQUE frsh_thread_id_t;
 /** thread attributes object **/
 typedef FOSA_THREAD_ATTR_T_OPAQUE frsh_thread_attr_t;
 
+/** 
+ *  The type references a function that may become a thread's
+ *  code
+ **/
+typedef void * (*frsh_thread_code_t) (void *);
+
+
 /** signal number; it is an integer type **/
 typedef FOSA_SIGNAL_T_OPAQUE frsh_signal_t;
 #define FRSH_NULL_SIGNAL       FOSA_NULL_SIGNAL
@@ -107,8 +127,23 @@ typedef FOSA_SIGNAL_T_OPAQUE frsh_signal_t;
 #define FRSH_SIGNAL_MIN       FOSA_SIGNAL_MIN
 #define FRSH_SIGNAL_MAX       FOSA_SIGNAL_MAX
 
+
+
 /** information associated to a signal **/
-typedef union {int value; void * area; } frsh_signal_info_t;
+#if defined(VIRTUAL_TIME)
+
+#include <vt_ose.h>
+typedef vt_posix_signal_info_t frsh_signal_info_t;
+
+#else
+
+typedef union {int sival_int; void * sival_ptr; } frsh_signal_info_t;
+/* typedef FRSH_SIGNAL_INFO_T_OPAQUE frsh_signal_info_t; */
+
+#endif
+
+
+
 
 /** Mutex object.  Attributes are handled by FOSA **/
 typedef FOSA_MUTEX_T_OPAQUE frsh_mutex_t;
@@ -127,8 +162,8 @@ typedef FOSA_MUTEX_T_OPAQUE frsh_mutex_t;
  * This function initializes the object pointed to by attr to all 
  * the default values defined by FRSH
  *
- * Returns 0 if successful; otherwise it returns
- *   ENOMEM: insufficient memory exists to initialize the thread 
+ * @return 0 if successful; otherwise it returns \n
+ *   FOSA_ENOMEM: insufficient memory exists to initialize the thread 
  *           attributes object
  **/
 int frsh_thread_attr_init(frsh_thread_attr_t *attr);
@@ -156,8 +191,8 @@ int frsh_thread_attr_destroy(frsh_thread_attr_t *attr);
  * attributes object is used to create a thread, when it will be
  * created with the specified minimum stack size
  * 
- * Returns 0 if successful, or the following error code:
- *    EINVAL: the specified stacksize  value is not supported in
+ * @return 0 if successful, or the following error code:
+ *    FOSA_EINVAL: the specified stacksize  value is not supported in
  *            this implementation
  */
 int frsh_thread_attr_set_stacksize(frsh_thread_attr_t *attr, size_t stacksize);
@@ -170,7 +205,7 @@ int frsh_thread_attr_set_stacksize(frsh_thread_attr_t *attr, size_t stacksize);
  * This function sets the variable pointed to by stacksize to the
  * minimum stack size stored in the thread attributes object attr.
  * 
- * Returns 0
+ * @return 0
  */
 int frsh_thread_attr_get_stacksize
       (const frsh_thread_attr_t *attr, size_t *stacksize);