2 * This is arch independent NMI watchdog implementaion part. It is used to
3 * detect kernel lockups and help debugging. each architecture must add its own
4 * low level code that triggers periodic checks
9 unsigned watchdog_local_timer_ticks
;
10 struct arch_watchdog
*watchdog
;
13 void nmi_watchdog_handler(struct nmi_frame
* frame
)
15 /* FIXME this should be CPU local */
16 static unsigned no_ticks
;
17 static unsigned last_tick_count
= (unsigned) -1;
20 * when debugging on serial console, printing takes a lot of time some
21 * times while the kernel is certainly not locked up. We don't want to
22 * report a lockup in such situation
24 if (serial_debug_active
)
25 goto reset_and_continue
;
27 if (last_tick_count
!= watchdog_local_timer_ticks
) {
29 printf("watchdog : kernel unlocked\n");
32 /* we are still ticking, everything seems good */
33 last_tick_count
= watchdog_local_timer_ticks
;
34 goto reset_and_continue
;
38 * if watchdog_local_timer_ticks didn't changed since last time, give it
39 * some more time and only if it still dead, trigger the watchdog alarm
41 if (++no_ticks
< 10) {
43 printf("WARNING watchdog : possible kernel lockup\n");
44 goto reset_and_continue
;
47 arch_watchdog_lockup(frame
);
51 watchdog
->reinit(cpuid
);