diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2008-06-14 15:56:16 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2008-06-14 15:56:16 -0400 |
commit | f54c150090ff38a73ef64a5d20fdfa0d9c403972 (patch) | |
tree | c9c4325ee9d88897c25452eaf08fcc22440499b4 /src/kbd.c | |
parent | 15c1f2207f4d406bb56032cef5920f474f32de88 (diff) | |
download | seabios-hppa-f54c150090ff38a73ef64a5d20fdfa0d9c403972.zip seabios-hppa-f54c150090ff38a73ef64a5d20fdfa0d9c403972.tar.gz seabios-hppa-f54c150090ff38a73ef64a5d20fdfa0d9c403972.tar.bz2 |
Cleanup handling of interrupt controller (PIC).
Add new file (pic.h) with helpers for accessing the PIC.
Move irq enabling code to the files that use those interrupts.
Also, don't setup for floppy if floppy support not enabled.
Diffstat (limited to 'src/kbd.c')
-rw-r--r-- | src/kbd.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -8,6 +8,7 @@ #include "biosvar.h" // struct bregs #include "util.h" // debug_enter #include "config.h" // CONFIG_* +#include "pic.h" // eoi_pic1 //-------------------------------------------------------------------------- // keyboard_panic @@ -160,6 +161,9 @@ kbd_setup() , x + FIELD_SIZEOF(struct bios_data_area_s, kbd_buf)); keyboard_init(); + + // Enable IRQ1 (handle_09) + unmask_pic1(PIC1_IRQ1); } static u8 @@ -705,8 +709,8 @@ handle_09() // disable keyboard outb(0xad, PORT_PS2_STATUS); - outb(0x0b, PORT_PIC1); - if ((inb(PORT_PIC1) & 0x02) == 0) + // Make sure there really is a keyboard irq pending. + if (! (get_pic1_isr() & PIC1_IRQ1)) goto done; // read key from keyboard controller @@ -727,7 +731,7 @@ handle_09() process_key(key); irq_disable(); - eoi_master_pic(); + eoi_pic1(); done: // enable keyboard |