Orocos Real-Time Toolkit  2.9.0
Classes | Macros | Typedefs | Functions | Variables
fosi.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <limits.h>
#include <float.h>
#include <assert.h>
#include "../oro_limits.h"
#include "../../rtt-config.h"
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#include "dlfcn.h"

Go to the source code of this file.

Classes

struct  RTOS_TASK
 
struct  oro_timespec
 
struct  rt_cond_t
 

Macros

#define HAVE_FOSI_API
 This file translates the FOSI (Framework Operating System Interface) from orocos calls to native RTOS calls. More...
 
#define ORO_WAIT_ABS
 
#define ORO_WAIT_REL
 
#define ORO_SCHED_RT   0 /** Linux FIFO scheduler */
 
#define ORO_SCHED_OTHER   1 /** Linux normal scheduler */
 
#define rtos_printf   printf
 

Typedefs

typedef long long NANO_TIME
 
typedef long long TICK_TIME
 
typedef struct oro_timespec TIME_SPEC
 
typedef HANDLE rt_sem_t
 
typedef CRITICAL_SECTION rt_mutex_t
 
typedef CRITICAL_SECTION rt_rec_mutex_t
 

Functions

RTT_API unsigned int sleep (unsigned int seconds)
 
RTT_API int usleep (unsigned int us)
 
TIME_SPEC ticks2timespec (TICK_TIME hrt)
 
NANO_TIME rtos_get_time_ns (void)
 Get "system" time in nanoseconds. More...
 
TICK_TIME rtos_get_time_ticks ()
 This function should return ticks, but we use ticks == nsecs in userspace. More...
 
int win32_nanosleep (long long nano)
 
int rtos_nanosleep (const TIME_SPEC *rqtp, TIME_SPEC *rmtp)
 
long long nano2ticks (long long nano)
 No conversions are needed in userspace. More...
 
long long ticks2nano (long long count)
 
int setenv (const char *name, const char *value, int overwrite)
 

Variables

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

Macro Definition Documentation

#define HAVE_FOSI_API

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

Definition at line 28 of file fosi.h.

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

Definition at line 100 of file fosi.h.

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

Definition at line 99 of file fosi.h.

#define ORO_WAIT_ABS
Value:
0

Definition at line 81 of file fosi.h.

#define ORO_WAIT_REL
Value:
1

Definition at line 83 of file fosi.h.

#define rtos_printf   printf

Definition at line 423 of file fosi.h.

Typedef Documentation

typedef long long NANO_TIME

Definition at line 73 of file fosi.h.

typedef CRITICAL_SECTION rt_mutex_t

Definition at line 231 of file fosi.h.

typedef CRITICAL_SECTION rt_rec_mutex_t

Definition at line 232 of file fosi.h.

typedef HANDLE rt_sem_t

Definition at line 173 of file fosi.h.

typedef long long TICK_TIME

Definition at line 74 of file fosi.h.

typedef struct oro_timespec TIME_SPEC

Definition at line 108 of file fosi.h.

Function Documentation

long long nano2ticks ( long long  nano)
inline

No conversions are needed in userspace.

Time conversions from nano seconds to system ticks.

The HBGenerator needs this for accurate timekeeping, which is an anachronism in userspace.

Definition at line 160 of file fosi.h.

NANO_TIME rtos_get_time_ns ( void  )
inline

Get "system" time in nanoseconds.

Definition at line 120 of file fosi.h.

References ticks2nano().

TICK_TIME rtos_get_time_ticks ( void  )
inline

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

Get "system" time in ticks FIXME see https://proj.fmtc.be/orocos-bugzilla/show_bug.cgi?id=60

Definition at line 134 of file fosi.h.

References rtos_get_time_ns().

int rtos_nanosleep ( const TIME_SPEC rqtp,
TIME_SPEC rmtp 
)
inline

Definition at line 149 of file fosi.h.

References win32_nanosleep().

int setenv ( const char *  name,
const char *  value,
int  overwrite 
)

Definition at line 64 of file fosi.cpp.

RTT_API unsigned int sleep ( unsigned int  seconds)

Definition at line 51 of file fosi.cpp.

long long ticks2nano ( long long  count)
inline

Definition at line 166 of file fosi.h.

TIME_SPEC ticks2timespec ( TICK_TIME  hrt)
inline

Definition at line 112 of file fosi.h.

RTT_API int usleep ( unsigned int  us)

Definition at line 58 of file fosi.cpp.

References win32_nanosleep().

Referenced by RTT::os::rtai_thread_wrapper().

int win32_nanosleep ( long long  nano)
inline

Definition at line 139 of file fosi.h.

References rtos_get_time_ns().

Referenced by rtos_nanosleep(), and usleep().

Variable Documentation

const NANO_TIME InfiniteNSecs = LLONG_MAX

Definition at line 78 of file fosi.h.

const double InfiniteSeconds = DBL_MAX

Definition at line 79 of file fosi.h.

const TICK_TIME InfiniteTicks = LLONG_MAX

Definition at line 77 of file fosi.h.