base/wd/wd.c File Reference

Include dependency graph for wd.c:

Go to the source code of this file.

Defines

#define DBUG(x...)
#define MY_ALLOC
#define BAD_TASK_MAX   100

Functions

 MODULE_LICENSE ("GPL")
 RTAI_MODULE_PARM (TickPeriod, int)
 RTAI_MODULE_PARM (wd_OneShot, int)
 RTAI_MODULE_PARM (Grace, int)
 RTAI_MODULE_PARM (GraceDiv, int)
 RTAI_MODULE_PARM (Safety, int)
 RTAI_MODULE_PARM (Policy, int)
 RTAI_MODULE_PARM (Stretch, int)
 RTAI_MODULE_PARM (Slip, int)
 RTAI_MODULE_PARM (Limit, int)
 RTAI_MODULE_PARM (LooperTimeLimit, int)
RTAI_SYSCALL_MODE int rt_wdset_grace (int new)
RTAI_SYSCALL_MODE int rt_wdset_gracediv (int new)
RTAI_SYSCALL_MODE int rt_wdset_safety (int new)
RTAI_SYSCALL_MODE wd_policy rt_wdset_policy (wd_policy new)
RTAI_SYSCALL_MODE int rt_wdset_slip (int new)
RTAI_SYSCALL_MODE int rt_wdset_stretch (int new)
RTAI_SYSCALL_MODE int rt_wdset_limit (int new)
static BAD_RT_TASKnew_bad_task (void)
static void free_bad_task (BAD_RT_TASK *bt)
static void append_bad_task (BAD_RT_TASK **list, BAD_RT_TASK *new)
static BAD_RT_TASKdelete_bad_task (BAD_RT_TASK **list, BAD_RT_TASK *del)
static BAD_RT_TASKfind_bad_task (BAD_RT_TASK *list, RT_TASK *t)
static int which_cpu (RT_TASK *t)
static void smpproof_task_suspend (RT_TASK *t)
static void smpproof_task_delete (RT_TASK *t)
static void stretch_badtask (RT_TASK *t, BAD_RT_TASK *bt, int cpuid)
static void start_slipping_badtask (RT_TASK *t, BAD_RT_TASK *bt, int cpuid)
static void check_slipping_badtask (BAD_RT_TASK *bt)
static void handle_badtask (int wd, RT_TASK *t, BAD_RT_TASK *bt, RTIME overrun)
static void watch_looper (int cpuid, void *self, BAD_RT_TASK *bt)
static void watchdog (long wd)
static void dummy (long wd)
static struct rt_fun_entry
rt_watchdog_fun[] 
__attribute__ ((__unused__))
int __rtai_wd_init (void)
void __rtai_wd_exit (void)
 module_init (__rtai_wd_init)
 module_exit (__rtai_wd_exit)
 EXPORT_SYMBOL (rt_wdset_grace)
 EXPORT_SYMBOL (rt_wdset_gracediv)
 EXPORT_SYMBOL (rt_wdset_safety)
 EXPORT_SYMBOL (rt_wdset_policy)
 EXPORT_SYMBOL (rt_wdset_slip)
 EXPORT_SYMBOL (rt_wdset_stretch)
 EXPORT_SYMBOL (rt_wdset_limit)

Variables

static spinlock_t alloc_lock = SPIN_LOCK_UNLOCKED
static BAD_RT_TASK bad_task_pool [BAD_TASK_MAX]
static char version [] = "$Revision: 1.14 $"
static char ver [10]
static char * policy_name []
static int num_wdogs
static RT_TASK wdog [NR_RT_CPUS]
static RT_TASKtlists [NR_RT_CPUS]
static BAD_RT_TASKbad_tl [NR_RT_CPUS]
static int TickPeriod = 10000000
static int wd_OneShot = 1
static int Grace = 3
static int GraceDiv = 1
static int Safety = 100
static int Policy = WD_SUSPEND
static int Stretch = 10
static int Slip = 10
static int Limit = 100
static int LooperTimeLimit = 100
static int LooperLimit
static struct rt_fun_entry rt_watchdog_fun []


Define Documentation

#define BAD_TASK_MAX   100

Definition at line 137 of file wd.c.

Referenced by __rtai_wd_init(), and new_bad_task().

#define DBUG ( x...   ) 

Definition at line 124 of file wd.c.

Referenced by check_slipping_badtask(), smpproof_task_delete(), smpproof_task_suspend(), start_slipping_badtask(), stretch_badtask(), and watchdog().

#define MY_ALLOC

Definition at line 128 of file wd.c.


Function Documentation

static struct rt_fun_entry rt_watchdog_fun [] __attribute__ ( (__unused__)   )  [static]

