Added way to enter the kernel debugger in case keyboard is disabled - couldn't

test it, though, as I couldn't reproduce the problem since then.
Fixed indentation in ps2_keyboard.c.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16137 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2006-01-29 15:53:37 +00:00
parent 5da68569d0
commit c08ce938f3
2 changed files with 35 additions and 33 deletions

View File

@ -131,6 +131,10 @@ ps2_dev_handle_int(ps2_dev *dev, uint8 data)
if ((flags & PS2_FLAG_ENABLED) == 0) { if ((flags & PS2_FLAG_ENABLED) == 0) {
dprintf("not enabled, data dropped\n"); dprintf("not enabled, data dropped\n");
// TODO: remove me again; let us drop into the kernel debugger with F12
if ((flags & PS2_FLAG_KEYB) != 0 && data == 88)
panic("keyboard requested halt.\n");
return B_HANDLED_INTERRUPT; return B_HANDLED_INTERRUPT;
} }

View File

@ -61,52 +61,50 @@ set_leds(led_info *ledInfo)
int32 keyboard_handle_int(uint8 data) int32 keyboard_handle_int(uint8 data)
{ {
at_kbd_io keyInfo; at_kbd_io keyInfo;
uint8 scancode; uint8 scancode;
if (atomic_and(&sKeyboardOpenMask, 1) == 0) if (atomic_and(&sKeyboardOpenMask, 1) == 0)
return B_HANDLED_INTERRUPT; return B_HANDLED_INTERRUPT;
// TODO: Handle braindead "pause" key special case
if (data == EXTENDED_KEY) {
sIsExtended = true;
TRACE(("Extended key\n"));
return B_HANDLED_INTERRUPT;
}
// TODO: Handle braindead "pause" key special case scancode = data;
if (data == EXTENDED_KEY) { TRACE(("scancode: %x\n", scancode));
sIsExtended = true;
TRACE(("Extended key\n"));
return B_HANDLED_INTERRUPT;
}
scancode = data; // For now, F12 enters the kernel debugger
// ToDo: remove me later :-)
if (scancode == 88)
panic("keyboard requested halt.\n");
TRACE(("scancode: %x\n", scancode)); if (scancode & 0x80) {
keyInfo.is_keydown = false;
scancode -= 0x80;
} else
keyInfo.is_keydown = true;
// For now, F12 enters the kernel debugger if (sIsExtended) {
// ToDo: remove me later :-) scancode |= 0x80;
if (scancode == 88) sIsExtended = false;
panic("keyboard requested halt.\n"); }
if (scancode & 0x80) { keyInfo.timestamp = system_time();
keyInfo.is_keydown = false; keyInfo.scancode = scancode;
scancode -= 0x80;
} else
keyInfo.is_keydown = true;
if (sIsExtended) { if (packet_buffer_write(sKeyBuffer, (uint8 *)&keyInfo, sizeof(keyInfo)) == 0) {
scancode |= 0x80; // If there is no space left in the buffer, we drop this key stroke. We avoid
sIsExtended = false; // dropping old key strokes, to not destroy what already was typed.
} return B_HANDLED_INTERRUPT;
}
keyInfo.timestamp = system_time(); release_sem_etc(sKeyboardSem, 1, B_DO_NOT_RESCHEDULE);
keyInfo.scancode = scancode;
if (packet_buffer_write(sKeyBuffer, (uint8 *)&keyInfo, sizeof(keyInfo)) == 0) {
// If there is no space left in the buffer, we drop this key stroke. We avoid
// dropping old key strokes, to not destroy what already was typed.
return B_HANDLED_INTERRUPT;
}
release_sem_etc(sKeyboardSem, 1, B_DO_NOT_RESCHEDULE);
return B_INVOKE_SCHEDULER; return B_INVOKE_SCHEDULER;
} }