Files | |
file | task.c |
This file is part of the RTAI project. | |
Functions | |
int | rt_task_create (RT_TASK *task, const char *name, int stksize, int prio, int mode) |
Create a new real-time task. | |
int | rt_task_start (RT_TASK *task, void(*entry)(void *cookie), void *cookie) |
Start a real-time task. | |
int | rt_task_suspend (RT_TASK *task) |
Suspend a real-time task. | |
int | rt_task_resume (RT_TASK *task) |
Resume a real-time task. | |
int | rt_task_delete (RT_TASK *task) |
Delete a real-time task. | |
int | rt_task_yield (void) |
Manual round-robin. | |
int | rt_task_set_periodic (RT_TASK *task, RTIME idate, RTIME period) |
Make a real-time task periodic. | |
int | rt_task_wait_period (void) |
Wait for the next periodic release point. | |
int | rt_task_set_priority (RT_TASK *task, int prio) |
Change the base priority of a real-time task. | |
int | rt_task_sleep (RTIME delay) |
Delay the calling task (relative). | |
int | rt_task_sleep_until (RTIME date) |
Delay the calling task (absolute). | |
int | rt_task_unblock (RT_TASK *task) |
Unblock a real-time task. | |
int | rt_task_inquire (RT_TASK *task, RT_TASK_INFO *info) |
Inquire about a real-time task. | |
int | rt_task_add_hook (int type, void(*routine)(void *cookie)) |
Install a task hook. |
|
Install a task hook. The real-time kernel allows to register user-defined routines which get called whenever a specific scheduling event occurs. Multiple hooks can be chained for a single event type, and get called on a FIFO basis. The scheduling is locked while a hook is executing.
Context: This routine can be called on behalf of a task, interrupt context or from the initialization code. |
|
Create a new real-time task.
Passing T_FPU|T_CPU(1) in the mode parameter thus creates a task with FPU support enabled and which will be affine to CPU #1.
Context: This routine can be called on behalf of a task or from the initialization code. |
|
Delete a real-time task. Terminate a task and release all the real-time kernel resources it currently holds. A task exists in the system since rt_task_create() has been called to create it, so this service must be called in order to destroy it afterwards. The DELETE hooks are called on behalf of the calling context (if any). The information stored in the task control block remains valid until all hooks have been called.
Side-effect: This routine calls the rescheduling procedure if the current task self-deletes. Context: This routine can always be called on behalf of a task. It can also be called on behalf of the initialization code provided task is non-NULL. |
|
Inquire about a real-time task. Return various information about the status of a given task.
|
|
Resume a real-time task. Forcibly resume the execution of a task which has been previously suspended by a call to rt_task_suspend(). The suspension nesting count is decremented so that rt_task_resume() will only resume the task if this count falls down to zero as a result of the current invocation.
Side-effect: This routine calls the rescheduling procedure if the suspension nesting level falls down to zero as a result of the current invocation. Context: This routine can be called on behalf of a task, interrupt context, or from the initialization code. |
|
Make a real-time task periodic. Make a task periodic by programing its first release point and its period in the processor time line. Subsequent calls to rt_task_wait_period() will delay the task until the next periodic release point in the processor timeline is reached.
Side-effect: This routine calls the rescheduling procedure if the operation affects the current task and idate has not elapsed yet. Context: This routine can always be called on behalf of a task. It can also be called on behalf of the initialization code provided task is non-NULL.
|
|
Change the base priority of a real-time task. Changing the base priority does not affect the priority boost the target task might have obtained as a consequence of a previous priority inheritance.
Side-effects:
Context: This routine can always be called on behalf of a task. It can also be called on behalf of an interrupt context or from the initialization code provided task is non-NULL. |
|
Delay the calling task (relative). Delay the execution of the calling task for a number of internal clock ticks.
Side-effect: This routine calls the rescheduling procedure unless a null delay is given. Context: This routine can be called on behalf of a task.
|
|
Delay the calling task (absolute). Delay the execution of the calling task until a given date is reached.
Side-effect: This routine calls the rescheduling procedure unless an already elapsed date is given. Context: This routine can be called on behalf of a task.
|
|
Start a real-time task. Start a (newly) created task, scheduling it for the first time. This call releases the target task from the dormant state. The START hooks are called on behalf of the calling context (if any, see rt_task_add_hook()).
Side-effect: This routine calls the rescheduling procedure. Context: This routine can be called on behalf of a task context or from the initialization code. |
|
Suspend a real-time task. Forcibly suspend the execution of a task. This task will not be eligible for scheduling until it is explicitly resumed by a call to rt_task_resume(). A nesting count is maintained so that rt_task_suspend() and rt_task_resume() must be used in pairs.
Side-effect: This routine calls the rescheduling procedure if the current task suspends itself. Context: This routine can always be called on behalf of a task. It can also be called on behalf of an interrupt context or from the initialization code provided task is non-NULL. |
|
Unblock a real-time task. Break the task out of any wait it is currently in. This call clears all delay and/or resource wait condition for the target task. However, rt_task_unblock() does not resume a task which has been forcibly suspended by a previous call to rt_task_suspend(). If all suspensive conditions are gone, the task becomes eligible anew for scheduling.
Side-effects: This service calls the rescheduling procedure. Context: This routine can be called on behalf of a task, interrupt context or from the initialization code. |
|
Wait for the next periodic release point. Make the current task wait for the next periodic release point in the processor time line.
Side-effect: This routine calls the rescheduling procedure unless an overrun has been detected. In the latter case, the current task immediately returns from this service without being delayed. Context: This routine can be called on behalf of a task. |
|
Manual round-robin. Move the current task to the end of its priority group, so that the next equal-priority task in ready state is switched in. Side-effect: This routine calls the rescheduling procedure. Context: This routine can be called on behalf of a task. |