void __rtai_wd_exit ( void   ) 

Definition at line 804 of file wd.c.

References bad_tl, delete_bad_task(), reset_rt_fun_ext_index(), rt_busy_sleep(), rt_deregister_watchdog(), rt_task_delete, rtai_proc_root, stop_rt_timer(), TickPeriod, WD_INDX, WDLOG, and wdog.

Here is the call graph for this function:

int __rtai_wd_init ( void   ) 

Definition at line 703 of file wd.c.

References BAD_TASK_MAX, dummy(), Grace, GraceDiv, imuldiv(), Limit, llimd(), LooperLimit, LooperTimeLimit, nano2count(), nano2count_cpuid(), NSECS_PER_SEC, period, Policy, policy_name, printk(), rt_deregister_watchdog(), rt_get_base_linux_task(), rt_get_time_cpuid(), rt_printk(), rt_register_watchdog(), RT_SCHED_HIGHEST_PRIORITY, rt_set_periodic_mode(), rt_task_init_cpuid(), rt_task_make_periodic(), rtai_proc_root, Safety, set_rt_fun_ext_index(), Slip, start_rt_timer(), Stretch, TickPeriod, tlists, ver, version, watchdog(), WD_DEBUG, WD_INDX, wd_OneShot, WD_STRETCH, WDLOG, and wdog.

Here is the call graph for this function:

static void append_bad_task ( BAD_RT_TASK **  list,
BAD_RT_TASK new 
) [static]

Definition at line 288 of file wd.c.

References bad_rt_task::next.

Referenced by handle_badtask().

static void check_slipping_badtask ( BAD_RT_TASK bt  )  [static]

Definition at line 378 of file wd.c.

References bad_rt_task::count, bad_rt_task::countdown, DBUG, rt_task_resume(), bad_rt_task::slipping, and bad_rt_task::task.

Referenced by watchdog().

Here is the call graph for this function:

static BAD_RT_TASK* delete_bad_task ( BAD_RT_TASK **  list,
BAD_RT_TASK del 
) [static]

Definition at line 300 of file wd.c.

References free_bad_task(), and bad_rt_task::next.

Referenced by __rtai_wd_exit().

Here is the call graph for this function:

static void dummy ( long  wd  )  [static]

Definition at line 582 of file wd.c.

References rt_task_suspend(), and wdog.

Referenced by __rtai_wd_init(), pthread_gettid_np(), pthread_wait_period_np(), rt_agent(), rt_allow_nonroot_hrt(), rt_boom(), RT_get_cpu_time_ns(), rt_get_cpu_time_ns(), rt_get_real_time(), rt_get_real_time_ns(), rt_get_time(), RT_get_time_ns(), rt_get_time_ns(), rt_get_timer_cpu(), rt_GetTickQueueHook(), rt_gettid(), rt_hard_timer_tick(), rt_InitTickQueue(), rt_is_hard_timer_running(), rt_make_hard_real_time(), rt_make_soft_real_time(), rt_mmgr_stats(), rt_qLoop(), rt_qStep(), rt_qSync(), rt_release_rtc(), rt_ReleaseTickQueue(), rt_sched_lock(), rt_sched_unlock(), rt_set_oneshot_mode(), rt_set_periodic_mode(), rt_stomp(), rt_sync_net_rpc(), rt_task_wait_period(), rt_task_yield(), rt_vc_reserve(), rtai_imuldiv(), and stop_ftimer().

Here is the call graph for this function:

EXPORT_SYMBOL ( rt_wdset_limit   ) 

EXPORT_SYMBOL ( rt_wdset_stretch   ) 

EXPORT_SYMBOL ( rt_wdset_slip   ) 

EXPORT_SYMBOL ( rt_wdset_policy   ) 

EXPORT_SYMBOL ( rt_wdset_safety   ) 

EXPORT_SYMBOL ( rt_wdset_gracediv   ) 

EXPORT_SYMBOL ( rt_wdset_grace   ) 

static BAD_RT_TASK* find_bad_task ( BAD_RT_TASK list,
RT_TASK t 
) [static]

Definition at line 314 of file wd.c.

References bad_rt_task::next, and bad_rt_task::task.

Referenced by watchdog().

static void free_bad_task ( BAD_RT_TASK bt  )  [static]

Definition at line 278 of file wd.c.

References bad_rt_task::in_use, and rt_free().

Referenced by delete_bad_task().

Here is the call graph for this function:

static void handle_badtask ( int  wd,
RT_TASK t,
BAD_RT_TASK bt,
RTIME  overrun 
) [static]

Definition at line 389 of file wd.c.

