Rev 534 | Rev 1477 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 534 | Rev 576 | ||
---|---|---|---|
Line 30... | Line 30... | ||
30 | #include <cpu.h> |
30 | #include <cpu.h> |
31 | #include <arch/types.h> |
31 | #include <arch/types.h> |
32 | #include <arch/asm.h> |
32 | #include <arch/asm.h> |
33 | #include <arch.h> |
33 | #include <arch.h> |
34 | #include <print.h> |
34 | #include <print.h> |
- | 35 | #include <interrupt.h> |
|
35 | 36 | ||
36 | /* |
37 | /* |
37 | * This is the PIC driver. |
38 | * This is the PIC driver. |
38 | * Programmable Interrupt Controller for UP systems. |
39 | * Programmable Interrupt Controller for UP systems. |
39 | */ |
40 | */ |
40 | 41 | ||
- | 42 | static void pic_spurious(int n, void *stack); |
|
- | 43 | ||
41 | void i8259_init(void) |
44 | void i8259_init(void) |
42 | { |
45 | { |
43 | /* ICW1: this is ICW1, ICW4 to follow */ |
46 | /* ICW1: this is ICW1, ICW4 to follow */ |
44 | outb(PIC_PIC0PORT1, PIC_ICW1 | PIC_NEEDICW4); |
47 | outb(PIC_PIC0PORT1, PIC_ICW1 | PIC_NEEDICW4); |
45 | 48 | ||
Line 65... | Line 68... | ||
65 | outb(PIC_PIC1PORT2, 1); |
68 | outb(PIC_PIC1PORT2, 1); |
66 | 69 | ||
67 | /* |
70 | /* |
68 | * Register interrupt handler for the PIC spurious interrupt. |
71 | * Register interrupt handler for the PIC spurious interrupt. |
69 | */ |
72 | */ |
70 | trap_register(VECTOR_PIC_SPUR, pic_spurious); |
73 | exc_register(VECTOR_PIC_SPUR, "pic_spurious", pic_spurious); |
71 | 74 | ||
72 | /* |
75 | /* |
73 | * Set the enable/disable IRQs handlers. |
76 | * Set the enable/disable IRQs handlers. |
74 | * Set the End-of-Interrupt handler. |
77 | * Set the End-of-Interrupt handler. |
75 | */ |
78 | */ |
Line 113... | Line 116... | ||
113 | { |
116 | { |
114 | outb(0x20,0x20); |
117 | outb(0x20,0x20); |
115 | outb(0xa0,0x20); |
118 | outb(0xa0,0x20); |
116 | } |
119 | } |
117 | 120 | ||
118 | void pic_spurious(__u8 n, __native stack[]) |
121 | void pic_spurious(int n, void *stack) |
119 | { |
122 | { |
120 | printf("cpu%d: PIC spurious interrupt\n", CPU->id); |
123 | printf("cpu%d: PIC spurious interrupt\n", CPU->id); |
121 | } |
124 | } |