]> rtime.felk.cvut.cz Git - frescor/fosa.git/blobdiff - include/fosa_types.h
Fixing license header
[frescor/fosa.git] / include / fosa_types.h
index 0b86a56fd34800b3ad33337606546fd5d61abd7b..0ebbe0e73f2cfd3f2aa8a3be82e9e9347e098d61 100644 (file)
@@ -1,11 +1,11 @@
-//----------------------------------------------------------------------
-//  Copyright (C) 2006 - 2007 by the FRESCOR consortium:
+// -----------------------------------------------------------------------
+//  Copyright (C) 2006 - 2008 FRESCOR consortium partners:
 //
 //    Universidad de Cantabria,              SPAIN
 //    University of York,                    UK
 //    Scuola Superiore Sant'Anna,            ITALY
 //    Kaiserslautern University,             GERMANY
-//    Univ. Politecnica  Valencia,           SPAIN
+//    Univ. Politécnica  Valencia,           SPAIN
 //    Czech Technical University in Prague,  CZECH REPUBLIC
 //    ENEA                                   SWEDEN
 //    Thales Communication S.A.              FRANCE
@@ -13,9 +13,9 @@
 //    Rapita Systems Ltd                     UK
 //    Evidence                               ITALY
 //
-//    See http://www.frescor.org
+//    See http://www.frescor.org for a link to partners' websites
 //
-//        The FRESCOR project (FP6/2005/IST/5-034026) is funded
+//           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.
 //                       Universidad de Cantabria, SPAIN
 //                       University of York, UK
 //
-// This file is part of FOSA (Frsh Operating System Abstraction)
+//   FSF API web pages: http://marte.unican.es/fsf/docs
+//                      http://shark.sssup.it/contrib/first/docs/
+//
+//   This file is part of FOSA (Frsh Operating System Adaption)
 //
-// FOSA is free software; you can redistribute it and/or modify it
-// under terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option) any
-// later version.  FOSA 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 along with FOSA; see file
-// COPYING. If not, write to the Free Software Foundation, 675 Mass Ave,
-// Cambridge, MA 02139, USA.
+//  FOSA is free software; you can redistribute it and/or modify it
+//  under terms of the GNU General Public License as published by the
+//  Free Software Foundation; either version 2, or (at your option) any
+//  later version.  FOSA 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 along with FOSA; see file
+//  COPYING. If not, write to the Free Software Foundation, 675 Mass Ave,
+//  Cambridge, MA 02139, USA.
 //
-// As a special exception, including FOSA header files in a file,
-// instantiating FOSA generics or templates, or linking other files
-// with FOSA objects to produce an executable application, does not
-// by itself cause the resulting executable application 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 Public License.
+//  As a special exception, including FOSA header files in a file,
+//  instantiating FOSA generics or templates, or linking other files
+//  with FOSA objects to produce an executable application, does not
+//  by itself cause the resulting executable application 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 Public License.
 // -----------------------------------------------------------------------
 //fosa_types.h
 //==============================================
 #define        _FOSA_TYPES_H_
 
 #include "fosa_opaque_types.h"
-#include "frsh_fosa.h"
+
+FOSA_CPP_BEGIN_DECLS
+
+/**
+ * @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
  *
  **/  
 // identifier of a clock
 // either a real-time clock or a cpu-time clock
+
+typedef FOSA_REL_TIME_T_OPAQUE fosa_rel_time_t;
+typedef FOSA_ABS_TIME_T_OPAQUE fosa_abs_time_t;
+
 typedef    FOSA_CLOCK_ID_T_OPAQUE    fosa_clock_id_t;
 
 #define FOSA_SYSTEM_CLOCK   FOSA_SYSTEM_CLOCK_OPAQUE
@@ -91,6 +140,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;
 /*@}*/
 
@@ -208,13 +260,15 @@ typedef int fosa_ads_urgency_t;
  *
  * - The \b thread_block() primitive operation is invoked by the system
  *   when a thread attached to this scheduler has blocked.
- *
- * - The \b change_sched_param_thread() primitive operation is invoked by
- *   the system when the scheduling parameters of a thread attached to
- *   this scheduler have been changed, but the thread continues to run
- *   under this scheduler. The change includes either the regular
- *   scheduling parameters (fosa_thread_set_prio() or the application-
- *   defined scheduling parameters, via fosa_ads_set_appsched_param(). 
+ * 
+ * - The \b change_sched_param_thread() primitive operation is invoked
+ *   by the system when the scheduling parameters of a thread attached
+ *   to this scheduler have been changed OUTSIDE OF AN SCHEDULER
+ *   CALLBACK, and the thread continues to run under this scheduler.
+ *   .
+ *   The change includes either the regular scheduling parameters
+ *   (fosa_thread_set_prio() or the application-defined scheduling
+ *   parameters, via fosa_ads_set_appsched_param(). 
  *
  * - The \b explicit_call_with_data() primitive operation is invoked by the
  *   system when a thread (identified by the thread parameter) has
@@ -275,70 +329,70 @@ 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);
+            fosa_abs_time_t *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);
+            fosa_abs_time_t *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);
+            fosa_abs_time_t *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);
+            fosa_abs_time_t *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);
+  //          fosa_abs_time_t *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);
+            fosa_abs_time_t *current_time);
   //void msg_from_scheduler(void * sched_data,
   //          fosa_ads_scheduler_id_t scheduler_id,
   //          const void * msg, size_t msg_size,
   //          fosa_ads_actions_t * actions,
-  //          struct timespec *current_time);
+  //          fosa_bas_time_t *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);
+  //         fosa_abs_time_t *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);
+           fosa_abs_time_t *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);
+           fosa_abs_time_t *current_time);
   void (*timeout) (void * sched_data,
            fosa_ads_actions_t * actions,
-           struct timespec *current_time);
+           fosa_abs_time_t *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);
+           fosa_abs_time_t *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);
+  //         fosa_abs_time_t *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);
+  //         fosa_abs_time_t *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;
@@ -346,4 +400,20 @@ typedef struct {
 
 /*@}*/
 
+/*********************
+ *   LONG JUMPS
+ *********************/
+
+/**
+ * The fosa_jump_context_t type defines a data area where the context
+ * of a thread can be saved, so that a long jump to recover that context
+ * may be executed in the future, from a long jump handler.
+ */
+
+typedef     FOSA_LONG_JUMP_CONTEXT_T_OPAQUE    fosa_long_jump_context_t; 
+
+
+FOSA_CPP_END_DECLS
+
+
 #endif // _FOSA_TYPES_H_