Rev 1480 | Rev 1702 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1480 | Rev 1625 | ||
|---|---|---|---|
| Line 44... | Line 44... | ||
| 44 | void pic_enable_interrupt(int intnum) |
44 | void pic_enable_interrupt(int intnum) |
| 45 | { |
45 | { |
| 46 | if (intnum < 32) { |
46 | if (intnum < 32) { |
| 47 | pic[PIC_MASK_LOW] = pic[PIC_MASK_LOW] | (1 << intnum); |
47 | pic[PIC_MASK_LOW] = pic[PIC_MASK_LOW] | (1 << intnum); |
| 48 | } else { |
48 | } else { |
| 49 | pic[PIC_MASK_HIGH] = pic[PIC_MASK_HIGH] | (1 << (intnum-32)); |
49 | pic[PIC_MASK_HIGH] = pic[PIC_MASK_HIGH] | (1 << (intnum - 32)); |
| 50 | } |
50 | } |
| 51 | 51 | ||
| 52 | } |
52 | } |
| 53 | 53 | ||
| 54 | void pic_disable_interrupt(int intnum) |
54 | void pic_disable_interrupt(int intnum) |
| 55 | { |
55 | { |
| 56 | if (intnum < 32) { |
56 | if (intnum < 32) { |
| 57 | pic[PIC_MASK_LOW] = pic[PIC_MASK_LOW] & (~(1 << intnum)); |
57 | pic[PIC_MASK_LOW] = pic[PIC_MASK_LOW] & (~(1 << intnum)); |
| 58 | } else { |
58 | } else { |
| 59 | pic[PIC_MASK_HIGH] = pic[PIC_MASK_HIGH] & (~(1 << (intnum-32))); |
59 | pic[PIC_MASK_HIGH] = pic[PIC_MASK_HIGH] & (~(1 << (intnum - 32))); |
| 60 | } |
60 | } |
| 61 | } |
61 | } |
| 62 | 62 | ||
| 63 | void pic_ack_interrupt(int intnum) |
63 | void pic_ack_interrupt(int intnum) |
| 64 | { |
64 | { |
| 65 | if (intnum < 32) |
65 | if (intnum < 32) |
| 66 | pic[PIC_ACK_LOW] = 1 << intnum; |
66 | pic[PIC_ACK_LOW] = 1 << intnum; |
| 67 | else |
67 | else |
| 68 | pic[PIC_ACK_HIGH] = 1 << (intnum-32); |
68 | pic[PIC_ACK_HIGH] = 1 << (intnum - 32); |
| 69 | } |
69 | } |
| 70 | 70 | ||
| 71 | /** Return number of pending interrupt */ |
71 | /** Return number of pending interrupt */ |
| 72 | int pic_get_pending(void) |
72 | int pic_get_pending(void) |
| 73 | { |
73 | { |