base/sched/api.c File Reference


Detailed Description

Common scheduling function.

Author:
Paolo Mantegazza
This file is part of the RTAI project.

Note:
Copyright © 1999-2003 Paolo Mantegazza <mantegazza@aero.polimi.it>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

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.

Definition in file api.c.#include <rtai_schedcore.h>
#include <rtai_registry.h>
#include <linux/module.h>
#include <rtai_lxrt.h>
#include <rtai_tasklets.h>
#include <asm/uaccess.h>

Include dependency graph for api.c:

Include dependency graph

Go to the source code of this file.

Defines

#define HASHED_REGISTRY
#define COLLISION_COUNT()   do { col++; } while(0)
#define NONAME   (1UL)
#define NOADR   ((void *)1)
#define PRIMES_TAB_GRANULARITY   100
#define hash_fun(m, n)   ((m)%(n) + 1)

Functions

void rt_set_sched_policy (RT_TASK *task, int policy, int rr_quantum_ns)
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_TASKrt_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_suspend_if (RT_TASK *task)
int rt_task_suspend_until (RT_TASK *task, RTIME time)
int rt_task_suspend_timed (RT_TASK *task, RTIME delay)
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.
void rt_gettimeorig (RTIME time_orig[])
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.
int rt_task_wait_period (void)
 Wait till next period.
