40 #ifndef RTT_ECOS__FOSI_H 41 #define RTT_ECOS__FOSI_H 51 #include <cyg/kernel/kapi.h> 54 #include <pkgconf/kernel.h> 55 #include <cyg/infra/diag.h> 60 #define SCHED_ECOS_FIFO 0 61 #define ORO_SCHED_RT 0 62 #define ORO_SCHED_OTHER 0 64 #define ORO_WAIT_ABS 0 65 #define ORO_WAIT_REL 1 115 return (CYGNUM_HAL_RTC_DENOMINATOR*nano)/CYGNUM_HAL_RTC_NUMERATOR;
122 return CYGNUM_HAL_RTC_NUMERATOR/CYGNUM_HAL_RTC_DENOMINATOR*count;
132 return cyg_current_time();
147 cyg_semaphore_init(m, value);
153 cyg_semaphore_destroy(m);
159 cyg_semaphore_post(m);
165 cyg_semaphore_wait(m);
172 if (cyg_semaphore_trywait(m) ==
true)
182 if (cyg_semaphore_timed_wait(m,cyg_current_time()+
nano2ticks(delay)) ==
true)
191 cyg_semaphore_peek(m, &val);
209 cyg_mutex_release(m);
210 cyg_mutex_destroy(m);
228 return cyg_mutex_lock(m);
238 if (cyg_mutex_trylock(m) ==
true)
272 #define rtos_printf diag_printf
void cyg_recursive_mutex_init(cyg_recursive_mutex_t *mx)
Initialize recursive mutex.
const double InfiniteSeconds
static int rtos_mutex_rec_lock(rt_rec_mutex_t *m)
static int rtos_sem_trywait(rt_sem_t *m)
const TICK_TIME InfiniteTicks
static int rtos_sem_wait(rt_sem_t *m)
static int rtos_mutex_destroy(rt_mutex_t *m)
NANO_TIME rtos_get_time_ns(void)
static int rtos_sem_signal(rt_sem_t *m)
const NANO_TIME InfiniteNSecs
static int rtos_mutex_unlock(rt_mutex_t *m)
static int rtos_mutex_trylock(rt_mutex_t *m)
void cyg_recursive_mutex_destroy(cyg_recursive_mutex_t *mx)
Destroy.
cyg_tick_count_t TICK_TIME
bool cyg_recursive_mutex_trylock(cyg_recursive_mutex_t *mx)
Trylock.
bool cyg_recursive_mutex_lock(cyg_recursive_mutex_t *mx)
Lock recursive mutex.
static int rtos_mutex_rec_init(rt_rec_mutex_t *m)
static void rtos_disable_rt_warning()
static int rtos_mutex_rec_destroy(rt_rec_mutex_t *m)
TICK_TIME rtos_get_time_ticks(void)
void cyg_recursive_mutex_unlock(cyg_recursive_mutex_t *mx)
Unlock.
NANO_TIME ticks2nano(TICK_TIME count)
static int rtos_sem_destroy(rt_sem_t *m)
cyg_recursive_mutex_t rt_rec_mutex_t
TICK_TIME nano2ticks(NANO_TIME nano)
static int rtos_mutex_rec_unlock(rt_rec_mutex_t *m)
static int rtos_mutex_rec_trylock(rt_rec_mutex_t *m)
static int rtos_sem_value(rt_sem_t *m)
static int rtos_sem_wait_timed(rt_sem_t *m, NANO_TIME delay)
static int rtos_sem_init(rt_sem_t *m, int value)
static void rtos_enable_rt_warning()
struct timespec TIME_SPEC
static int rtos_mutex_init(rt_mutex_t *m)
static int rtos_mutex_lock(rt_mutex_t *m)