Xenomai
3.1
|
Modules | |
Big dual kernel lock | |
Spinlock with preemption deactivation | |
Event Services | |
Semaphore Services | |
Mutex services | |
Functions | |
void | rtdm_waitqueue_init (struct rtdm_waitqueue *wq) |
Initialize a RTDM wait queue More... | |
void | rtdm_waitqueue_destroy (struct rtdm_waitqueue *wq) |
Deletes a RTDM wait queue More... | |
rtdm_timedwait_condition_locked (struct rtdm_wait_queue *wq, C_expr condition, nanosecs_rel_t timeout, rtdm_toseq_t *toseq) | |
Timed sleep on a locked waitqueue until a condition gets true More... | |
rtdm_wait_condition_locked (struct rtdm_wait_queue *wq, C_expr condition) | |
Sleep on a locked waitqueue until a condition gets true More... | |
rtdm_timedwait_condition (struct rtdm_wait_queue *wq, C_expr condition, nanosecs_rel_t timeout, rtdm_toseq_t *toseq) | |
Timed sleep on a waitqueue until a condition gets true More... | |
void | rtdm_timedwait (struct rtdm_wait_queue *wq, nanosecs_rel_t timeout, rtdm_toseq_t *toseq) |
Timed sleep on a waitqueue unconditionally More... | |
void | rtdm_timedwait_locked (struct rtdm_wait_queue *wq, nanosecs_rel_t timeout, rtdm_toseq_t *toseq) |
Timed sleep on a locked waitqueue unconditionally More... | |
rtdm_wait_condition (struct rtdm_wait_queue *wq, C_expr condition) | |
Sleep on a waitqueue until a condition gets true More... | |
void | rtdm_wait (struct rtdm_wait_queue *wq) |
Sleep on a waitqueue unconditionally More... | |
void | rtdm_wait_locked (struct rtdm_wait_queue *wq) |
Sleep on a locked waitqueue unconditionally More... | |
void | rtdm_waitqueue_lock (struct rtdm_wait_queue *wq, rtdm_lockctx_t context) |
Lock a waitqueue More... | |
void | rtdm_waitqueue_unlock (struct rtdm_wait_queue *wq, rtdm_lockctx_t context) |
Unlock a waitqueue More... | |
void | rtdm_waitqueue_signal (struct rtdm_wait_queue *wq) |
Signal a waitqueue More... | |
void | rtdm_waitqueue_broadcast (struct rtdm_wait_queue *wq) |
Broadcast a waitqueue More... | |
void | rtdm_waitqueue_flush (struct rtdm_wait_queue *wq) |
Flush a waitqueue More... | |
void | rtdm_waitqueue_wakeup (struct rtdm_wait_queue *wq, rtdm_task_t waiter) |
Signal a particular waiter on a waitqueue More... | |
rtdm_for_each_waiter (rtdm_task_t pos, struct rtdm_wait_queue *wq) | |
Simple iterator for waitqueues More... | |
rtdm_for_each_waiter_safe (rtdm_task_t pos, rtdm_task_t tmp, struct rtdm_wait_queue *wq) | |
Safe iterator for waitqueues More... | |
RTDM_SELECTTYPE_xxx | |
enum | rtdm_selecttype { RTDM_SELECTTYPE_READ = XNSELECT_READ, RTDM_SELECTTYPE_WRITE = XNSELECT_WRITE, RTDM_SELECTTYPE_EXCEPT = XNSELECT_EXCEPT } |
Timeout Sequence Management | |
void | rtdm_toseq_init (rtdm_toseq_t *timeout_seq, nanosecs_rel_t timeout) |
Initialise a timeout sequence More... | |
enum rtdm_selecttype |
rtdm_for_each_waiter | ( | rtdm_task_t | pos, |
struct rtdm_wait_queue * | wq | ||
) |
Simple iterator for waitqueues
This construct traverses the wait list of a given waitqueue wq, assigning each RTDM task pointer to the cursor variable pos, which must be of type rtdm_task_t.
wq must have been locked by a call to rtdm_waitqueue_lock() prior to traversing its wait list.
pos | cursor variable holding a pointer to the RTDM task being fetched. |
wq | waitqueue to scan. |
rtdm_for_each_waiter_safe | ( | rtdm_task_t | pos, |
rtdm_task_t | tmp, | ||
struct rtdm_wait_queue * | wq | ||
) |
Safe iterator for waitqueues
This construct traverses the wait list of a given waitqueue wq, assigning each RTDM task pointer to the cursor variable pos, which must be of type rtdm_task_t.
Unlike with rtdm_for_each_waiter(), the waitqueue may be signaled, broadcast or flushed during the traversal.
wq must have been locked by a call to rtdm_waitqueue_lock() prior to traversing its wait list.
pos | cursor variable holding a pointer to the RTDM task being fetched. |
tmp | temporary cursor variable. |
wq | waitqueue to scan. |
void rtdm_timedwait | ( | struct rtdm_wait_queue * | wq, |
nanosecs_rel_t | timeout, | ||
rtdm_toseq_t * | toseq | ||
) |
Timed sleep on a waitqueue unconditionally
The calling task is put to sleep until the waitqueue is signaled by either rtdm_waitqueue_signal() or rtdm_waitqueue_broadcast(), or flushed by a call to rtdm_waitqueue_flush(), or a timeout occurs.
wq | waitqueue to wait on. | |
timeout | relative timeout in nanoseconds, see RTDM_TIMEOUT_xxx for special values. | |
[in,out] | toseq | handle of a timeout sequence as returned by rtdm_toseq_init() or NULL. |
rtdm_timedwait_condition | ( | struct rtdm_wait_queue * | wq, |
C_expr | condition, | ||
nanosecs_rel_t | timeout, | ||
rtdm_toseq_t * | toseq | ||
) |
Timed sleep on a waitqueue until a condition gets true
The calling task is put to sleep until condition evaluates to true or a timeout occurs. The condition is checked each time the waitqueue wq is signaled.
wq | waitqueue to wait on. | |
condition | C expression for the event to wait for. | |
timeout | relative timeout in nanoseconds, see RTDM_TIMEOUT_xxx for special values. | |
[in,out] | toseq | handle of a timeout sequence as returned by rtdm_toseq_init() or NULL. |
rtdm_timedwait_condition_locked | ( | struct rtdm_wait_queue * | wq, |
C_expr | condition, | ||
nanosecs_rel_t | timeout, | ||
rtdm_toseq_t * | toseq | ||
) |
Timed sleep on a locked waitqueue until a condition gets true
The calling task is put to sleep until condition evaluates to true or a timeout occurs. The condition is checked each time the waitqueue wq is signaled.
The waitqueue must have been locked by a call to rtdm_waitqueue_lock() prior to calling this service.
wq | locked waitqueue to wait on. The waitqueue lock is dropped when sleeping, then reacquired before this service returns to the caller. | |
condition | C expression for the event to wait for. | |
timeout | relative timeout in nanoseconds, see RTDM_TIMEOUT_xxx for special values. | |
[in,out] | toseq | handle of a timeout sequence as returned by rtdm_toseq_init() or NULL. |
void rtdm_timedwait_locked | ( | struct rtdm_wait_queue * | wq, |
nanosecs_rel_t | timeout, | ||
rtdm_toseq_t * | toseq | ||
) |
Timed sleep on a locked waitqueue unconditionally
The calling task is put to sleep until the waitqueue is signaled by either rtdm_waitqueue_signal() or rtdm_waitqueue_broadcast(), or flushed by a call to rtdm_waitqueue_flush(), or a timeout occurs.
The waitqueue must have been locked by a call to rtdm_waitqueue_lock() prior to calling this service.
wq | locked waitqueue to wait on. The waitqueue lock is dropped when sleeping, then reacquired before this service returns to the caller. | |
timeout | relative timeout in nanoseconds, see RTDM_TIMEOUT_xxx for special values. | |
[in,out] | toseq | handle of a timeout sequence as returned by rtdm_toseq_init() or NULL. |
void rtdm_toseq_init | ( | rtdm_toseq_t * | timeout_seq, |
nanosecs_rel_t | timeout | ||
) |
Initialise a timeout sequence
This service initialises a timeout sequence handle according to the given timeout value. Timeout sequences allow to maintain a continuous timeout across multiple calls of blocking synchronisation services. A typical application scenario is given below.
[in,out] | timeout_seq | Timeout sequence handle |
[in] | timeout | Relative timeout in nanoseconds, see RTDM_TIMEOUT_xxx for special values |
Application Scenario:
Using a timeout sequence in such a scenario avoids that the user-provided relative timeout
is restarted on every call to rtdm_event_timedwait(), potentially causing an overall delay that is larger than specified by timeout
. Moreover, all functions supporting timeout sequences also interpret special timeout values (infinite and non-blocking), disburdening the driver developer from handling them separately.
void rtdm_wait | ( | struct rtdm_wait_queue * | wq | ) |
Sleep on a waitqueue unconditionally
The calling task is put to sleep until the waitqueue is signaled by either rtdm_waitqueue_signal() or rtdm_waitqueue_broadcast(), or flushed by a call to rtdm_waitqueue_flush().
wq | waitqueue to wait on. |
rtdm_wait_condition | ( | struct rtdm_wait_queue * | wq, |
C_expr | condition | ||
) |
Sleep on a waitqueue until a condition gets true
The calling task is put to sleep until condition evaluates to true. The condition is checked each time the waitqueue wq is signaled.
wq | waitqueue to wait on |
condition | C expression for the event to wait for. |
rtdm_wait_condition_locked | ( | struct rtdm_wait_queue * | wq, |
C_expr | condition | ||
) |
Sleep on a locked waitqueue until a condition gets true
The calling task is put to sleep until condition evaluates to true. The condition is checked each time the waitqueue wq is signaled.
The waitqueue must have been locked by a call to rtdm_waitqueue_lock() prior to calling this service.
wq | locked waitqueue to wait on. The waitqueue lock is dropped when sleeping, then reacquired before this service returns to the caller. |
condition | C expression for the event to wait for. |
void rtdm_wait_locked | ( | struct rtdm_wait_queue * | wq | ) |
Sleep on a locked waitqueue unconditionally
The calling task is put to sleep until the waitqueue is signaled by either rtdm_waitqueue_signal() or rtdm_waitqueue_broadcast(), or flushed by a call to rtdm_waitqueue_flush().
The waitqueue must have been locked by a call to rtdm_waitqueue_lock() prior to calling this service.
wq | locked waitqueue to wait on. The waitqueue lock is dropped when sleeping, then reacquired before this service returns to the caller. |
void rtdm_waitqueue_broadcast | ( | struct rtdm_wait_queue * | wq | ) |
Broadcast a waitqueue
Broadcast the waitqueue wq, waking up all waiters. Each readied task may assume to have received the wake up event.
wq | waitqueue to broadcast. |
void rtdm_waitqueue_destroy | ( | struct rtdm_waitqueue * | wq | ) |
Deletes a RTDM wait queue
Dismantles a wait queue structure, releasing all resources attached to it.
wq | waitqueue to delete. |
void rtdm_waitqueue_flush | ( | struct rtdm_wait_queue * | wq | ) |
Flush a waitqueue
Flushes the waitqueue wq, unblocking all waiters with an error status (-EINTR).
wq | waitqueue to flush. |
void rtdm_waitqueue_init | ( | struct rtdm_waitqueue * | wq | ) |
Initialize a RTDM wait queue
Sets up a wait queue structure for further use.
wq | waitqueue to initialize. |
void rtdm_waitqueue_lock | ( | struct rtdm_wait_queue * | wq, |
rtdm_lockctx_t | context | ||
) |
Lock a waitqueue
Acquires the lock on the waitqueue wq.
wq | waitqueue to lock. |
context | name of local variable to store the context in. |
void rtdm_waitqueue_signal | ( | struct rtdm_wait_queue * | wq | ) |
Signal a waitqueue
Signals the waitqueue wq, waking up a single waiter (if any).
wq | waitqueue to signal. |
void rtdm_waitqueue_unlock | ( | struct rtdm_wait_queue * | wq, |
rtdm_lockctx_t | context | ||
) |
Unlock a waitqueue
Releases the lock on the waitqueue wq.
wq | waitqueue to unlock. |
context | name of local variable to retrieve the context from. |
void rtdm_waitqueue_wakeup | ( | struct rtdm_wait_queue * | wq, |
rtdm_task_t | waiter | ||
) |
Signal a particular waiter on a waitqueue
Signals the waitqueue wq, waking up waiter waiter only, which must be currently sleeping on the waitqueue.
wq | waitqueue to signal. |
waiter | RTDM task to wake up. |