Classes | Macros | Typedefs | Functions | Variables
gnulinux/fosi.h File Reference
#include <stdio.h>
#include <semaphore.h>
#include <pthread.h>
#include <errno.h>
#include <string.h>
#include <limits.h>
#include <float.h>
#include <assert.h>
#include "../oro_limits.h"
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
Include dependency graph for gnulinux/fosi.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  RTOS_TASK
 

Macros

#define _XOPEN_SOURCE   600
 
#define HAVE_FOSI_API
 
#define ORO_SCHED_OTHER   SCHED_OTHER /** Linux normal scheduler */
 
#define ORO_SCHED_RT   SCHED_FIFO /** Linux FIFO scheduler */
 
#define ORO_WAIT_ABS
 
#define ORO_WAIT_REL
 
#define rtos_printf   printf
 

Typedefs

typedef long long NANO_TIME
 
typedef pthread_cond_t rt_cond_t
 
typedef pthread_mutex_t rt_mutex_t
 
typedef pthread_mutex_t rt_rec_mutex_t
 
typedef sem_t rt_sem_t
 
typedef long long TICK_TIME
 
typedef struct timespec TIME_SPEC
 

Functions

static long long nano2ticks (long long nano)
 
static int rtos_cond_broadcast (rt_cond_t *cond)
 
static int rtos_cond_destroy (rt_cond_t *cond)
 
static int rtos_cond_init (rt_cond_t *cond)
 
static int rtos_cond_timedwait (rt_cond_t *cond, rt_mutex_t *mutex, NANO_TIME abs_time)
 
static int rtos_cond_wait (rt_cond_t *cond, rt_mutex_t *mutex)
 
static void rtos_disable_rt_warning (void)
 
static void rtos_enable_rt_warning (void)
 
static NANO_TIME rtos_get_realtime_ns (void)
 
static NANO_TIME rtos_get_time_ns (void)
 
static NANO_TIME rtos_get_time_ticks (void)
 
static int rtos_mutex_destroy (rt_mutex_t *m)
 
static int rtos_mutex_init (rt_mutex_t *m)
 
static int rtos_mutex_lock (rt_mutex_t *m)
 
static int rtos_mutex_lock_until (rt_mutex_t *m, NANO_TIME abs_time)
 
static int rtos_mutex_rec_destroy (rt_rec_mutex_t *m)
 
static int rtos_mutex_rec_init (rt_rec_mutex_t *m)
 
static int rtos_mutex_rec_lock (rt_rec_mutex_t *m)
 
static int rtos_mutex_rec_lock_until (rt_rec_mutex_t *m, NANO_TIME abs_time)
 
static int rtos_mutex_rec_trylock (rt_rec_mutex_t *m)
 
static int rtos_mutex_rec_trylock_for (rt_rec_mutex_t *m, NANO_TIME relative_time)
 
static int rtos_mutex_rec_unlock (rt_rec_mutex_t *m)
 
static int rtos_mutex_trylock (rt_mutex_t *m)
 
static int rtos_mutex_trylock_for (rt_mutex_t *m, NANO_TIME relative_time)
 
static int rtos_mutex_unlock (rt_mutex_t *m)
 
static int rtos_nanosleep (const TIME_SPEC *rqtp, TIME_SPEC *rmtp)
 
static int rtos_sem_destroy (rt_sem_t *m)
 
static int rtos_sem_init (rt_sem_t *m, int value)
 
static int rtos_sem_signal (rt_sem_t *m)
 
static int rtos_sem_trywait (rt_sem_t *m)
 
static int rtos_sem_value (rt_sem_t *m)
 
static int rtos_sem_wait (rt_sem_t *m)
 
static long long ticks2nano (long long count)
 
static TIME_SPEC ticks2timespec (TICK_TIME hrt)
 

Variables

static const NANO_TIME InfiniteNSecs = LLONG_MAX
 
static const double InfiniteSeconds = DBL_MAX
 
static const TICK_TIME InfiniteTicks = LLONG_MAX
 

Macro Definition Documentation

#define _XOPEN_SOURCE   600

Definition at line 57 of file gnulinux/fosi.h.

#define HAVE_FOSI_API

This file translates the FOSI (Framework Operating System Interface) from orocos calls to native RTOS calls

TODO : split in multiple files

Definition at line 49 of file gnulinux/fosi.h.

#define ORO_SCHED_OTHER   SCHED_OTHER /** Linux normal scheduler */

Definition at line 106 of file gnulinux/fosi.h.

#define ORO_SCHED_RT   SCHED_FIFO /** Linux FIFO scheduler */

Definition at line 105 of file gnulinux/fosi.h.

#define ORO_WAIT_ABS
Value:
0

Definition at line 85 of file gnulinux/fosi.h.

#define ORO_WAIT_REL
Value:
1

Definition at line 87 of file gnulinux/fosi.h.

#define rtos_printf   printf

Definition at line 357 of file gnulinux/fosi.h.

Typedef Documentation

typedef long long NANO_TIME

Definition at line 76 of file gnulinux/fosi.h.

typedef pthread_cond_t rt_cond_t

Definition at line 315 of file gnulinux/fosi.h.

typedef pthread_mutex_t rt_mutex_t

Definition at line 203 of file gnulinux/fosi.h.

typedef pthread_mutex_t rt_rec_mutex_t

Definition at line 204 of file gnulinux/fosi.h.

typedef sem_t rt_sem_t

Definition at line 166 of file gnulinux/fosi.h.

typedef long long TICK_TIME

Definition at line 77 of file gnulinux/fosi.h.

typedef struct timespec TIME_SPEC

Definition at line 78 of file gnulinux/fosi.h.

Function Documentation

static long long nano2ticks ( long long  nano)
inlinestatic