void rt_task_set_resume_end_times (RTIME resume, RTIME end)
int rt_set_resume_time (RT_TASK *task, RTIME new_resume_time)
int rt_set_period (RT_TASK *task, RTIME new_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.
int rt_sleep (RTIME delay)
 Delay/suspend execution for a while.
int rt_sleep_until (RTIME time)
 Delay/suspend execution for a while.
int rt_task_masked_unblock (RT_TASK *task, unsigned long mask)
int rt_nanosleep (struct timespec *rqtp, struct timespec *rmtp)
void rt_enq_ready_edf_task (RT_TASK *ready_task)
void rt_enq_ready_task (RT_TASK *ready_task)
int rt_renq_ready_task (RT_TASK *ready_task, int priority)
void rt_rem_ready_task (RT_TASK *task)
void rt_rem_ready_current (RT_TASK *rt_current)
void rt_enq_timed_task (RT_TASK *timed_task)
void rt_wake_up_timed_tasks (int cpuid)
void rt_rem_timed_task (RT_TASK *task)
void rt_enqueue_blocked (RT_TASK *task, QUEUE *queue, int qtype)
void rt_dequeue_blocked (RT_TASK *task)
int rt_renq_current (RT_TASK *rt_current, int priority)
RT_TASKrt_named_task_init (const char *task_name, void(*thread)(long), long data, int stack_size, int prio, int uses_fpu, void(*signal)(void))
RT_TASKrt_named_task_init_cpuid (const char *task_name, void(*thread)(long), long data, int stack_size, int prio, int uses_fpu, void(*signal)(void), unsigned int run_on_cpu)
int rt_named_task_delete (RT_TASK *task)
int hash_ins_adr (void *adr, struct rt_registry_entry *list, int lstlen, int nlink)
int hash_ins_name (unsigned long name, void *adr, int type, struct task_struct *lnxtsk, struct rt_registry_entry *list, int lstlen, int inc)
void * hash_find_name (unsigned long name, struct rt_registry_entry *list, long lstlen, int inc, int *slot)
unsigned long hash_find_adr (void *adr, struct rt_registry_entry *list, long lstlen, int inc)
int hash_rem_name (unsigned long name, struct rt_registry_entry *list, long lstlen, int dec)
int hash_rem_adr (void *adr, struct rt_registry_entry *list, long lstlen, int dec)
int registr (unsigned long name, void *adr, int type, struct task_struct *lnxtsk)
int drg_on_name (unsigned long name)
int drg_on_name_cnt (unsigned long name)
int drg_on_adr (void *adr)
int drg_on_adr_cnt (void *adr)
unsigned long get_name (void *adr)
void * get_adr (unsigned long name)
void * get_adr_cnt (unsigned long name)
int get_type (unsigned long name)
unsigned long is_process_registered (struct task_struct *lnxtsk)
int rt_get_registry_slot (int slot, struct rt_registry_entry *entry)
int rt_registry_alloc (void)
void rt_registry_free (void)
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.
int rt_get_type (unsigned long name)
int rt_drg_on_name_cnt (unsigned long name)
int rt_drg_on_adr_cnt (void *adr)
void * rt_get_adr_cnt (unsigned long name)
void krtai_objects_release (void)
int rt_irq_wait (unsigned irq)
int rt_irq_wait_if (unsigned irq)
int rt_irq_wait_until (unsigned irq, RTIME time)
int rt_irq_wait_timed (unsigned irq, RTIME delay)
void rt_irq_signal (unsigned irq)
int rt_irq_task_handler (unsigned irq, RT_TASK *irq_task)
int rt_request_irq_task (unsigned irq, void *handler, int type, int affine2task)
int rt_release_irq_task (unsigned irq)
void usp_request_rtc (int, void *)
RT_TASKrt_exec_linux_syscall (RT_TASK *rt_current, RT_TASK *task, struct pt_regs *regs)
RT_TASKrt_receive_linux_syscall (RT_TASK *task, struct pt_regs *regs)
void rt_return_linux_syscall (RT_TASK *task, unsigned long retval)
 EXPORT_SYMBOL (rt_set_sched_policy)
 EXPORT_SYMBOL (rt_get_prio)
 EXPORT_SYMBOL (rt_get_inher_prio)
 EXPORT_SYMBOL (rt_change_prio)
 EXPORT_SYMBOL (rt_whoami)
 EXPORT_SYMBOL (rt_task_yield)
 EXPORT_SYMBOL (rt_task_suspend)
 EXPORT_SYMBOL (rt_task_resume)
 EXPORT_SYMBOL (rt_get_task_state)
 EXPORT_SYMBOL (rt_linux_use_fpu)
 EXPORT_SYMBOL (rt_task_use_fpu)
 EXPORT_SYMBOL (rt_task_signal_handler)
 EXPORT_SYMBOL (rt_gettimeorig)
 EXPORT_SYMBOL (rt_task_make_periodic_relative_ns)
 EXPORT_SYMBOL (rt_task_wait_period)
 EXPORT_SYMBOL (rt_task_set_resume_end_times)
 EXPORT_SYMBOL (rt_set_resume_time)
 EXPORT_SYMBOL (rt_set_period)
 EXPORT_SYMBOL (next_period)
 EXPORT_SYMBOL (rt_busy_sleep)
 EXPORT_SYMBOL (rt_sleep)
 EXPORT_SYMBOL (rt_task_masked_unblock)
 EXPORT_SYMBOL (rt_nanosleep)
 EXPORT_SYMBOL (rt_enq_ready_edf_task)
 EXPORT_SYMBOL (rt_enq_ready_task)
 EXPORT_SYMBOL (rt_renq_ready_task)
 EXPORT_SYMBOL (rt_rem_ready_task)
 EXPORT_SYMBOL (rt_rem_ready_current)
 EXPORT_SYMBOL (rt_enq_timed_task)
 EXPORT_SYMBOL (rt_wake_up_timed_tasks)
 EXPORT_SYMBOL (rt_rem_timed_task)
 EXPORT_SYMBOL (rt_enqueue_blocked)
 EXPORT_SYMBOL (rt_dequeue_blocked)
 EXPORT_SYMBOL (rt_renq_current)
 EXPORT_SYMBOL (rt_named_task_init)
 EXPORT_SYMBOL (rt_named_task_delete)
 EXPORT_SYMBOL (is_process_registered)
 EXPORT_SYMBOL (rt_register)
 EXPORT_SYMBOL (rt_drg_on_name)
 EXPORT_SYMBOL (rt_drg_on_adr)
 EXPORT_SYMBOL (rt_get_name)
 EXPORT_SYMBOL (rt_get_adr)
 EXPORT_SYMBOL (rt_get_type)
 EXPORT_SYMBOL (rt_get_registry_slot)
 EXPORT_SYMBOL (rt_task_init)
 EXPORT_SYMBOL (rt_set_runnable_on_cpus)
 EXPORT_SYMBOL (rt_set_runnable_on_cpuid)
 EXPORT_SYMBOL (rt_check_current_stack)
 EXPORT_SYMBOL (rt_schedule)
 EXPORT_SYMBOL (rt_spv_RMS)
 EXPORT_SYMBOL (rt_sched_lock)
 EXPORT_SYMBOL (rt_sched_unlock)
 EXPORT_SYMBOL (rt_task_delete)
 EXPORT_SYMBOL (rt_is_hard_timer_running)
 EXPORT_SYMBOL (rt_set_oneshot_mode)
 EXPORT_SYMBOL (rt_get_timer_cpu)
 EXPORT_SYMBOL (start_rt_timer)
 EXPORT_SYMBOL (stop_rt_timer)
 EXPORT_SYMBOL (start_rt_apic_timers)
 EXPORT_SYMBOL (rt_sched_type)
 EXPORT_SYMBOL (rt_hard_timer_tick_count)
 EXPORT_SYMBOL (rt_set_task_trap_handler)
 EXPORT_SYMBOL (rt_get_time_cpuid)
 EXPORT_SYMBOL (rt_get_time_ns)
 EXPORT_SYMBOL (rt_get_cpu_time_ns)
 EXPORT_SYMBOL (rt_get_base_linux_task)
 EXPORT_SYMBOL (rt_alloc_dynamic_task)
 EXPORT_SYMBOL (rt_deregister_watchdog)
 EXPORT_SYMBOL (count2nano)
 EXPORT_SYMBOL (nano2count)
 EXPORT_SYMBOL (rt_kthread_init)
 EXPORT_SYMBOL (rt_smp_linux_task)
 EXPORT_SYMBOL (rt_smp_current)
 EXPORT_SYMBOL (rt_smp_time_h)
 EXPORT_SYMBOL (rt_smp_oneshot_timer)
 EXPORT_SYMBOL (wake_up_srq)
 EXPORT_SYMBOL (set_rt_fun_entries)
 EXPORT_SYMBOL (reset_rt_fun_entries)
 EXPORT_SYMBOL (set_rt_fun_ext_index)
 EXPORT_SYMBOL (reset_rt_fun_ext_index)
 EXPORT_SYMBOL (max_slots)

Variables

int max_slots
rt_registry_entrylxrt_list
spinlock_t list_lock = SPIN_LOCK_UNLOCKED
unsigned long long col
unsigned short primes []
rt_fun_entry rt_fun_lxrt []
struct {
   int(*   handler )(unsigned irq, void *cookie)
   void *   cookie
   int   retmode
   int   cpumask
rtai_realtime_irq []


Define Documentation

 
#define COLLISION_COUNT  )     do { col++; } while(0)
 

Definition at line 1053 of file api.c.

Referenced by hash_find_adr(), hash_find_name(), hash_ins_adr(), hash_ins_name(), hash_rem_adr(), and hash_rem_name().

#define hash_fun m,
 )     ((m)%(n) + 1)
 

Definition at line 1069 of file api.c.

Referenced by hash_find(), hash_find_adr(), hash_find_if_not_ins(), hash_find_name(), hash_ins(), hash_ins_adr(), hash_ins_name(), hash_rem(), hash_rem_adr(), and hash_rem_name().

#define HASHED_REGISTRY
 

Definition at line 1045 of file api.c.

#define NOADR   ((void *)1)
 

Definition at line 1060 of file api.c.

Referenced by hash_find_adr(), hash_ins_adr(), hash_rem_adr(), and hash_rem_name().

#define NONAME   (1UL)
 

Definition at line 1059 of file api.c.

Referenced by hash_find_name(), hash_ins_name(), hash_rem_adr(), hash_rem_name(), and rt_get_registry_slot().

#define PRIMES_TAB_GRANULARITY   100
 

Definition at line 1062 of file api.c.

Referenced by rt_registry_alloc().


Function Documentation

int drg_on_adr void *  adr  )  [inline, static]
 

Definition at line 1301 of file api.c.

References hash_rem_adr(), lxrt_list, and max_slots.

Referenced by rt_drg_on_adr().

Here is the call graph for this function:

int drg_on_adr_cnt void *  adr  )  [inline, static]
 

Definition at line 1306 of file api.c.

References hash_rem_adr(), lxrt_list, and max_slots.

Referenced by rt_drg_on_adr_cnt().

Here is the call graph for this function:

int drg_on_name unsigned long  name  )  [inline, static]
 

Definition at line 1291 of file api.c.

