Classes | Defines | Typedefs | Functions | Variables
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

Defines

#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 ()
static void rtos_enable_rt_warning ()
static NANO_TIME rtos_get_time_ns (void)
static NANO_TIME rtos_get_time_ticks ()
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_mutex_t *m)
static int rtos_mutex_rec_init (rt_mutex_t *m)
static int rtos_mutex_rec_lock (rt_mutex_t *m)
static int rtos_mutex_rec_lock_until (rt_mutex_t *m, NANO_TIME abs_time)
static int rtos_mutex_rec_trylock (rt_mutex_t *m)
static int rtos_mutex_rec_unlock (rt_mutex_t *m)
static int rtos_mutex_trylock (rt_mutex_t *m)
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 int rtos_sem_wait_timed (rt_sem_t *m, NANO_TIME delay)
static int rtos_sem_wait_until (rt_sem_t *m, NANO_TIME abs_time)
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

Define Documentation

#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 30 of file gnulinux/fosi.h.

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

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

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

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

#define ORO_WAIT_ABS
Value:
0 

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

#define ORO_WAIT_REL
Value:
1 

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

#define rtos_printf   printf

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


Typedef Documentation

typedef long long NANO_TIME

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

typedef pthread_cond_t rt_cond_t

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

typedef pthread_mutex_t rt_mutex_t

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

typedef pthread_mutex_t rt_rec_mutex_t

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

typedef sem_t rt_sem_t

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

typedef long long TICK_TIME

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

typedef struct timespec TIME_SPEC

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


Function Documentation

static long long nano2ticks ( long long  nano) [inline, static]

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

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

static int rtos_cond_broadcast ( rt_cond_t cond) [inline, static]

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

static int rtos_cond_destroy ( rt_cond_t cond) [inline, static]

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

static int rtos_cond_init ( rt_cond_t cond) [inline, static]

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

static int rtos_cond_timedwait ( rt_cond_t cond,
rt_mutex_t mutex,
NANO_TIME  abs_time 
) [inline, static]

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

static int rtos_cond_wait ( rt_cond_t cond,
rt_mutex_t mutex 
) [inline, static]

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

static void rtos_disable_rt_warning ( ) [inline, static]

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

static void rtos_enable_rt_warning ( ) [inline, static]

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

static NANO_TIME rtos_get_time_ns ( void  ) [inline, static]

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

static NANO_TIME rtos_get_time_ticks ( void  ) [inline, static]

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

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

static int rtos_mutex_destroy ( rt_mutex_t m) [inline, static]

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

static int rtos_mutex_init ( rt_mutex_t m) [inline, static]

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

static int rtos_mutex_lock ( rt_mutex_t m) [inline, static]

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

static int rtos_mutex_lock_until ( rt_mutex_t m,
NANO_TIME  abs_time 
) [inline, static]

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

static int rtos_mutex_rec_destroy ( rt_mutex_t m) [inline, static]

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

static int rtos_mutex_rec_init ( rt_mutex_t m) [inline, static]

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

static int rtos_mutex_rec_lock ( rt_mutex_t m) [inline, static]

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

static int rtos_mutex_rec_lock_until ( rt_mutex_t m,
NANO_TIME  abs_time 
) [inline, static]

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

static int rtos_mutex_rec_trylock ( rt_mutex_t m) [inline, static]

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

static int rtos_mutex_rec_unlock ( rt_mutex_t m) [inline, static]

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

static int rtos_mutex_trylock ( rt_mutex_t m) [inline, static]

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

static int rtos_mutex_unlock ( rt_mutex_t m) [inline, static]

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

static int rtos_nanosleep ( const TIME_SPEC rqtp,
TIME_SPEC rmtp 
) [inline, static]

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

static int rtos_sem_destroy ( rt_sem_t m) [inline, static]

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

static int rtos_sem_init ( rt_sem_t m,
int  value 
) [inline, static]

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

static int rtos_sem_signal ( rt_sem_t m) [inline, static]

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

static int rtos_sem_trywait ( rt_sem_t m) [inline, static]

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

static int rtos_sem_value ( rt_sem_t m) [inline, static]

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

static int rtos_sem_wait ( rt_sem_t m) [inline, static]

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

static int rtos_sem_wait_timed ( rt_sem_t m,
NANO_TIME  delay 
) [inline, static]
Todo:
should really deal with errno=EINTR due to signal, and errno=ETIMEDOUT appropriately.

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

static int rtos_sem_wait_until ( rt_sem_t m,
NANO_TIME  abs_time 
) [inline, static]

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

static long long ticks2nano ( long long  count) [inline, static]

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

static TIME_SPEC ticks2timespec ( TICK_TIME  hrt) [inline, static]

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


Variable Documentation

const NANO_TIME InfiniteNSecs = LLONG_MAX [static]

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

const double InfiniteSeconds = DBL_MAX [static]

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

const TICK_TIME InfiniteTicks = LLONG_MAX [static]

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



rtt
Author(s): RTT Developers
autogenerated on Sat Jun 8 2019 18:46:34