base/sched/sys.c File Reference

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/config.h>
#include <linux/version.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/unistd.h>
#include <linux/mman.h>
#include <asm/uaccess.h>
#include <rtai_sched.h>
#include <rtai_lxrt.h>
#include <rtai_sem.h>
#include <rtai_mbx.h>
#include <rtai_rwl.h>
#include <rtai_spl.h>
#include <asm/rtai_fpu.h>
#include <rtai_registry.h>
#include <rtai_proxies.h>
#include <rtai_msg.h>
#include <rtai_schedcore.h>

Include dependency graph for sys.c:

Include dependency graph

Go to the source code of this file.

Defines

#define MAX_FUN_EXT   16
#define USRLAND_MAX_MSG_SIZE   128
#define lxrt_sem_delete(sem)   GENERIC_DELETE(SEM_DELETE, sem)
#define lxrt_named_sem_delete(sem)   GENERIC_DELETE(NAMED_SEM_DELETE, sem)
#define lxrt_rwl_delete(rwl)   GENERIC_DELETE(RWL_DELETE, rwl)
#define lxrt_named_rwl_delete(rwl)   GENERIC_DELETE(NAMED_RWL_DELETE, rwl)
#define lxrt_spl_delete(spl)   GENERIC_DELETE(SPL_DELETE, spl)
#define lxrt_named_spl_delete(spl)   GENERIC_DELETE(NAMED_SPL_DELETE, spl)
#define lxrt_mbx_delete(mbx)   GENERIC_DELETE(MBX_DELETE, mbx)
#define lxrt_named_mbx_delete(mbx)   GENERIC_DELETE(NAMED_MBX_DELETE, mbx)
#define SYSW_DIAG_MSG(x)
#define larg   ((struct arg *)arg)

Functions

int get_min_tasks_cpuid (void)
int set_rtext (RT_TASK *task, int priority, int uses_fpu, void(*signal)(void), unsigned int cpuid, struct task_struct *relink)
int clr_rtext (RT_TASK *task)
void steal_from_linux (RT_TASK *task)
void give_back_to_linux (RT_TASK *task, int)
void rt_schedule_soft (RT_TASK *task)
void * rt_get_lxrt_fun_entry (int index)
void lxrt_typed_sem_init (SEM *sem, int count, int type)
int lxrt_typed_mbx_init (MBX *mbx, int bufsize, int type)
int lxrt_rwl_init (RWL *rwl)
int lxrt_spl_init (SPL *spl)
int lxrt_Proxy_detach (pid_t pid)
int GENERIC_DELETE (int index, void *object)
void lxrt_resume (void *fun, int narg, long *arg, unsigned long type, RT_TASK *rt_task)
RT_TASK__task_init (unsigned long name, int prio, int stack_size, int max_msg_size, int cpus_allowed)
int __task_delete (RT_TASK *rt_task)
long long handle_lxrt_request (unsigned int lxsrq, long *arg, RT_TASK *task)
void force_soft (RT_TASK *task)
int FASTCALL (do_signal(struct pt_regs *regs, sigset_t *oldset))
int rt_do_signal (struct pt_regs *regs, RT_TASK *task)
long long rtai_lxrt_invoke (unsigned int lxsrq, void *arg, struct pt_regs *regs)
int set_rt_fun_ext_index (struct rt_fun_entry *fun, int idx)
void reset_rt_fun_ext_index (struct rt_fun_entry *fun, int idx)
void linux_process_termination (void)
void init_fun_ext (void)

Variables

rt_fun_entry * rt_fun_ext [MAX_FUN_EXT]


Define Documentation

#define larg   ((struct arg *)arg)
 

Referenced by handle_lxrt_request().

#define lxrt_mbx_delete mbx   )     GENERIC_DELETE(MBX_DELETE, mbx)
 

Definition at line 121 of file sys.c.

Referenced by handle_lxrt_request(), and linux_process_termination().

#define lxrt_named_mbx_delete mbx   )     GENERIC_DELETE(NAMED_MBX_DELETE, mbx)
 

Definition at line 122 of file sys.c.

#define lxrt_named_rwl_delete rwl   )     GENERIC_DELETE(NAMED_RWL_DELETE, rwl)
 

Definition at line 118 of file sys.c.

#define lxrt_named_sem_delete sem   )     GENERIC_DELETE(NAMED_SEM_DELETE, sem)
 