References hash_rem_name(), lxrt_list, and max_slots.

Referenced by rt_drg_on_name().

Here is the call graph for this function:

int drg_on_name_cnt unsigned long  name  )  [inline, static]
 

Definition at line 1296 of file api.c.

References hash_rem_name(), lxrt_list, and max_slots.

Referenced by rt_drg_on_name_cnt().

Here is the call graph for this function:

EXPORT_SYMBOL max_slots   ) 
 

EXPORT_SYMBOL reset_rt_fun_ext_index   ) 
 

EXPORT_SYMBOL set_rt_fun_ext_index   ) 
 

EXPORT_SYMBOL reset_rt_fun_entries   ) 
 

EXPORT_SYMBOL set_rt_fun_entries   ) 
 

EXPORT_SYMBOL wake_up_srq   ) 
 

EXPORT_SYMBOL rt_smp_oneshot_timer   ) 
 

EXPORT_SYMBOL rt_smp_time_h   ) 
 

EXPORT_SYMBOL rt_smp_current   ) 
 

EXPORT_SYMBOL rt_smp_linux_task   ) 
 

EXPORT_SYMBOL rt_kthread_init   ) 
 

EXPORT_SYMBOL nano2count   ) 
 

EXPORT_SYMBOL count2nano   ) 
 

EXPORT_SYMBOL rt_deregister_watchdog   ) 
 

EXPORT_SYMBOL rt_alloc_dynamic_task   ) 
 

EXPORT_SYMBOL rt_get_base_linux_task   ) 
 

EXPORT_SYMBOL rt_get_cpu_time_ns   ) 
 

EXPORT_SYMBOL rt_get_time_ns   ) 
 

EXPORT_SYMBOL rt_get_time_cpuid   ) 
 

EXPORT_SYMBOL rt_set_task_trap_handler   ) 
 

EXPORT_SYMBOL rt_hard_timer_tick_count   ) 
 

EXPORT_SYMBOL rt_sched_type   ) 
 

EXPORT_SYMBOL start_rt_apic_timers   ) 
 

EXPORT_SYMBOL stop_rt_timer   ) 
 

EXPORT_SYMBOL start_rt_timer   ) 
 

EXPORT_SYMBOL rt_get_timer_cpu   ) 
 

EXPORT_SYMBOL rt_set_oneshot_mode   ) 
 

EXPORT_SYMBOL rt_is_hard_timer_running   ) 
 

EXPORT_SYMBOL rt_task_delete   ) 
 

EXPORT_SYMBOL rt_sched_unlock   ) 
 

EXPORT_SYMBOL rt_sched_lock   ) 
 

EXPORT_SYMBOL rt_spv_RMS   ) 
 

EXPORT_SYMBOL rt_schedule   ) 
 

EXPORT_SYMBOL rt_check_current_stack   ) 
 

EXPORT_SYMBOL rt_set_runnable_on_cpuid   ) 
 

EXPORT_SYMBOL rt_set_runnable_on_cpus   ) 
 

EXPORT_SYMBOL rt_task_init   ) 
 

EXPORT_SYMBOL rt_get_registry_slot   ) 
 

EXPORT_SYMBOL rt_get_type   ) 
 

EXPORT_SYMBOL rt_get_adr   ) 
 

EXPORT_SYMBOL rt_get_name   ) 
 

EXPORT_SYMBOL rt_drg_on_adr   ) 
 

EXPORT_SYMBOL rt_drg_on_name   ) 
 

EXPORT_SYMBOL rt_register   ) 
 

EXPORT_SYMBOL is_process_registered   ) 
 

EXPORT_SYMBOL rt_named_task_delete   ) 
 

EXPORT_SYMBOL rt_named_task_init   ) 
 

EXPORT_SYMBOL rt_renq_current   ) 
 

EXPORT_SYMBOL rt_dequeue_blocked   ) 
 

EXPORT_SYMBOL rt_enqueue_blocked   ) 
 

EXPORT_SYMBOL rt_rem_timed_task   ) 
 

EXPORT_SYMBOL rt_wake_up_timed_tasks   ) 
 

EXPORT_SYMBOL rt_enq_timed_task   ) 
 

EXPORT_SYMBOL rt_rem_ready_current   ) 
 

EXPORT_SYMBOL rt_rem_ready_task   ) 
 

EXPORT_SYMBOL rt_renq_ready_task   ) 
 

EXPORT_SYMBOL rt_enq_ready_task   ) 
 

EXPORT_SYMBOL rt_enq_ready_edf_task   ) 
 

EXPORT_SYMBOL rt_nanosleep   ) 
 

EXPORT_SYMBOL rt_task_masked_unblock   ) 
 

EXPORT_SYMBOL rt_sleep   ) 
 

EXPORT_SYMBOL rt_busy_sleep   ) 
 

EXPORT_SYMBOL next_period   ) 
 

EXPORT_SYMBOL rt_set_period   ) 
 

EXPORT_SYMBOL rt_set_resume_time   ) 
 

EXPORT_SYMBOL rt_task_set_resume_end_times   ) 
 

EXPORT_SYMBOL rt_task_wait_period   ) 
 

EXPORT_SYMBOL rt_task_make_periodic_relative_ns   ) 
 

EXPORT_SYMBOL rt_gettimeorig   ) 
 

EXPORT_SYMBOL rt_task_signal_handler   ) 
 

EXPORT_SYMBOL rt_task_use_fpu   ) 
 

EXPORT_SYMBOL rt_linux_use_fpu   ) 
 

EXPORT_SYMBOL rt_get_task_state   ) 
 

EXPORT_SYMBOL rt_task_resume   ) 
 

EXPORT_SYMBOL rt_task_suspend   ) 
 

EXPORT_SYMBOL rt_task_yield   ) 
 

EXPORT_SYMBOL rt_whoami   ) 
 

EXPORT_SYMBOL rt_change_prio   ) 
 

EXPORT_SYMBOL rt_get_inher_prio   ) 
 

EXPORT_SYMBOL rt_get_prio   ) 
 

EXPORT_SYMBOL rt_set_sched_policy   ) 
 

void* get_adr unsigned long  name  )  [inline, static]
 

Definition at line 1329 of file api.c.

References hash_find_name(), lxrt_list, and max_slots.

Referenced by rt_get_adr(), and rt_register().

