Kernel - Fixing bugs exposed with `qemu -nographic`
[tpg/acess2.git] / KernelLand / Modules / Input / Keyboard / main.c
index 8348106..9c2e20e 100644 (file)
@@ -16,6 +16,7 @@
 #include <Input/Keyboard/include/keyboard.h>
 #include "keymap_int.h"
 #include "layout_kbdus.h"
+#include <hal_proc.h>
 
 #define USE_KERNEL_MAGIC       1
 
@@ -163,6 +164,15 @@ void Keyboard_HandleKey(tKeyboard *Source, Uint32 HIDKeySym)
        Uint32  flag;
        Uint8   layer;
        
+       if( !Source ) {
+               Log_Error("Keyboard", "Passed NULL handle");
+               return ;
+       }
+       if( !Source->Node ) {
+               Log_Error("Keyboard", "Passed handle with NULL node");
+               return ;
+       }
+       
        bPressed = !(HIDKeySym & (1 << 31));
        HIDKeySym &= 0x7FFFFFFF;
 
@@ -280,6 +290,8 @@ void Keyboard_HandleKey(tKeyboard *Source, Uint32 HIDKeySym)
                case 'p':       Threads_Dump(); return;
                // Heap Statistics
                case 'h':       Heap_Stats();   return;
+               // PMem Statistics
+               case 'm':       MM_DumpStatistics();    return;
                // Dump Structure
                case 's':       return;
                }

UCC git Repository :: git.ucc.asn.au