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/system.c | |
parent | 15c1f2207f4d406bb56032cef5920f474f32de88 (diff) | |
download | seabios-f54c150090ff38a73ef64a5d20fdfa0d9c403972.tar.gz |
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/system.c')
-rw-r--r-- | src/system.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/system.c b/src/system.c index 09415659..e73fe5ca 100644 --- a/src/system.c +++ b/src/system.c @@ -9,6 +9,7 @@ #include "biosvar.h" // BIOS_CONFIG_TABLE #include "ioport.h" // inb #include "memmap.h" // E820_RAM +#include "pic.h" // eoi_pic2 // Use PS2 System Control port A to set A20 enable static inline u8 @@ -368,6 +369,16 @@ handle_nmi() BX_PANIC("NMI Handler called\n"); } +void +mathcp_setup() +{ + dprintf(3, "math cp init\n"); + // 80x87 coprocessor installed + SETBITS_BDA(equipment_list_flags, 0x02); + // Enable IRQ13 (handle_75) + unmask_pic2(PIC2_IRQ13); +} + // INT 75 - IRQ13 - MATH COPROCESSOR EXCEPTION void VISIBLE16 handle_75() @@ -377,7 +388,7 @@ handle_75() // clear irq13 outb(0, PORT_MATH_CLEAR); // clear interrupt - eoi_both_pics(); + eoi_pic2(); // legacy nmi call struct bregs br; memset(&br, 0, sizeof(br)); |