Here is the call graph for this function:

void* get_adr_cnt unsigned long  name  )  [inline, static]
 

Definition at line 1334 of file api.c.

References hash_find_name(), lxrt_list, and max_slots.

Referenced by rt_get_adr_cnt().

Here is the call graph for this function:

unsigned long get_name void *  adr  )  [inline, static]
 

Definition at line 1311 of file api.c.

References flags, hash_find_adr(), list_lock, lxrt_list, max_slots, rt_spin_lock_irqsave(), and rt_spin_unlock_irqrestore.

Referenced by rt_get_name().

Here is the call graph for this function:

int get_type unsigned long  name  )  [inline, static]
 

Definition at line 1339 of file api.c.

References hash_find_name(), lxrt_list, max_slots, and rt_registry_entry::type.

Referenced by rt_get_type().

Here is the call graph for this function:

unsigned long hash_find_adr void *  adr,
struct rt_registry_entry list,
long  lstlen,
int  inc
[static]
 

Definition at line 1176 of file api.c.

References rt_registry_entry::adr, COLLISION_COUNT, flags, hash_fun, list_lock, NOADR, rt_spin_lock_irqsave(), and rt_spin_unlock_irqrestore.

Referenced by get_name(), and is_process_registered().

Here is the call graph for this function:

void* hash_find_name unsigned long  name,
struct rt_registry_entry list,
long  lstlen,
int  inc,
int *  slot
[static]
 

Definition at line 1142 of file api.c.

References COLLISION_COUNT, flags, hash_fun, list_lock, rt_registry_entry::name, NONAME, rt_spin_lock_irqsave(), and rt_spin_unlock_irqrestore.

Referenced by get_adr(), get_adr_cnt(), and get_type().

Here is the call graph for this function:

int hash_ins_adr void *  adr,
struct rt_registry_entry list,
int  lstlen,
int  nlink
[static]
 

Definition at line 1071 of file api.c.

References rt_registry_entry::adr, COLLISION_COUNT, flags, hash_fun, list_lock, NOADR, rt_spin_lock_irqsave(), and rt_spin_unlock_irqrestore.

Referenced by hash_ins_name().

Here is the call graph for this function:

int hash_ins_name unsigned long  name,
void *  adr,
int  type,
struct task_struct *  lnxtsk,
struct rt_registry_entry list,
int  lstlen,
int  inc
[static]
 

Definition at line 1102 of file api.c.

References COLLISION_COUNT, flags, hash_fun, hash_ins_adr(), list_lock, rt_registry_entry::name, NONAME, rt_spin_lock_irqsave(), and rt_spin_unlock_irqrestore.

Referenced by registr().

Here is the call graph for this function:

int hash_rem_adr void *  adr,
struct rt_registry_entry list,
long  lstlen,
int  dec
[static]
 

Definition at line 1247 of file api.c.

References rt_registry_entry::adr, COLLISION_COUNT, rt_registry_entry::count, flags, hash_fun, list_lock, rt_registry_entry::nlink, NOADR, NONAME, rt_spin_lock_irqsave(), and rt_spin_unlock_irqrestore.

Referenced by drg_on_adr(), and drg_on_adr_cnt().

Here is the call graph for this function:

int hash_rem_name unsigned long  name,
struct rt_registry_entry list,
long  lstlen,
int  dec
[static]
 

Definition at line 1207 of file api.c.

References rt_registry_entry::alink, COLLISION_COUNT, rt_registry_entry::count, flags, hash_fun, list_lock, rt_registry_entry::name, NOADR, NONAME, rt_spin_lock_irqsave(), and rt_spin_unlock_irqrestore.

Referenced by drg_on_name(), and drg_on_name_cnt().

Here is the call graph for this function:

unsigned long is_process_registered struct task_struct *  lnxtsk  ) 
 

Definition at line 1349 of file api.c.

References hash_find_adr(), lxrt_list, max_slots, and TSKEXT0.

Referenced by linux_process_termination().

Here is the call graph for this function:

void krtai_objects_release void   ) 
 

Definition at line 1701 of file api.c.

References rt_registry_entry::adr, IS_MBX, IS_PRX, IS_RWL, IS_SEM, IS_SPL, IS_TASK, max_slots, rt_registry_entry::name, NAMED_MBX_DELETE, NAMED_RWL_DELETE, NAMED_SEM_DELETE, NAMED_SPL_DELETE, num2nam(), PROXY_DETACH, rt_drg_on_adr(), rt_fun_lxrt, rt_get_registry_slot(), rt_named_task_delete(), rt_printk(), and rt_registry_entry::type.

Referenced by __rtai_lxrt_exit().

Here is the call graph for this function:

RTIME next_period void   ) 
 

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.

Returns:
Next period time in internal count units.
Definition at line 782 of file api.c.

References flags, RT_TASK, and RTIME.

int registr unsigned long  name,
void *  adr,
int  type,
struct task_struct *  lnxtsk
[inline, static]
 

Definition at line 1286 of file api.c.

References hash_ins_name(), lxrt_list, and max_slots.

Referenced by rt_register().

Here is the call graph for this function:

void rt_busy_sleep int  ns  ) 
 

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.

Parameters:
ns is the number of nanoseconds to wait.
See also: rt_sleep(), rt_sleep_until().

Note:
A higher priority task or interrupt handler can run before the task goes to sleep, so the actual time spent in these functions may be longer than that specified.
Definition at line 811 of file api.c.

References llimd(), rtai_rdtsc, RTIME, and tuned.

Referenced by __rtai_wd_exit().

Here is the call graph for this function:

int rt_change_prio RT_TASK task,
int  priority
 

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.

Parameters:
task is the affected task.
priority is the new priority, it can range within 0 < prio < RT_SCHED_LOWEST_PRIORITY.
Returns:
rt_change_prio returns the base priority task task had before the change.
Note:
To be used only with RTAI24.x.xx (FIXME).
Definition at line 124 of file api.c.

References flags, RT_SCHED_READY, RT_SCHED_SEMAPHORE, rt_schedule(), RT_TASK, SEM, and task.

Here is the call graph for this function:

void rt_dequeue_blocked RT_TASK task  ) 
 

Definition at line 987 of file api.c.

References dequeue_blocked(), RT_TASK, and task.

Here is the call graph for this function:

int rt_drg_on_adr_cnt void *  adr  ) 
 