Definition at line 116 of file sys.c.

#define lxrt_named_spl_delete spl   )     GENERIC_DELETE(NAMED_SPL_DELETE, spl)
 

Definition at line 120 of file sys.c.

#define lxrt_rwl_delete rwl   )     GENERIC_DELETE(RWL_DELETE, rwl)
 

Definition at line 117 of file sys.c.

Referenced by handle_lxrt_request(), and linux_process_termination().

#define lxrt_sem_delete sem   )     GENERIC_DELETE(SEM_DELETE, sem)
 

Definition at line 115 of file sys.c.

Referenced by handle_lxrt_request(), and linux_process_termination().

#define lxrt_spl_delete spl   )     GENERIC_DELETE(SPL_DELETE, spl)
 

Definition at line 119 of file sys.c.

Referenced by handle_lxrt_request(), and linux_process_termination().

#define MAX_FUN_EXT   16
 

Definition at line 49 of file sys.c.

Referenced by reset_rt_fun_ext_index(), and set_rt_fun_ext_index().

#define SYSW_DIAG_MSG  ) 
 

Definition at line 288 of file sys.c.

#define USRLAND_MAX_MSG_SIZE   128
 

Definition at line 55 of file sys.c.

Referenced by __task_init().


Function Documentation

int __task_delete RT_TASK rt_task  )  [static]
 

Definition at line 263 of file sys.c.

References clr_rtext(), give_back_to_linux(), rt_drg_on_adr(), rt_free(), RT_SCHED_READY, RT_TASK, rt_task_masked_unblock(), TSKEXT0, and TSKEXT1.

Referenced by handle_lxrt_request().

Here is the call graph for this function:

RT_TASK* __task_init unsigned long  name,
int  prio,
int  stack_size,
int  max_msg_size,
int  cpus_allowed
[inline, static]
 

Definition at line 215 of file sys.c.

References clr_rtext(), ffnz(), get_min_tasks_cpuid(), IS_TASK, rt_free(), rt_get_adr(), rt_malloc(), rt_register(), RT_SCHED_LOWEST_PRIORITY, RT_TASK, set_rtext(), and USRLAND_MAX_MSG_SIZE.

Referenced by handle_lxrt_request().

Here is the call graph for this function:

int clr_rtext RT_TASK task  ) 
 

Definition at line 1014 of file sched.c.

References flags, frstk_srq, MAX_FRESTK_SRQ, MBX, rt_pend_linux_srq(), RT_SCHED_DELAYED, RT_SCHED_LINUX_PRIORITY, RT_SCHED_MBXSUSP, RT_SCHED_READY, RT_SCHED_RETURN, RT_SCHED_RPC, RT_SCHED_SEMAPHORE, RT_SCHED_SEND, rt_schedule(), rt_smp_fpu_task, rt_smp_linux_task, RT_TASK, sched_sem_signal(), SEM, task, and tasks_per_cpu.

Referenced by __task_delete(), __task_init(), kthread_fun(), linux_process_termination(), rt_task_delete(), and soft_kthread_delete().

Here is the call graph for this function:

int FASTCALL do_signal(struct pt_regs *regs, sigset_t *oldset)   ) 
 

void force_soft RT_TASK task  )  [inline, static]
 

Definition at line 568 of file sys.c.

References FORCE_SOFT, give_back_to_linux(), RT_TASK, task, and unlikely.

Referenced by rtai_lxrt_invoke().

Here is the call graph for this function:

int GENERIC_DELETE int  index,
void *  object
[inline, static]
 

Definition at line 110 of file sys.c.

References rt_get_lxrt_fun_entry().

Here is the call graph for this function:

int get_min_tasks_cpuid void   ) 
 

Definition at line 224 of file sched.c.

References cpuid, NR_RT_CPUS, and tasks_per_cpu.

void give_back_to_linux RT_TASK task,
int 
 

Definition at line 2029 of file sched.c.

References hal_schedule_back_root, pend_wake_up_hts, rt_schedule(), and RT_TASK.

Referenced by __task_delete(), force_soft(), handle_lxrt_request(), kthread_fun(), lxrt_handle_trap(), lxrt_intercept_exit(), lxrt_intercept_syscall_prologue(), and rt_do_signal().

Here is the call graph for this function:

