This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
Include dependency graph for common.c:
Functions | |
int | rt_get_prio (RT_TASK *task) |
Check a task priority. | |
int | rt_get_inher_prio (RT_TASK *task) |
Check a task priority. | |
int | rt_change_prio (RT_TASK *task, int priority) |
Change a task priority. | |
RT_TASK * | rt_whoami (void) |
Get the task pointer of the current task. | |
void | rt_task_yield (void) |
Yield the current task. | |
int | rt_task_suspend (RT_TASK *task) |
rt_task_suspend suspends execution of the task task. | |
int | rt_task_resume (RT_TASK *task) |
Resume a task. | |
int | rt_get_task_state (RT_TASK *task) |
Query task state. | |
void | rt_linux_use_fpu (int use_fpu_flag) |
Set indication of FPU usage. | |
int | rt_task_use_fpu (RT_TASK *task, int use_fpu_flag) |
int | rt_task_signal_handler (RT_TASK *task, void(*handler)(void)) |
Set the signal handler of a task. | |
int | rt_task_make_periodic_relative_ns (RT_TASK *task, RTIME start_delay, RTIME period) |
Make a task run periodically. | |
int | rt_task_make_periodic (RT_TASK *task, RTIME start_time, RTIME period) |
Make a task run periodically. | |
void | rt_task_wait_period (void) |
Wait till next period. | |
RTIME | next_period (void) |
Get the time a periodic task will be resumed after calling rt_task_wait_period. | |
void | rt_busy_sleep (int ns) |
Delay/suspend execution for a while. | |
void | rt_sleep (RTIME delay) |
Delay/suspend execution for a while. | |
void | rt_sleep_until (RTIME time) |
Delay/suspend execution for a while. | |
int | rt_register (unsigned long name, void *adr, int type, struct task_struct *t) |
int | rt_drg_on_name (unsigned long name) |
int | rt_drg_on_adr (void *adr) |
unsigned long | rt_get_name (void *adr) |
Get an object name by its address. | |
void * | rt_get_adr (unsigned long name) |
Get an object address by its name. |
|
Get the time a periodic task will be resumed after calling rt_task_wait_period. this function returns the time when the caller task will run next. Combined with the appropriate rt_get_time function() it can be used for checking the fraction of period used or any period overrun.
|
|
Delay/suspend execution for a while. rt_busy_sleep delays the execution of the caller task without giving back the control to the scheduler. This function burns away CPU cycles in a busy wait loop so it should be used only for very short synchronization delays. On machine not having a TSC clock it can lead to many microseconds uncertain busy sleeps because of the need of reading the 8254 timer.
|
|
Change a task priority. rt_change_prio changes the base priority of task task to prio. Recall that a task has a base native priority, assigned at its birth or by rt_change_prio(), and an actual, inherited, priority. They can be different because of priority inheritance.
|
|
Check a task priority. rt_get_prio returns the base priority task task has inherited from other tasks, either blocked on resources owned by or waiting to pass a message to task task. Recall that a task has a base native priority, assigned at its birth or by rt_change_prio(), and an actual, inherited, priority. They can be different because of priority inheritance.
|
|
Check a task priority. rt_get_prio returns the base priority of task task. Recall that a task has a base native priority, assigned at its birth or by rt_change_prio(), and an actual, inherited, priority. They can be different because of priority inheritance.
|
|
|
Set indication of FPU usage. rt_linux_use_fpu informs the scheduler that floating point arithmetic operations will be used also by foreground Linux processes, i.e. the Linux kernel itself (unlikely) and any of its processes.
|
|
Delay/suspend execution for a while. rt_sleep suspends execution of the caller task for a time of delay internal count units. During this time the CPU is used by other tasks.
|
|
Delay/suspend execution for a while. rt_sleep_until is similar to rt_sleep() but the parameter time is the absolute time till the task have to be suspended. If the given time is already passed this call has no effect.
|
|
Make a task run periodically. rt_task_make_periodic mark the task task, previously created with rt_task_init(), as suitable for a periodic execution, with period period, when rt_task_wait_period() is called. The time of first execution is defined through start_time or start_delay. start_time is an absolute value measured in clock ticks. start_delay is relative to the current time and measured in nanoseconds.
|
|
Make a task run periodically. rt_task_make_periodic_relative_ns mark the task task, previously created with rt_task_init(), as suitable for a periodic execution, with period period, when rt_task_wait_period() is called. The time of first execution is defined through start_time or start_delay. start_time is an absolute value measured in clock ticks. start_delay is relative to the current time and measured in nanoseconds.
|
|
Resume a task. rt_task_resume resumes execution of the task task previously suspended by rt_task_suspend(), or makes a newly created task ready to run, if it makes the task ready. Since no account is made for multiple suspend rt_task_resume unconditionally resumes any task it makes ready.
|
|
Set the signal handler of a task. rt_task_signal_handler installs, or changes, the signal function of a real time task.
|
|
rt_task_suspend suspends execution of the task task. It will not be executed until a call to rt_task_resume() or rt_task_make_periodic() is made. No account is made for multiple suspends, i.e. a multiply suspended task is made ready as soon as it is rt_task_resumed, thus immediately resuming its execution if it is the highest in priority.
|
|
rt_task_use_fpu informs the scheduler that floating point arithmetic operations will be used by the real time task task.
|
|
Wait till next period. rt_task_wait_period suspends the execution of the currently running real time task until the next period is reached. The task must have been previously marked for a periodic execution by calling rt_task_make_periodic() or rt_task_make_periodic_relative_ns().
|
|
Yield the current task. rt_task_yield() stops the current task and takes it at the end of the list of ready tasks having its same priority. The scheduler makes the next ready task of the same priority active. Recall that RTAI schedulers allow only higher priority tasks to preempt the execution of lower priority ones. So equal priority tasks cannot preempt each other and rt_task_yield() should be used if a user needs a cooperative time slicing among equal priority tasks. The implementation of the related policy is wholly in the hand of the user. It is believed that time slicing is too much an overhead for the most demanding real time applications, so it is left up to you. |
|
Get the task pointer of the current task. Calling rt_whoami from a task can get a pointer to its own task structure.
|