Definition at line 1687 of file api.c.

References drg_on_adr_cnt().

Referenced by rt_named_mbx_delete(), rt_named_msgq_delete(), rt_named_rwl_delete(), rt_named_sem_delete(), and rt_named_spl_delete().

Here is the call graph for this function:

int rt_drg_on_name_cnt unsigned long  name  ) 
 

Definition at line 1682 of file api.c.

References drg_on_name_cnt().

Referenced by __rtai_shm_exit(), _rt_shm_free(), linux_process_termination(), and rt_named_hfree_typed().

Here is the call graph for this function:

void rt_enq_ready_edf_task RT_TASK ready_task  ) 
 

Definition at line 938 of file api.c.

References RT_TASK.

void rt_enq_ready_task RT_TASK ready_task  ) 
 

Definition at line 943 of file api.c.

References RT_TASK.

void rt_enq_timed_task RT_TASK timed_task  ) 
 

Definition at line 963 of file api.c.

References RT_TASK.

void rt_enqueue_blocked RT_TASK task,
QUEUE *  queue,
int  qtype
 

Definition at line 982 of file api.c.

References enqueue_blocked(), RT_TASK, and task.

Here is the call graph for this function:

RT_TASK* rt_exec_linux_syscall RT_TASK rt_current,
RT_TASK task,
struct pt_regs *  regs
 

Definition at line 1830 of file api.c.

References enqueue_blocked(), flags, RT_SCHED_READY, RT_SCHED_RECEIVE, RT_SCHED_RETURN, RT_SCHED_RPC, rt_schedule(), RT_TASK, and task.

Referenced by lxrt_intercept_syscall_prologue().

Here is the call graph for this function:

void* rt_get_adr_cnt unsigned long  name  ) 
 

Definition at line 1692 of file api.c.

References get_adr_cnt().

Referenced by _rt_named_msgq_init(), _rt_named_rwl_init(), _rt_named_spl_init(), _rt_shm_alloc(), _rt_typed_named_mbx_init(), _rt_typed_named_sem_init(), rt_named_halloc_typed(), and rtai_shm_vm_open().

Here is the call graph for this function:

int rt_get_inher_prio RT_TASK task  ) 
 

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.

Parameters:
task is the affected task.
Returns:
rt_get_inher_prio returns the priority of task task.
Note:
To be used only with RTAI24.x.xx.
Definition at line 94 of file api.c.

References RT_TASK, and task.

int rt_get_prio RT_TASK task  ) 
 

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.

Parameters:
task is the affected task.
Returns:
rt_get_prio returns the priority of task task.
Note:
To be used only with RTAI24.x.xx.
Definition at line 67 of file api.c.

References RT_TASK, and task.

int rt_get_registry_slot int  slot,
struct rt_registry_entry entry
 

Definition at line 1355 of file api.c.

References rt_registry_entry::adr, rt_registry_entry::alink, flags, list_lock, lxrt_list, rt_registry_entry::name, NONAME, rt_spin_lock_irqsave(), and rt_spin_unlock_irqrestore.

Referenced by __rtai_shm_exit(), krtai_objects_release(), and linux_process_termination().

Here is the call graph for this function:

int rt_get_task_state RT_TASK task  ) 
 

Query task state.

rt_get_task_state returns the state of a real time task.

Parameters:
task is a pointer to the task structure.
Task state is formed by the bitwise OR of one or more of the following flags:

Return values:
READY Task task is ready to run (i.e. unblocked). Note that on a UniProcessor machine the currently running task is just in READY state, while on MultiProcessors can be (READY | RUNNING), see below.
SUSPENDED Task task blocked waiting for a resume.
DELAYED Task task blocked waiting for its next running period or expiration of a timeout.
SEMAPHORE Task task blocked on a semaphore, waiting for the semaphore to be signaled.
SEND Task task blocked on sending a message, receiver was not in RECEIVE state.
RECEIVE Task task blocked waiting for incoming messages, sends or rpcs.
RPC Task task blocked on a Remote Procedure Call, receiver was not in RECEIVE state.
RETURN Task task blocked waiting for a return from a Remote Procedure Call, receiver got the RPC but has not replied yet.
RUNNING Task task is running, used only for SMP schedulers.
The returned task state is just an approximate information. Timer and other hardware interrupts may cause a change in the state of the queried task before the caller could evaluate the returned value. Caller should disable interrupts if it wants reliable info about an other task. rt_get_task_state does not perform any check on pointer task. Definition at line 431 of file api.c.

References RT_TASK, and task.

int rt_get_type unsigned long  name  ) 
 

Definition at line 1677 of file api.c.

References get_type().

Referenced by rt_set_heap(), rt_shm_alloc_usp(), rt_shm_size(), rtai_shm_f_ioctl(), rtai_shm_f_mmap(), and rtai_shm_vm_close().

Here is the call graph for this function:

void rt_gettimeorig RTIME  time_orig[]  ) 
 

Definition at line 543 of file api.c.

References flags, llimd(), rtai_rdtsc, rtai_restore_flags, rtai_save_flags_and_cli, RTIME, and tuned.

Referenced by handle_lxrt_request().

Here is the call graph for this function:

void rt_irq_signal unsigned  irq  ) 
 

Definition at line 1782 of file api.c.

References cookie, rt_task_resume(), and rtai_realtime_irq.

Here is the call graph for this function:

int rt_irq_task_handler unsigned  irq,
RT_TASK irq_task
[static]
 

Definition at line 1789 of file api.c.

References RT_TASK, and rt_task_resume().

Referenced by rt_request_irq_task().

Here is the call graph for this function:

int rt_irq_wait unsigned  irq  ) 
 

Definition at line 1756 of file api.c.

References RT_IRQ_TASK_ERR, rt_task_suspend(), and rtai_realtime_irq.

Here is the call graph for this function:

int rt_irq_wait_if unsigned  irq  ) 
 

Definition at line 1763 of file api.c.

References RT_IRQ_TASK_ERR, rt_task_suspend_if(), and rtai_realtime_irq.

Here is the call graph for this function:

int rt_irq_wait_timed unsigned  irq,
RTIME  delay
 

Definition at line 1777 of file api.c.

References rt_irq_wait_until(), and RTIME.

Here is the call graph for this function:

int rt_irq_wait_until unsigned  irq,
RTIME  time
 