No conversions are needed in userspace. The HBGenerator needs this for accurate timekeeping, which is an anachronism in userspace.

Definition at line 155 of file gnulinux/fosi.h.

static int rtos_cond_broadcast ( rt_cond_t cond)
inlinestatic

Definition at line 352 of file gnulinux/fosi.h.

static int rtos_cond_destroy ( rt_cond_t cond)
inlinestatic

Definition at line 336 of file gnulinux/fosi.h.

static int rtos_cond_init ( rt_cond_t cond)
inlinestatic

Definition at line 317 of file gnulinux/fosi.h.

static int rtos_cond_timedwait ( rt_cond_t cond,
rt_mutex_t mutex,
NANO_TIME  abs_time 
)
inlinestatic

Definition at line 346 of file gnulinux/fosi.h.

static int rtos_cond_wait ( rt_cond_t cond,
rt_mutex_t mutex 
)
inlinestatic

Definition at line 341 of file gnulinux/fosi.h.

static void rtos_disable_rt_warning ( void  )
inlinestatic

Definition at line 311 of file gnulinux/fosi.h.

static void rtos_enable_rt_warning ( void  )
inlinestatic

Definition at line 307 of file gnulinux/fosi.h.

static NANO_TIME rtos_get_realtime_ns ( void  )
inlinestatic

Definition at line 127 of file gnulinux/fosi.h.

static NANO_TIME rtos_get_time_ns ( void  )
inlinestatic

Definition at line 119 of file gnulinux/fosi.h.

static NANO_TIME rtos_get_time_ticks ( void  )
inlinestatic

This function should return ticks, but we use ticks == nsecs in userspace

Definition at line 138 of file gnulinux/fosi.h.

static int rtos_mutex_destroy ( rt_mutex_t m)
inlinestatic

Definition at line 211 of file gnulinux/fosi.h.

static int rtos_mutex_init ( rt_mutex_t m)
inlinestatic

Definition at line 206 of file gnulinux/fosi.h.

static int rtos_mutex_lock ( rt_mutex_t m)
inlinestatic

Definition at line 237 of file gnulinux/fosi.h.

static int rtos_mutex_lock_until ( rt_mutex_t m,
NANO_TIME  abs_time 
)
inlinestatic

Definition at line 267 of file gnulinux/fosi.h.

static int rtos_mutex_rec_destroy ( rt_rec_mutex_t m)
inlinestatic

Definition at line 232 of file gnulinux/fosi.h.

static int rtos_mutex_rec_init ( rt_rec_mutex_t m)
inlinestatic

Definition at line 216 of file gnulinux/fosi.h.

static int rtos_mutex_rec_lock ( rt_rec_mutex_t m)
inlinestatic

Definition at line 242 of file gnulinux/fosi.h.

static int rtos_mutex_rec_lock_until ( rt_rec_mutex_t m,
NANO_TIME  abs_time 
)
inlinestatic

Definition at line 277 of file gnulinux/fosi.h.

static int rtos_mutex_rec_trylock ( rt_rec_mutex_t m)
inlinestatic

Definition at line 292 of file gnulinux/fosi.h.

static int rtos_mutex_rec_trylock_for ( rt_rec_mutex_t m,
NANO_TIME  relative_time 
)
inlinestatic

Definition at line 257 of file gnulinux/fosi.h.

static int rtos_mutex_rec_unlock ( rt_rec_mutex_t m)
inlinestatic

Definition at line 302 of file gnulinux/fosi.h.

static int rtos_mutex_trylock ( rt_mutex_t m)
inlinestatic

Definition at line 287 of file gnulinux/fosi.h.

static int rtos_mutex_trylock_for ( rt_mutex_t m,
NANO_TIME  relative_time 
)
inlinestatic

Definition at line 247 of file gnulinux/fosi.h.

static int rtos_mutex_unlock ( rt_mutex_t m)
inlinestatic

Definition at line 297 of file gnulinux/fosi.h.

static int rtos_nanosleep ( const TIME_SPEC rqtp,
TIME_SPEC rmtp 
)
inlinestatic

Definition at line 143 of file gnulinux/fosi.h.

static int rtos_sem_destroy ( rt_sem_t m)
inlinestatic

Definition at line 173 of file gnulinux/fosi.h.

static int rtos_sem_init ( rt_sem_t m,
int  value 
)
inlinestatic

Definition at line 168 of file gnulinux/fosi.h.

static int rtos_sem_signal ( rt_sem_t m)
inlinestatic

Definition at line 178 of file gnulinux/fosi.h.

static int rtos_sem_trywait ( rt_sem_t m)
inlinestatic

Definition at line 188 of file gnulinux/fosi.h.

static int rtos_sem_value ( rt_sem_t m)
inlinestatic

Definition at line 193 of file gnulinux/fosi.h.

static int rtos_sem_wait ( rt_sem_t m)
inlinestatic

Definition at line 183 of file gnulinux/fosi.h.

static long long ticks2nano ( long long  count)
inlinestatic

Definition at line 161 of file gnulinux/fosi.h.

static TIME_SPEC ticks2timespec ( TICK_TIME  hrt)
inlinestatic

Definition at line 111 of file gnulinux/fosi.h.

Variable Documentation

const NANO_TIME InfiniteNSecs = LLONG_MAX
static

Definition at line 82 of file gnulinux/fosi.h.

const double InfiniteSeconds = DBL_MAX
static

Definition at line 83 of file gnulinux/fosi.h.

const TICK_TIME InfiniteTicks = LLONG_MAX
static

Definition at line 81 of file gnulinux/fosi.h.



rtt
Author(s): RTT Developers
autogenerated on Fri Oct 25 2019 03:59:45