7 #define IRQ_TO_INUM(x) ((x) + 8)
8 #define INUM_TO_IRQ(x) ((x) - 8)
10 /* general purpose registers, pushed by interrupt entry routine */
12 uint16_t di, si, bp, sp;
13 uint16_t bx, dx, cx, ax;
14 } __attribute__((packed));
17 /* registers pushed by intr_entry_* */
18 struct registers regs;
19 /* interrupt number */
21 /* pushed by CPU during interrupt entry */
22 uint16_t ip, cs, flags;
23 } __attribute__((packed));
25 typedef void (*intr_func_t)(struct intr_frame *frm);
28 void dispatch_intr(struct intr_frame frm);
30 /* set low level interrupt vector */
31 void set_intr_vect(int n, uint16_t seg, uint16_t offs);
32 /* set interrupt callback */
33 void set_intr(int n, intr_func_t func);
36 void unmask_irq(int n);
38 #define end_of_irq(n) \
42 "\n\tmov $0x20, %%ax" \
43 "\n\tout %%ax, $0xa0" \
44 "\n0:\tmov $0x20, %%ax" \
45 "\n\tout %%ax, $0x20" \