Definition at line 1770 of file api.c.

References RT_IRQ_TASK_ERR, rt_task_suspend_until(), rtai_realtime_irq, and RTIME.

Referenced by rt_irq_wait_timed().

Here is the call graph for this function:

void rt_linux_use_fpu int  use_fpu_flag  ) 
 

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.

Parameters:
use_fpu_flag If this parameter has a nonzero value, the Floating Point Unit (FPU) context is also switched when task or the kernel becomes active. This makes task switching slower, negligibly, on all 32 bits CPUs but 386s and the oldest 486s. This flag can be set also by rt_task_init when the real time task is created. With UP and MUP schedulers care is taken to avoid useless saves/ restores of the FPU environment. Under SMP tasks can be moved from CPU to CPU so saves/restores for tasks using the FPU are always carried out. Note that by default Linux has this flag cleared. Beside by using rt_linux_use_fpu you can change the Linux FPU flag when you insmod any RTAI scheduler module by setting the LinuxFpu command line parameter of the rtai_sched module itself.
Returns:
0 on success. A negative value on failure as described below:
  • EINVAL: task does not refer to a valid task.
See also: rt_linux_use_fpu(). Definition at line 466 of file api.c.

References cpuid.

int rt_named_task_delete RT_TASK task  ) 
 

Definition at line 1035 of file api.c.

References rt_drg_on_adr(), rt_free(), RT_TASK, rt_task_delete(), and task.

Referenced by krtai_objects_release().

Here is the call graph for this function:

RT_TASK* rt_named_task_init const char *  task_name,
void(*  thread)(long),
long  data,
int  stack_size,
int  prio,
int  uses_fpu,
void(*  signal)(void)
 

Definition at line 999 of file api.c.

References IS_TASK, nam2num(), rt_free(), rt_get_adr(), rt_malloc(), rt_register(), RT_TASK, rt_task_delete(), rt_task_init(), and task.

Here is the call graph for this function:

RT_TASK* rt_named_task_init_cpuid const char *  task_name,
void(*  thread)(long),
long  data,
int  stack_size,
int  prio,
int  uses_fpu,
void(*  signal)(void),
unsigned int  run_on_cpu
 

Definition at line 1017 of file api.c.

References IS_TASK, nam2num(), rt_free(), rt_get_adr(), rt_malloc(), rt_register(), RT_TASK, rt_task_delete(), rt_task_init_cpuid(), and task.

Here is the call graph for this function:

int rt_nanosleep struct timespec *  rqtp,
struct timespec *  rmtp
 

Definition at line 919 of file api.c.

References count2timespec(), rt_get_time(), rt_sleep_until(), RTIME, and timespec2count().

Here is the call graph for this function:

RT_TASK* rt_receive_linux_syscall RT_TASK task,
struct pt_regs *  regs
 

Definition at line 1857 of file api.c.

References dequeue_blocked(), enqueue_blocked(), flags, RT_SCHED_RECEIVE, RT_SCHED_RETURN, RT_SCHED_RPC, rt_schedule(), rt_smp_current, RT_TASK, and task.

Referenced by linux_syscall_server_fun().

Here is the call graph for this function:

int rt_registry_alloc void   ) 
 

Definition at line 1369 of file api.c.

References lxrt_list, max_slots, MAX_SLOTS, primes, PRIMES_TAB_GRANULARITY, and printk().

Referenced by __rtai_lxrt_init().

Here is the call graph for this function:

void rt_registry_free void   ) 
 

Definition at line 1384 of file api.c.

References lxrt_list.

Referenced by __rtai_lxrt_exit(), and __rtai_lxrt_init().

int rt_release_irq_task unsigned  irq  ) 
 

Definition at line 1809 of file api.c.

References rt_release_irq(), rt_reset_irq_to_sym_mode(), RT_TASK, rt_task_resume(), rtai_realtime_irq, and task.

Here is the call graph for this function:

void rt_rem_ready_current RT_TASK rt_current  ) 
 

Definition at line 958 of file api.c.

References RT_TASK.

void rt_rem_ready_task RT_TASK task  ) 
 

Definition at line 953 of file api.c.

References RT_TASK, and task.

void rt_rem_timed_task RT_TASK task  ) 
 

Definition at line 977 of file api.c.

References RT_TASK, and task.

int rt_renq_current RT_TASK rt_current,
int  priority
 

Definition at line 992 of file api.c.

References RT_TASK.

int rt_renq_ready_task RT_TASK ready_task,
int  priority
 

Definition at line 948 of file api.c.

References RT_TASK.

int rt_request_irq_task unsigned  irq,
void *  handler,
int  type,
int  affine2task
 

Definition at line 1795 of file api.c.

References handler, rt_assign_irq_to_cpu(), rt_irq_task_handler(), RT_IRQ_TASKLET, rt_request_irq(), RT_TASK, and task.

Here is the call graph for this function:

void rt_return_linux_syscall RT_TASK task,
unsigned long  retval
 

Definition at line 1883 of file api.c.

References dequeue_blocked(), flags, RT_SCHED_READY, RT_SCHED_RETURN, RT_TASK, and task.

Referenced by linux_syscall_server_fun().

Here is the call graph for this function:

int rt_set_period RT_TASK task,
RTIME  new_period
 

Definition at line 757 of file api.c.

References flags, RT_TASK, rtai_restore_flags, rtai_save_flags_and_cli, RTIME, and task.

int rt_set_resume_time RT_TASK task,
RTIME  new_resume_time
 

Definition at line 736 of file api.c.

References flags, RT_SCHED_DELAYED, RT_TASK, RTIME, and task.

void rt_set_sched_policy RT_TASK task,
int  policy,
int  rr_quantum_ns
 

Definition at line 34 of file api.c.

References rt_times::linux_tick, nano2count_cpuid(), rt_smp_times, RT_TASK, and task.

Here is the call graph for this function:

int rt_sleep RTIME  delay  ) 
 

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.

Parameters:
delay Corresponds to the time the task is going to be suspended.
See also: rt_busy_sleep(), rt_sleep_until().

Note:
A higher priority task or interrupt handler can run before the task goes to sleep, so the actual time spent in these functions may be longer than the the one specified.
Definition at line 834 of file api.c.

References flags, RT_SCHED_DELAYED, rt_schedule(), and RTIME.

Referenced by RT_sleep(), and RT_sleep_until().

