/* defined in intr_asm.S */
void set_idt(uint32_t addr, uint16_t limit);
void intr_entry_default(void);
+void irq7_entry_check_spurious(void);
+void irq15_entry_check_spurious(void);
/* the IDT (interrupt descriptor table) */
static desc_t idt[256] __attribute__((aligned(8)));
*/
#include "intrtab.h"
+ /* change irq7 and irq15 to special entry points which first
+ * make sure we didn't get a spurious interrupt before proceeding
+ */
+ set_intr_entry(IRQ_TO_INTR(7), irq7_entry_check_spurious);
+ set_intr_entry(IRQ_TO_INTR(15), irq15_entry_check_spurious);
+
/* initialize the programmable interrupt controller
* setting up the maping of IRQs [0, 15] to interrupts [32, 47]
*/
/* set an interrupt handler function for a particular interrupt */
void interrupt(int intr_num, intr_func_t func)
{
+ int iflag = get_intr_flag();
+ disable_intr();
intr_func[intr_num] = func;
+ set_intr_flag(iflag);
}
/* this function is called from all interrupt entry points