X-Git-Url: https://rtime.felk.cvut.cz/gitweb/l4.git/blobdiff_plain/8fe9942cde59835eb3c3c6936d866dd3305582ef..003b628647705666de261350195da72a38f2c4d2:/kernel/fiasco/src/kern/vkey.cpp diff --git a/kernel/fiasco/src/kern/vkey.cpp b/kernel/fiasco/src/kern/vkey.cpp index 451559861..e5b9f1d21 100644 --- a/kernel/fiasco/src/kern/vkey.cpp +++ b/kernel/fiasco/src/kern/vkey.cpp @@ -21,8 +21,28 @@ void Vkey::irq(Irq_base *i) { vkey_irq = i; } +// ------------------------------------------------------------------------ +IMPLEMENTATION [serial && !ux && debug]: + +PRIVATE static inline +bool +Vkey::is_debugger_entry_key(int key) +{ + return key == KEY_ESC; +} + +// ------------------------------------------------------------------------ +IMPLEMENTATION [serial && !ux && !debug]: + +PRIVATE static inline +bool +Vkey::is_debugger_entry_key(int) +{ + return false; +} + // --------------------------------------------------------------------------- -IMPLEMENTATION [debug && serial && !ux]: +IMPLEMENTATION [serial && !ux]: #include @@ -111,7 +131,7 @@ Vkey::check_() if (c == -1) break; - if (c == KEY_ESC) + if (is_debugger_entry_key(c)) { ret = 0; // break into kernel debugger break; @@ -166,7 +186,9 @@ Vkey::clear() } //---------------------------------------------------------------------------- -IMPLEMENTATION [!debug || !serial || ux]: +IMPLEMENTATION [!serial || ux]: + +#include "kernel_console.h" PUBLIC static inline void @@ -183,11 +205,6 @@ void Vkey::add_char(int) {} -//---------------------------------------------------------------------------- -IMPLEMENTATION [debug && (!serial || ux)]: - -#include "kernel_console.h" - PUBLIC static int Vkey::get() @@ -195,31 +212,6 @@ Vkey::get() return Kconsole::console()->getchar(0); } -//---------------------------------------------------------------------------- -IMPLEMENTATION [!debug && serial]: - -#include "kernel_console.h" - -static Console *uart = Kconsole::console()->find_console(Console::UART); - -PUBLIC static -int -Vkey::get() -{ - return uart->getchar(false); -} - -//---------------------------------------------------------------------------- -IMPLEMENTATION[!debug && !serial]: - -PUBLIC static -int -Vkey::get() -{ return -1; } - -//---------------------------------------------------------------------------- -IMPLEMENTATION[!debug || !serial]: - PUBLIC static inline int Vkey::check_(int = -1)