References append_bad_task(), bad_tl, bad_rt_task::count, bad_rt_task::countdown, bad_rt_task::forced, Limit, LooperTimeLimit, new_bad_task(), bad_rt_task::next, bad_rt_task::orig_period, Policy, bad_rt_task::policy, Safety, bad_rt_task::slipping, smpproof_task_delete(), smpproof_task_suspend(), start_slipping_badtask(), stretch_badtask(), bad_rt_task::task, bad_rt_task::valid, WD_DEBUG, WD_KILL, WD_NOTHING, WD_RESYNC, WD_SLIP, WD_STRETCH, WD_SUSPEND, and WDLOG.

Referenced by watch_looper().

Here is the call graph for this function:

module_exit ( __rtai_wd_exit   ) 

module_init ( __rtai_wd_init   ) 

MODULE_LICENSE ( "GPL"   ) 

static BAD_RT_TASK* new_bad_task ( void   )  [static]

Definition at line 258 of file wd.c.

References alloc_lock, BAD_TASK_MAX, bad_task_pool, and rt_malloc().

Referenced by handle_badtask().

Here is the call graph for this function:

RTAI_SYSCALL_MODE int rt_wdset_grace ( int  new  ) 

Definition at line 191 of file wd.c.

References Grace, Policy, and WD_STRETCH.

RTAI_SYSCALL_MODE int rt_wdset_gracediv ( int  new  ) 

Definition at line 201 of file wd.c.

References GraceDiv, Policy, and WD_STRETCH.

RTAI_SYSCALL_MODE int rt_wdset_limit ( int  new  ) 

Definition at line 249 of file wd.c.

References Limit.

RTAI_SYSCALL_MODE wd_policy rt_wdset_policy ( wd_policy  new  ) 

Definition at line 220 of file wd.c.

References Grace, GraceDiv, Limit, Policy, Safety, WD_DEBUG, WD_KILL, and WD_STRETCH.

RTAI_SYSCALL_MODE int rt_wdset_safety ( int  new  ) 

Definition at line 211 of file wd.c.

References Grace, and Safety.

RTAI_SYSCALL_MODE int rt_wdset_slip ( int  new  ) 

Definition at line 231 of file wd.c.

References Slip.

RTAI_SYSCALL_MODE int rt_wdset_stretch ( int  new  ) 

Definition at line 240 of file wd.c.

References Stretch.

RTAI_MODULE_PARM ( LooperTimeLimit  ,
int   
)

RTAI_MODULE_PARM ( Limit  ,
int   
)

RTAI_MODULE_PARM ( Slip  ,
int   
)

RTAI_MODULE_PARM ( Stretch  ,
int   
)

RTAI_MODULE_PARM ( Policy  ,
int   
)

RTAI_MODULE_PARM ( Safety  ,
int   
)

RTAI_MODULE_PARM ( GraceDiv  ,
int   
)

RTAI_MODULE_PARM ( Grace  ,
int   
)

RTAI_MODULE_PARM ( wd_OneShot  ,
int   
)

RTAI_MODULE_PARM ( TickPeriod  ,
int   
)

static void smpproof_task_delete ( RT_TASK t  )  [static]

Definition at line 343 of file wd.c.

References cpuid, DBUG, rt_task_delete, rt_task_resume(), wdog, and which_cpu().

Referenced by handle_badtask().

Here is the call graph for this function:

static void smpproof_task_suspend ( RT_TASK t  )  [static]

Definition at line 332 of file wd.c.

References cpuid, DBUG, rt_task_resume(), rt_task_suspend(), wdog, and which_cpu().

Referenced by handle_badtask(), and start_slipping_badtask().

Here is the call graph for this function:

static void start_slipping_badtask ( RT_TASK t,
BAD_RT_TASK bt,
int  cpuid 
) [static]

Definition at line 364 of file wd.c.

References bad_rt_task::count, count2nano_cpuid(), bad_rt_task::countdown, DBUG, llimd(), Slip, bad_rt_task::slipping, smpproof_task_suspend(), and TickPeriod.

Referenced by handle_badtask().

Here is the call graph for this function:

static void stretch_badtask ( RT_TASK t,
BAD_RT_TASK bt,
int  cpuid 
) [static]

Definition at line 355 of file wd.c.

References count2nano_cpuid(), DBUG, llimd(), bad_rt_task::orig_period, and Stretch.

Referenced by handle_badtask().

Here is the call graph for this function:

static void watch_looper ( int  cpuid,
void *  self,
BAD_RT_TASK bt 
) [static]

Definition at line 475 of file wd.c.

References handle_badtask(), LooperLimit, lxrt_prev_task, NR_RT_CPUS, rt_smp_linux_task, and WDLOG.