long long handle_lxrt_request unsigned int  lxsrq,
long *  arg,
RT_TASK task
[inline, static]
 

Definition at line 291 of file sys.c.

References __task_delete(), __task_init(), clear_lnxtsk_uses_fpu, flags, FORCE_SOFT, FORCE_TASK_SOFT, GET_EXECTIME, GET_TIMEORIG, GET_USP_FLAGS, GET_USP_FLG_MSK, give_back_to_linux(), HRT_USE_FPU, INDX, init_fpu, IS_HARD, IS_MBX, IS_SEM, larg, likely, LINUX_SERVER_INIT, LXRT_GET_ADR, LXRT_GET_NAME, lxrt_mbx_delete, LXRT_MBX_DELETE, LXRT_MBX_INIT, lxrt_resume(), lxrt_rwl_delete, LXRT_RWL_DELETE, lxrt_rwl_init(), LXRT_RWL_INIT, lxrt_sem_delete, LXRT_SEM_DELETE, LXRT_SEM_INIT, lxrt_spl_delete, LXRT_SPL_DELETE, lxrt_spl_init(), LXRT_SPL_INIT, LXRT_TASK_DELETE, LXRT_TASK_INIT, lxrt_typed_mbx_init(), lxrt_typed_sem_init(), MAKE_HARD_RT, MAKE_SOFT_RT, MAX_LXRT_FUN, MBX, NARG, NONROOT_HRT, PRINT_TO_SCREEN, PRINTK, rdtsc, RT_BUDDY, rt_do_force_soft(), rt_drg_on_adr(), rt_free(), rt_fun_ext, rt_get_adr(), rt_get_name(), rt_gettimeorig(), rt_malloc(), rt_printk(), rt_register(), RT_TASK, rt_task_resume(), rtai_print_to_screen(), RTIME, RWL, SEM, SET_USP_FLAGS, SET_USP_FLG_MSK, SPL, SRQ, srq, steal_from_linux(), SYSW_DIAG_MSG, task, TSKEXT0, TSKEXT1, and unlikely.

Referenced by rtai_lxrt_invoke().

Here is the call graph for this function:

void init_fun_ext void   ) 
 

Definition at line 714 of file sys.c.

References NR_RT_CPUS, reset_rt_fun_ext_index(), rt_fun_ext, rt_fun_lxrt, rt_get_base_linux_task(), RT_TASK, and set_rt_fun_ext_index().

Referenced by lxrt_init().

Here is the call graph for this function:

void linux_process_termination void   ) 
 

Definition at line 649 of file sys.c.

References rt_registry_entry::adr, clr_rtext(), IS_MBX, is_process_registered(), IS_PRX, IS_RWL, IS_SEM, IS_SPL, IS_TASK, lxrt_mbx_delete, lxrt_Proxy_detach(), lxrt_rwl_delete, lxrt_sem_delete, lxrt_spl_delete, max_slots, rt_registry_entry::name, num2nam(), rt_drg_on_adr(), rt_drg_on_name_cnt(), rt_free(), rt_get_registry_slot(), rt_printk(), RT_TASK, rt_registry_entry::tsk, TSKEXT0, TSKEXT1, and rt_registry_entry::type.

Referenced by lxrt_intercept_exit().

Here is the call graph for this function:

int lxrt_Proxy_detach pid_t  pid  )  [inline, static]
 

Definition at line 105 of file sys.c.

References pid, PROXY_DETACH, and rt_get_lxrt_fun_entry().

Referenced by linux_process_termination().

Here is the call graph for this function:

void lxrt_resume void *  fun,
int  narg,
long *  arg,
unsigned long  type,
RT_TASK rt_task
[inline, static]
 

Definition at line 124 of file sys.c.

References cpuid, likely, rt_free(), rt_malloc(), rt_schedule_soft(), rt_schedule_soft_tail(), RT_TASK, and unlikely.

Referenced by handle_lxrt_request().

Here is the call graph for this function:

int lxrt_rwl_init RWL rwl  )  [inline, static]
 

Definition at line 95 of file sys.c.

References rt_get_lxrt_fun_entry(), RWL, and RWL_INIT.

Referenced by handle_lxrt_request().

Here is the call graph for this function:

int lxrt_spl_init SPL spl  )  [inline, static]
 

Definition at line 100 of file sys.c.

