]> rtime.felk.cvut.cz Git - l4.git/blob - kernel/fiasco/src/kern/ia32/timer_irq.cpp
f0211efba1d0786e366eed633ab39f563b4183e8
[l4.git] / kernel / fiasco / src / kern / ia32 / timer_irq.cpp
1 //---------------------------------------------------------------------------
2 IMPLEMENTATION[ia32 || amd64]:
3
4 #include "config.h"
5 #include "globals.h"
6 #include "kernel_console.h"
7 #include "kdb_ke.h"
8 #include "timer.h"
9 #include "vkey.h"
10 #include "watchdog.h"
11
12
13 /** Slow version of timer interrupt.  Activated on every clock tick.
14     Checks if something related to debugging is to do. After returning
15     from this function, the real timer interrupt handler is called.
16  */
17 extern "C"
18 void
19 thread_timer_interrupt_slow(void)
20 {
21   if (!current_cpu())
22     {
23       if (Config::esc_hack)
24         {
25           // <ESC> timer hack: check if ESC key hit at keyboard
26           int v = Kconsole::console()->getchar(false);
27           if (v != -1)
28             {
29               if (v == 27)
30                 kdb_ke("ESC");
31               else
32                 Vkey::add_char(v);
33             }
34         }
35
36       if (Config::serial_esc != Config::SERIAL_NO_ESC)
37         {
38           // Here we have to check for serial characters because the
39           // serial interrupt could have an lower priority than a not
40           // acknowledged interrupt. The regular case is to stop when
41           // receiving the serial interrupt.
42           if (Kconsole::console()->char_avail() == 1 && !Vkey::check_())
43             kdb_ke("SERIAL_ESC");
44         }
45
46       if (Config::watchdog)
47         {
48           // tell doggy that we are alive
49           Watchdog::touch();
50         }
51     }
52 }
53
54