From: David Woodhouse David.Woodhouse@intel.com
CSM will (unfortunately) need to use these.
Signed-off-by: David Woodhouse David.Woodhouse@intel.com --- src/pic.c | 16 ++++++++++++++++ src/pic.h | 2 ++ 2 files changed, 18 insertions(+)
diff --git a/src/pic.c b/src/pic.c index 8992a8b..669d670 100644 --- a/src/pic.c +++ b/src/pic.c @@ -50,3 +50,19 @@ handle_hwpic2(struct bregs *regs) dprintf(DEBUG_ISR_hwpic2, "handle_hwpic2 irq=%x\n", get_pic2_isr()); eoi_pic2(); } + +u8 saved_pic_mask[2] = { ~PIC1_IRQ2, ~0 }; + +void +pic_save_mask(void) +{ + saved_pic_mask[0] = inb(PORT_PIC1_DATA); + saved_pic_mask[1] = inb(PORT_PIC2_DATA); +} + +void +pic_restore_mask(void) +{ + outb(saved_pic_mask[0], PORT_PIC1_DATA); + outb(saved_pic_mask[1], PORT_PIC2_DATA); +} diff --git a/src/pic.h b/src/pic.h index c75af3e..0ea5622 100644 --- a/src/pic.h +++ b/src/pic.h @@ -93,5 +93,7 @@ enable_hwirq(int hwirq, struct segoff_s func)
void set_pics(u8 irq0, u8 irq8); void pic_setup(void); +void pic_save_mask(void); +void pic_restore_mask(void);
#endif // pic.h