fosi_interface.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00047 #ifndef ORO_FOSI_INTERFACE_H
00048 #define ORO_FOSI_INTERFACE_H
00049
00050 #error "This file is a template for developers, do not include directly."
00051
00052 #ifdef __cplusplus
00053 extern "C"
00054 {
00055 #endif
00056
00057 struct MyTask;
00058 typedef struct MyTask RTOS_TASK;
00059
00060
00061
00062 #include "oro_atomic.h"
00063
00064 #define ORO_SCHED_RT 0
00065 #define ORO_SCHED_OTHER 1
00070 typedef long long NANO_TIME;
00071
00074 typedef long long TICK_TIME;
00075
00079 NANO_TIME rtos_get_time_ns( void );
00080
00085 TICK_TIME rtos_get_time_ticks (void );
00086
00090 TICK_TIME nano2ticks( NANO_TIME nano );
00094 NANO_TIME ticks2nano( TICK_TIME count );
00095
00096
00097 typedef struct sem_struct rt_sem_t;
00101 int rtos_sem_init(rt_sem_t* m, int value );
00102 int rtos_sem_destroy(rt_sem_t* m );
00103 int rtos_sem_signal(rt_sem_t* m );
00104 int rtos_sem_wait(rt_sem_t* m );
00105 int rtos_sem_trywait(rt_sem_t* m );
00106 int rtos_sem_wait_timed(rt_sem_t* m, NANO_TIME delay );
00107 int rtos_sem_wait_until(rt_sem_t* m, NANO_TIME abs_time );
00108 int rtos_sem_value(rt_sem_t* m );
00109
00110
00111 typedef struct mutex_struct rt_mutex_t;
00112 typedef struct recursive_mutex_struct rt_rec_mutex_t;
00113
00114 int rtos_mutex_init(rt_mutex_t* m);
00115 int rtos_mutex_destroy(rt_mutex_t* m );
00116 int rtos_mutex_rec_init(rt_rec_mutex_t* m);
00117 int rtos_mutex_rec_destroy(rt_rec_mutex_t* m );
00118 int rtos_mutex_lock( rt_mutex_t* m);
00119 int rtos_mutex_trylock( rt_mutex_t* m);
00120 int rtos_mutex_lock_until( rt_rec_mutex_t* m, NANO_TIME abs_time);
00121 int rtos_mutex_unlock( rt_mutex_t* m);
00122 int rtos_mutex_rec_lock( rt_rec_mutex_t* m);
00123 int rtos_mutex_rec_trylock( rt_rec_mutex_t* m);
00124 int rtos_mutex_rec_lock_until( rt_rec_mutex_t* m, NANO_TIME abs_time);
00125 int rtos_mutex_rec_unlock( rt_rec_mutex_t* m);
00126
00130 int rtos_printf( const char *fmt, ... );
00131
00133 void rtos_enable_rt_warning();
00135 void rtos_disable_rt_warning();
00136
00137 #ifdef __cplusplus
00138 }
00139 #endif
00140
00141 #endif // ORO_FOSI_INTERFACE_H