Orocos Real-Time Toolkit
2.8.3
|
This file defines the FOSI (Framework Operating System Interface) from orocos calls to native RTOS calls. More...
#include "oro_arch.h"
Go to the source code of this file.
Macros | |
#define | ORO_SCHED_RT 0 /** Hard real-time scheduler type. @see RTT::OS::ThreadInterface::setScheduler */ |
#define | ORO_SCHED_OTHER 1 /** Soft real-time scheduler type. @see RTT::OS::ThreadInterface::setScheduler */ |
Typedefs | |
typedef struct MyTask | RTOS_TASK |
typedef long long | NANO_TIME |
OS representation of nano seconds. More... | |
typedef long long | TICK_TIME |
OS representation of system ticks. More... | |
typedef struct sem_struct | rt_sem_t |
typedef struct mutex_struct | rt_mutex_t |
typedef struct recursive_mutex_struct | rt_rec_mutex_t |
typedef struct cond_struct | rt_cond_t |
This file defines the FOSI (Framework Operating System Interface) from orocos calls to native RTOS calls.
Rename to 'fosi.h'
Definition in file fosi_interface.h.
#define ORO_SCHED_OTHER 1 /** Soft real-time scheduler type. @see RTT::OS::ThreadInterface::setScheduler */ |
Definition at line 65 of file fosi_interface.h.
#define ORO_SCHED_RT 0 /** Hard real-time scheduler type. @see RTT::OS::ThreadInterface::setScheduler */ |
Definition at line 64 of file fosi_interface.h.
typedef long long NANO_TIME |
OS representation of nano seconds.
Definition at line 70 of file fosi_interface.h.
typedef struct cond_struct rt_cond_t |
Definition at line 128 of file fosi_interface.h.
typedef struct mutex_struct rt_mutex_t |
Definition at line 109 of file fosi_interface.h.
typedef struct recursive_mutex_struct rt_rec_mutex_t |
Definition at line 110 of file fosi_interface.h.
typedef struct sem_struct rt_sem_t |
Definition at line 97 of file fosi_interface.h.
typedef struct MyTask RTOS_TASK |
Definition at line 58 of file fosi_interface.h.
typedef long long TICK_TIME |
OS representation of system ticks.
Definition at line 74 of file fosi_interface.h.
|
inline |
Time conversions from nano seconds to system ticks.
Time conversions from nano seconds to system ticks.
The HBGenerator needs this for accurate timekeeping, which is an anachronism in userspace.
Definition at line 100 of file fosi.h.
Referenced by RTT::os::TimeService::nsecs2ticks(), rtos_printf(), RTT::os::rtos_task_get_scheduler(), RTT::os::rtos_task_make_periodic(), and RTT::os::rtos_task_wait_period().
int rtos_cond_broadcast | ( | rt_cond_t * | cond | ) |
Referenced by RTT::os::Condition::broadcast(), rtos_nanosleep(), and rtos_printf().
int rtos_cond_destroy | ( | rt_cond_t * | cond | ) |
Referenced by rtos_nanosleep(), rtos_printf(), and RTT::os::Condition::~Condition().
int rtos_cond_init | ( | rt_cond_t * | cond | ) |
Referenced by RTT::os::Condition::Condition(), rtos_nanosleep(), and rtos_printf().
int rtos_cond_timedwait | ( | rt_cond_t * | cond, |
rt_mutex_t * | mutex, | ||
NANO_TIME | abs_time | ||
) |
Referenced by rtos_nanosleep(), rtos_printf(), and RTT::os::Condition::wait_until().
int rtos_cond_wait | ( | rt_cond_t * | cond, |
rt_mutex_t * | mutex | ||
) |
Referenced by rtos_nanosleep(), rtos_printf(), and RTT::os::Condition::wait().
void rtos_disable_rt_warning | ( | ) |
Disallows the RTOS to print a warning when we violate real-time constraints.
Referenced by rtos_printf().
void rtos_enable_rt_warning | ( | ) |
Allows the RTOS to print a warning when we violate real-time constraints.
Referenced by rtos_printf().
|
inline |
Get "system" time in nanoseconds.
Definition at line 113 of file fosi.h.
References ticks2nano().
Referenced by RTT::os::Timer::arm(), RTT::os::TimeService::getNSecs(), RTT::os::Timer::loop(), rtos_get_time_ticks(), rtos_printf(), RTT::os::rtos_task_get_period(), RTT::os::rtos_task_get_scheduler(), RTT::os::rtos_task_wait_period(), RTT::os::Timer::startTimer(), RTT::os::ThreadWrapper(), RTT::os::Timer::timeRemaining(), and win32_nanosleep().
|
inline |
Get "system" time in ticks FIXME see https://proj.fmtc.be/orocos-bugzilla/show_bug.cgi?id=60
Get "system" time in ticks FIXME see https://proj.fmtc.be/orocos-bugzilla/show_bug.cgi?id=60
Definition at line 118 of file fosi.h.
References rtos_get_time_ns().
Referenced by RTT::os::TimeService::enableSystemClock(), RTT::os::TimeService::getTicks(), rtos_printf(), and RTT::os::rtos_task_make_periodic().
int rtos_mutex_destroy | ( | rt_mutex_t * | m | ) |
Definition at line 305 of file fosi_internal.cpp.
Referenced by RTT::os::Mutex::~Mutex().
int rtos_mutex_init | ( | rt_mutex_t * | m | ) |
Definition at line 298 of file fosi_internal.cpp.
Referenced by RTT::os::Mutex::Mutex().
int rtos_mutex_lock | ( | rt_mutex_t * | m | ) |
Definition at line 314 of file fosi_internal.cpp.
Referenced by RTT::os::Mutex::lock().
int rtos_mutex_lock_until | ( | rt_mutex_t * | m, |
NANO_TIME | abs_time | ||
) |
Referenced by rtos_nanosleep(), and rtos_printf().
int rtos_mutex_rec_destroy | ( | rt_rec_mutex_t * | m | ) |
Referenced by rtos_nanosleep(), rtos_printf(), and RTT::os::MutexRecursive::~MutexRecursive().
int rtos_mutex_rec_init | ( | rt_rec_mutex_t * | m | ) |
Referenced by RTT::os::MutexRecursive::MutexRecursive(), rtos_nanosleep(), and rtos_printf().
int rtos_mutex_rec_lock | ( | rt_rec_mutex_t * | m | ) |
Referenced by RTT::os::MutexRecursive::lock(), rtos_nanosleep(), and rtos_printf().
int rtos_mutex_rec_lock_until | ( | rt_rec_mutex_t * | m, |
NANO_TIME | abs_time | ||
) |
Referenced by rtos_nanosleep(), and rtos_printf().
int rtos_mutex_rec_trylock | ( | rt_rec_mutex_t * | m | ) |
Referenced by rtos_nanosleep(), rtos_printf(), and RTT::os::MutexRecursive::trylock().
int rtos_mutex_rec_trylock_for | ( | rt_rec_mutex_t * | m, |
NANO_TIME | relative_time | ||
) |
Referenced by RTT::os::MutexRecursive::timedlock().
int rtos_mutex_rec_unlock | ( | rt_rec_mutex_t * | m | ) |
Referenced by rtos_nanosleep(), rtos_printf(), and RTT::os::MutexRecursive::unlock().
int rtos_mutex_trylock | ( | rt_mutex_t * | m | ) |
Referenced by rtos_nanosleep(), rtos_printf(), and RTT::os::Mutex::trylock().
int rtos_mutex_trylock_for | ( | rt_mutex_t * | m, |
NANO_TIME | relative_time | ||
) |
Referenced by RTT::os::Mutex::timedlock().
int rtos_mutex_unlock | ( | rt_mutex_t * | m | ) |
Definition at line 322 of file fosi_internal.cpp.
Referenced by RTT::os::Mutex::unlock().
|
inline |
'real-time' print function.
Definition at line 372 of file fosi.h.
References nano2ticks(), rtos_cond_broadcast(), rtos_cond_destroy(), rtos_cond_init(), rtos_cond_timedwait(), rtos_cond_wait(), rtos_disable_rt_warning(), rtos_enable_rt_warning(), rtos_get_time_ns(), rtos_get_time_ticks(), rtos_mutex_destroy(), rtos_mutex_init(), rtos_mutex_lock(), rtos_mutex_lock_until(), rtos_mutex_rec_destroy(), rtos_mutex_rec_init(), rtos_mutex_rec_lock(), rtos_mutex_rec_lock_until(), rtos_mutex_rec_trylock(), rtos_mutex_rec_unlock(), rtos_mutex_trylock(), rtos_mutex_unlock(), rtos_nanosleep(), rtos_sem_destroy(), rtos_sem_init(), rtos_sem_signal(), rtos_sem_trywait(), rtos_sem_value(), rtos_sem_wait(), ticks2nano(), ticks2timespec(), and ticksPerSec().
int rtos_sem_destroy | ( | rt_sem_t * | m | ) |
int rtos_sem_init | ( | rt_sem_t * | m, |
int | value | ||
) |
All these should return zero in case of succes.
Their meaning is hopefully obvious
Referenced by rtos_nanosleep(), rtos_printf(), RTT::os::Semaphore::Semaphore(), and RTT::os::Thread::Thread().
int rtos_sem_signal | ( | rt_sem_t * | m | ) |
int rtos_sem_trywait | ( | rt_sem_t * | m | ) |
Referenced by rtos_nanosleep(), rtos_printf(), and RTT::os::Semaphore::trywait().
int rtos_sem_value | ( | rt_sem_t * | m | ) |
Referenced by rtos_nanosleep(), rtos_printf(), RTT::os::Thread::start(), and RTT::os::Semaphore::value().
int rtos_sem_wait | ( | rt_sem_t * | m | ) |
Referenced by rtos_nanosleep(), rtos_printf(), RTT::os::Thread::Thread(), RTT::os::thread_function(), and RTT::os::Semaphore::wait().
Time conversions from system ticks to nano seconds.
Definition at line 107 of file fosi.h.
Referenced by rtos_get_time_ns(), rtos_printf(), and RTT::os::TimeService::ticks2nsecs().