Here is the call graph for this function:

static void watchdog ( long  wd  )  [static]

Definition at line 494 of file wd.c.

References bad_tl, check_slipping_badtask(), DBUG, find_bad_task(), bad_rt_task::next, num_wdogs, rt_get_time_cpuid(), RT_SCHED_DELAYED, RT_SCHED_RECEIVE, RT_SCHED_RETURN, RT_SCHED_RPC, RT_SCHED_SEMAPHORE, RT_SCHED_SEND, RT_SCHED_SUSPENDED, rt_task_wait_period(), rt_whoami(), bad_rt_task::slipping, task, tlists, bad_rt_task::valid, and wdog.

Referenced by __rtai_wd_init().

Here is the call graph for this function:

static int which_cpu ( RT_TASK t  )  [inline, static]

Definition at line 326 of file wd.c.

Referenced by smpproof_task_delete(), and smpproof_task_suspend().


Variable Documentation

spinlock_t alloc_lock = SPIN_LOCK_UNLOCKED [static]

Definition at line 139 of file wd.c.

Referenced by new_bad_task().

BAD_RT_TASK bad_task_pool[BAD_TASK_MAX] [static]

Definition at line 140 of file wd.c.

Referenced by new_bad_task().

BAD_RT_TASK* bad_tl[NR_RT_CPUS] [static]

Definition at line 155 of file wd.c.

Referenced by __rtai_wd_exit(), handle_badtask(), and watchdog().

int Grace = 3 [static]

Definition at line 165 of file wd.c.

Referenced by __rtai_wd_init(), rt_wdset_grace(), rt_wdset_policy(), and rt_wdset_safety().

int GraceDiv = 1 [static]

Definition at line 168 of file wd.c.

Referenced by __rtai_wd_init(), rt_wdset_gracediv(), and rt_wdset_policy().

int Limit = 100 [static]

Definition at line 183 of file wd.c.

Referenced by __rtai_wd_init(), handle_badtask(), rt_wdset_limit(), and rt_wdset_policy().

int LooperLimit [static]

Definition at line 188 of file wd.c.

Referenced by __rtai_wd_init(), and watch_looper().

int LooperTimeLimit = 100 [static]

Definition at line 186 of file wd.c.

Referenced by __rtai_wd_init(), and handle_badtask().

int num_wdogs [static]

Definition at line 152 of file wd.c.

Referenced by watchdog().

int Policy = WD_SUSPEND [static]

Definition at line 174 of file wd.c.

Referenced by __rtai_wd_init(), handle_badtask(), rt_wdset_grace(), rt_wdset_gracediv(), and rt_wdset_policy().

char* policy_name[] [static]

Initial value:

 
    {"Nothing", "Resync", "Debug", "Stretch", "Slip", "Suspend", "Kill"}

Definition at line 148 of file wd.c.

Referenced by __rtai_wd_init().

struct rt_fun_entry rt_watchdog_fun[] [static]

Initial value:

Definition at line 692 of file wd.c.

int Safety = 100 [static]

Definition at line 171 of file wd.c.

Referenced by __rtai_wd_init(), handle_badtask(), rt_wdset_policy(), and rt_wdset_safety().

int Slip = 10 [static]

Definition at line 180 of file wd.c.

Referenced by __rtai_wd_init(), rt_wdset_slip(), and start_slipping_badtask().

int Stretch = 10 [static]

Definition at line 177 of file wd.c.

Referenced by __rtai_wd_init(), rt_wdset_stretch(), and stretch_badtask().

int TickPeriod = 10000000 [static]

Definition at line 159 of file wd.c.

Referenced by __rtai_wd_exit(), __rtai_wd_init(), and start_slipping_badtask().

RT_TASK* tlists[NR_RT_CPUS] [static]

Definition at line 154 of file wd.c.

Referenced by __rtai_wd_init(), and watchdog().

char ver[10] [static]

Definition at line 145 of file wd.c.

Referenced by __rtai_wd_init().

char version[] = "$Revision: 1.14 $" [static]

Definition at line 144 of file wd.c.

Referenced by __rtai_wd_init().

int wd_OneShot = 1 [static]

Definition at line 162 of file wd.c.

Referenced by __rtai_wd_init().

RT_TASK wdog[NR_RT_CPUS] [static]

Definition at line 153 of file wd.c.

Referenced by __rtai_wd_exit(), __rtai_wd_init(), dummy(), smpproof_task_delete(), smpproof_task_suspend(), and watchdog().


Generated on Tue Feb 2 17:48:18 2010 for RTAI API by  doxygen 1.4.7