References rt_get_lxrt_fun_entry(), SPL, and SPL_INIT.

Referenced by handle_lxrt_request().

Here is the call graph for this function:

int lxrt_typed_mbx_init MBX mbx,
int  bufsize,
int  type
[inline, static]
 

Definition at line 90 of file sys.c.

References MBX, rt_get_lxrt_fun_entry(), and TYPED_MBX_INIT.

Referenced by handle_lxrt_request().

Here is the call graph for this function:

void lxrt_typed_sem_init SEM sem,
int  count,
int  type
[inline, static]
 

Definition at line 85 of file sys.c.

References count, rt_get_lxrt_fun_entry(), SEM, and TYPED_SEM_INIT.

Referenced by handle_lxrt_request().

Here is the call graph for this function:

void reset_rt_fun_ext_index struct rt_fun_entry *  fun,
int  idx
 

Definition at line 642 of file sys.c.

References MAX_FUN_EXT, and rt_fun_ext.

Referenced by cleanup_module(), and init_fun_ext().

int rt_do_signal struct pt_regs *  regs,
RT_TASK task
[inline, static]
 

Definition at line 578 of file sys.c.

References give_back_to_linux(), likely, RT_TASK, RTAI_SYSCALL_NR, steal_from_linux(), task, and unlikely.

Referenced by rtai_lxrt_invoke().

Here is the call graph for this function:

void* rt_get_lxrt_fun_entry int  index  ) 
 

Referenced by GENERIC_DELETE(), lxrt_Proxy_detach(), lxrt_rwl_init(), lxrt_spl_init(), lxrt_typed_mbx_init(), lxrt_typed_sem_init(), and sched_sem_signal().

void rt_schedule_soft RT_TASK task  ) 
 

Definition at line 1774 of file sched.c.

References _rt_schedule_soft_tail(), cpuid, enq_soft_ready_task, LOCK_LINUX_NOTSKPRI, RT_SCHED_READY, rt_smp_current, and RT_TASK.

Referenced by lxrt_resume(), soft_rt_fun_call(), and soft_rt_genfun_call().

Here is the call graph for this function:

long long rtai_lxrt_invoke unsigned int  lxsrq,
void *  arg,
struct pt_regs *  regs
 

Definition at line 602 of file sys.c.

References force_soft(), handle_lxrt_request(), likely, rt_do_signal(), RT_EINTR, RT_TASK, task, TSKEXT0, and unlikely.

Referenced by lxrt_intercept_syscall_prologue().

Here is the call graph for this function:

int set_rt_fun_ext_index struct rt_fun_entry *  fun,
int  idx
 

Definition at line 633 of file sys.c.

References MAX_FUN_EXT, and rt_fun_ext.

Referenced by init_fun_ext(), and init_module().

int set_rtext RT_TASK task,
int  priority,
int  uses_fpu,
void(*  signal)(void),
unsigned int  cpuid,
struct task_struct *  relink
 

Definition at line 255 of file sched.c.

References atomic_inc(), cpuid, flags, lxrt_wdog_task, NR_RT_CPUS, put_current_on_cpu(), rt_printk(), RT_SCHED_HIGHEST_PRIORITY, RT_SCHED_READY, RT_SCHED_SUSPENDED, RT_TASK, RT_TIME_END, RTAI_NR_TRAPS, task, tasks_per_cpu, TSKEXT0, and TSKEXT1.

Referenced by __task_init(), lxrt_exit(), start_stop_kthread(), and thread_fun().

Here is the call graph for this function:

void steal_from_linux RT_TASK task  ) 
 

Definition at line 1993 of file sched.c.

References klistb, lnxtsk_uses_fpu, rdtsc, restore_fpu, RT_SCHED_READY, RT_TASK, rtai_cli, and rtai_sti.

Referenced by handle_lxrt_request(), kthread_fun(), lxrt_intercept_syscall_epilogue(), lxrt_intercept_syscall_prologue(), and rt_do_signal().


Variable Documentation

struct rt_fun_entry* rt_fun_ext[MAX_FUN_EXT] [static]
 

Definition at line 50 of file sys.c.

Referenced by handle_lxrt_request(), init_fun_ext(), reset_rt_fun_ext_index(), and set_rt_fun_ext_index().


Generated on Thu Nov 20 11:57:23 2008 for RTAI API by doxygen 1.3.8