Here is the call graph for this function:

int rt_sleep_until RTIME  time  ) 
 

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.

Parameters:
time Absolute time till the task have to be suspended
See also: rt_busy_sleep(), rt_sleep_until().

Note:
A higher priority task or interrupt handler can run before the task goes to sleep, so the actual time spent in these functions may be longer than the the one specified.
Definition at line 868 of file api.c.

References flags, RT_SCHED_DELAYED, rt_schedule(), and RTIME.

Referenced by nanosleep_rt(), rt_nanosleep(), and rt_timers_manager().

Here is the call graph for this function:

int rt_task_make_periodic RT_TASK task,
RTIME  start_time,
RTIME  period
 

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.

Parameters:
task is a pointer to the task you want to make periodic.
start_time is the absolute time to wait before the task start running, in clock ticks.
period corresponds to the period of the task, in clock ticks.
Return values:
0 on success. A negative value on failure as described below:
  • EINVAL: task does not refer to a valid task.
See also: rt_task_make_periodic_relative_ns(). Recall that the term clock ticks depends on the mode in which the hard timer runs. So if the hard timer was set as periodic a clock tick will last as the period set in start_rt_timer, while if oneshot mode is used a clock tick will last as the inverse of the running frequency of the hard timer in use and irrespective of any period used in the call to start_rt_timer. Definition at line 647 of file api.c.

References flags, RT_SCHED_DELAYED, RT_SCHED_SUSPENDED, RT_TASK, RTIME, and task.

Referenced by __rtai_wd_init(), main(), and user_srq().

int rt_task_make_periodic_relative_ns RT_TASK task,
RTIME  start_delay,
RTIME  period
 

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.

Parameters:
task is a pointer to the task you want to make periodic.
start_delay is the time, to wait before the task start running, in nanoseconds.
period corresponds to the period of the task, in nanoseconds.
Return values:
0 on success. A negative value on failure as described below:
  • EINVAL: task does not refer to a valid task.
Recall that the term clock ticks depends on the mode in which the hard timer runs. So if the hard timer was set as periodic a clock tick will last as the period set in start_rt_timer, while if oneshot mode is used a clock tick will last as the inverse of the running frequency of the hard timer in use and irrespective of any period used in the call to start_rt_timer. Definition at line 588 of file api.c.

References flags, nano2count_cpuid(), rt_get_time_cpuid(), RT_SCHED_DELAYED, RT_SCHED_SUSPENDED, RT_TASK, RTIME, and task.

Here is the call graph for this function:

int rt_task_masked_unblock RT_TASK task,
unsigned long  mask
 

Definition at line 886 of file api.c.

References flags, RT_SCHED_DELAYED, RT_SCHED_READY, RT_SCHED_RETURN, RT_SCHED_RPC, RT_SCHED_SEMAPHORE, RT_SCHED_SEND, RT_TASK, SEM, and task.

Referenced by __task_delete(), and rt_signal_wake_up().

int rt_task_resume RT_TASK task  ) 
 

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.

Parameters:
task pointer to a task structure.
Returns:
0 on success. A negative value on failure as described below:
  • EINVAL: task does not refer to a valid task.
Note:
the new RTAI 24.1.xx (FIXME) development releases take into account multiple suspend and require as many rt_task_resumes as the rt_task_suspends placed on a task.
Definition at line 370 of file api.c.

References flags, RT_SCHED_DELAYED, RT_SCHED_READY, RT_SCHED_SUSPENDED, RT_TASK, and task.

Referenced by __rtai_netrpc_init(), __rtai_tasklets_init(), check_slipping_badtask(), handle_lxrt_request(), kthread_m(), lxrt_exit(), port_server_fun(), rt_irq_signal(), rt_irq_task_handler(), rt_release_irq_task(), rt_request_signal(), rt_request_signal_(), RT_task_resume(), rt_timers_manager(), rt_Trigger(), rt_trigger(), signal_suprt_fun(), smpproof_task_delete(), and smpproof_task_suspend().

void rt_task_set_resume_end_times RTIME  resume,
RTIME  end
 

Definition at line 710 of file api.c.

References flags, RT_SCHED_DELAYED, rt_schedule(), RT_TASK, and RTIME.

Here is the call graph for this function:

int rt_task_signal_handler RT_TASK task,
void(*  handler)(void)
 

Set the signal handler of a task.

rt_task_signal_handler installs, or changes, the signal function of a real time task.

Parameters:
task is a pointer to the real time task.
handler is the entry point of the signal function.
A signal handler function can be set also when the task is newly created with rt_task_init(). The signal handler is a function called within the task environment and with interrupts disabled, when the task becomes the current running task after a context switch, except at its very first scheduling. It allows you to implement whatever signal management policy you think useful, and many other things as well (FIXME).

Returns:
0 on success.A negative value on failure as described below:
  • EINVAL: task does not refer to a valid task.
Definition at line 532 of file api.c.

References handler, RT_TASK, and task.

int rt_task_suspend RT_TASK 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.

Parameters:
task pointer to a task structure.
Returns:
0 on success. A negative value on failure as described below:
  • EINVAL: task does not refer to a valid task.
Note:
the new RTAI 24.1.xx (FIXME) development releases take into account multiple suspend and require as many rt_task_resume() as the rt_task_suspends placed on a task.
Definition at line 256 of file api.c.

References flags, RT_SCHED_SUSPENDED, rt_schedule(), RT_TASK, and task.

Referenced by dummy(), get_kthread(), hard_stub_fun(), kthread_fun(), lxrt_handle_trap(), Proxy_Task(), proxy_task(), rt_irq_wait(), rt_request_signal(), rt_signal_helper(), RT_task_suspend(), smpproof_task_suspend(), spv(), and support_tasklet().

Here is the call graph for this function:

int rt_task_suspend_if RT_TASK task  ) 
 

Definition at line 284 of file api.c.

References flags, RT_TASK, and task.

Referenced by rt_irq_wait_if().

int rt_task_suspend_timed RT_TASK task,
RTIME  delay
 

Definition at line 345 of file api.c.

References RT_TASK, rt_task_suspend_until(), RTIME, and task.

Here is the call graph for this function:

int rt_task_suspend_until RT_TASK task,
RTIME  time
 

Definition at line 303 of file api.c.

References cpuid, flags, RT_SCHED_DELAYED, RT_SCHED_SUSPENDED, rt_schedule(), RT_TASK, RTIME, SEM_TIMOUT, and task.

Referenced by rt_irq_wait_until(), and rt_task_suspend_timed().

Here is the call graph for this function:

int rt_task_use_fpu RT_TASK task,
int  use_fpu_flag
 

rt_task_use_fpu informs the scheduler that floating point arithmetic operations will be used by the real time task task.

Parameters:
task is a pointer to the real time task.
use_fpu_flag If this parameter has a nonzero value, the Floating Point Unit (FPU) context is also switched when task or the kernel becomes active. This makes task switching slower, negligibly, on all 32 bits CPUs but 386s and the oldest 486s. This flag can be set also by rt_task_init() when the real time task is created. With UP and MUP schedulers care is taken to avoid useless saves/restores of the FPU environment. Under SMP tasks can be moved from CPU to CPU so saves/restores for tasks using the FPU are always carried out.
Returns:
0 on success. A negative value on failure as described below:
  • EINVAL: task does not refer to a valid task.
See also: rt_linux_use_fpu(). Definition at line 500 of file api.c.

References RT_TASK, and task.

Referenced by rt_tasklet_use_fpu().

int rt_task_wait_period void   ) 
 

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().

Note:
The task is suspended only temporarily, i.e. it simply gives up control until the next time period.
Definition at line 684 of file api.c.

References cpuid, flags, RT_SCHED_DELAYED, rt_schedule(), rt_smp_times, rtai_rdtsc, and rt_times::tick_time.

Here is the call graph for this function:

void rt_task_yield void   ) 
 

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. Definition at line 215 of file api.c.

References flags, rt_schedule(), RT_TASK, and task.

Here is the call graph for this function:

void rt_wake_up_timed_tasks int  cpuid  ) 
 

Definition at line 968 of file api.c.

References cpuid.

RT_TASK* rt_whoami void   ) 
 

Get the task pointer of the current task.

Calling rt_whoami from a task can get a pointer to its own task structure.

Returns:
The pointer to the current task.
Definition at line 191 of file api.c.

References RT_TASK.

Referenced by watchdog().

void usp_request_rtc int  ,
void * 
 

Definition at line 1822 of file api.c.

References handler, rt_irq_signal(), and rt_request_rtc().

Here is the call graph for this function:


Variable Documentation

unsigned long long col [static]
 

Definition at line 1054 of file api.c.

void* cookie
 

Definition at line 1751 of file api.c.

int cpumask
 

Definition at line 1753 of file api.c.

int(* handler)(unsigned irq, void *cookie)
 

spinlock_t list_lock = SPIN_LOCK_UNLOCKED [static]
 

Definition at line 1051 of file api.c.

Referenced by get_name(), hash_find_adr(), hash_find_name(), hash_ins_adr(), hash_ins_name(), hash_rem_adr(), hash_rem_name(), and rt_get_registry_slot().

struct rt_registry_entry* lxrt_list [static]
 

Definition at line 1050 of file api.c.

Referenced by drg_on_adr(), drg_on_adr_cnt(), drg_on_name(), drg_on_name_cnt(), get_adr(), get_adr_cnt(), get_name(), get_type(), is_process_registered(), registr(), rt_get_registry_slot(), rt_registry_alloc(), and rt_registry_free().

int max_slots
 

Definition at line 1049 of file api.c.

Referenced by __rtai_shm_exit(), drg_on_adr(), drg_on_adr_cnt(), drg_on_name(), drg_on_name_cnt(), get_adr(), get_adr_cnt(), get_name(), get_type(), is_process_registered(), krtai_objects_release(), linux_process_termination(), registr(), and rt_registry_alloc().

unsigned short primes[] [static]
 

Initial value:

{ 1, 103, 211, 307, 401, 503, 601, 701, 809, 907, 1009, 1103, 1201, 1301, 1409, 1511, 1601, 1709, 1801, 1901, 2003, 2111, 2203, 2309, 2411, 2503, 2609, 2707, 2801, 2903, 3001, 3109, 3203, 3301, 3407, 3511, 3607, 3701, 3803, 3907, 4001, 4111, 4201, 4327, 4409, 4507, 4603, 4703, 4801, 4903, 5003, 5101, 5209, 5303, 5407, 5501, 5623, 5701, 5801, 5903, 6007, 6101, 6203, 6301, 6421, 6521, 6607, 6703, 6803, 6907, 7001, 7103, 7207, 7307, 7411, 7507, 7603, 7703, 7817, 7901, 8009, 8101, 8209, 8311, 8419, 8501, 8609, 8707, 8803, 8923, 9001, 9103, 9203, 9311, 9403, 9511, 9601, 9719, 9803, 9901, 10007, 10103, 10211, 10301, 10427, 10501, 10601, 10709, 10831, 10903, 11003, 11113, 11213, 11311, 11411, 11503, 11597, 11617, 11701, 11801, 11903, 12007, 12101, 12203, 12301, 12401, 12503, 12601, 12703, 12809, 12907, 13001, 13103, 13217, 13309, 13411, 13513, 13613, 13709, 13807, 13901, 14009, 14107, 14207, 14303, 14401, 14503, 14621, 14713, 14813, 14923, 15013, 15101, 15217, 15307, 15401, 15511, 15601, 15727, 15803, 15901, 16001, 16103, 16217, 16301, 16411, 16519, 16603, 16703, 16811, 16901, 17011, 17107, 17203, 17317, 17401, 17509, 17609, 17707, 17807, 17903, 18013, 18119, 18211, 18301, 18401, 18503, 18617, 18701, 18803, 18911, 19001, 19121, 19207, 19301, 19403, 19501, 19603, 19709, 19801, 19913, 20011, 20101 }
Definition at line 1064 of file api.c.

Referenced by rt_registry_alloc().

int retmode
 

Definition at line 1752 of file api.c.

struct rt_fun_entry rt_fun_lxrt[]
 

Definition at line 1541 of file sched.c.

Referenced by __rtai_netrpc_init(), init_fun_ext(), krtai_objects_release(), lxrt_init(), reset_rt_fun_entries(), rt_get_lxrt_fun_entry(), and set_rt_fun_entries().

struct { ... } rtai_realtime_irq[]
 


Generated on Thu Nov 20 11:56:49 2008 for RTAI API by doxygen 1.3.8