Rev 812 | Rev 1196 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 812 | Rev 958 | ||
---|---|---|---|
Line 110... | Line 110... | ||
110 | "Polarity Low" |
110 | "Polarity Low" |
111 | }; |
111 | }; |
112 | #endif /* LAPIC_VERBOSE */ |
112 | #endif /* LAPIC_VERBOSE */ |
113 | 113 | ||
114 | 114 | ||
115 | static void apic_spurious(int n, void *stack); |
115 | static void apic_spurious(int n, istate_t *istate); |
116 | static void l_apic_timer_interrupt(int n, void *stack); |
116 | static void l_apic_timer_interrupt(int n, istate_t *istate); |
117 | 117 | ||
118 | /** Initialize APIC on BSP. */ |
118 | /** Initialize APIC on BSP. */ |
119 | void apic_init(void) |
119 | void apic_init(void) |
120 | { |
120 | { |
121 | io_apic_id_t idreg; |
121 | io_apic_id_t idreg; |
122 | int i; |
122 | int i; |
123 | 123 | ||
124 | exc_register(VECTOR_APIC_SPUR, "apic_spurious", apic_spurious); |
124 | exc_register(VECTOR_APIC_SPUR, "apic_spurious", (iroutine) apic_spurious); |
125 | 125 | ||
126 | enable_irqs_function = io_apic_enable_irqs; |
126 | enable_irqs_function = io_apic_enable_irqs; |
127 | disable_irqs_function = io_apic_disable_irqs; |
127 | disable_irqs_function = io_apic_disable_irqs; |
128 | eoi_function = l_apic_eoi; |
128 | eoi_function = l_apic_eoi; |
129 | 129 | ||
Line 131... | Line 131... | ||
131 | * Configure interrupt routing. |
131 | * Configure interrupt routing. |
132 | * IRQ 0 remains masked as the time signal is generated by l_apic's themselves. |
132 | * IRQ 0 remains masked as the time signal is generated by l_apic's themselves. |
133 | * Other interrupts will be forwarded to the lowest priority CPU. |
133 | * Other interrupts will be forwarded to the lowest priority CPU. |
134 | */ |
134 | */ |
135 | io_apic_disable_irqs(0xffff); |
135 | io_apic_disable_irqs(0xffff); |
136 | exc_register(VECTOR_CLK, "l_apic_timer", l_apic_timer_interrupt); |
136 | exc_register(VECTOR_CLK, "l_apic_timer", (iroutine) l_apic_timer_interrupt); |
137 | for (i = 0; i < IRQ_COUNT; i++) { |
137 | for (i = 0; i < IRQ_COUNT; i++) { |
138 | int pin; |
138 | int pin; |
139 | 139 | ||
140 | if ((pin = smp_irq_to_pin(i)) != -1) { |
140 | if ((pin = smp_irq_to_pin(i)) != -1) { |
141 | io_apic_change_ioredtbl(pin, DEST_ALL, IVT_IRQBASE+i, LOPRI); |
141 | io_apic_change_ioredtbl(pin, DEST_ALL, IVT_IRQBASE+i, LOPRI); |
Line 167... | Line 167... | ||
167 | /** APIC spurious interrupt handler. |
167 | /** APIC spurious interrupt handler. |
168 | * |
168 | * |
169 | * @param n Interrupt vector. |
169 | * @param n Interrupt vector. |
170 | * @param stack Interrupted stack. |
170 | * @param stack Interrupted stack. |
171 | */ |
171 | */ |
172 | void apic_spurious(int n, void *stack) |
172 | void apic_spurious(int n, istate_t *istate) |
173 | { |
173 | { |
174 | printf("cpu%d: APIC spurious interrupt\n", CPU->id); |
174 | printf("cpu%d: APIC spurious interrupt\n", CPU->id); |
175 | } |
175 | } |
176 | 176 | ||
177 | /** Poll for APIC errors. |
177 | /** Poll for APIC errors. |
Line 425... | Line 425... | ||
425 | /** Local APIC Timer Interrupt. |
425 | /** Local APIC Timer Interrupt. |
426 | * |
426 | * |
427 | * @param n Interrupt vector number. |
427 | * @param n Interrupt vector number. |
428 | * @param stack Interrupted stack. |
428 | * @param stack Interrupted stack. |
429 | */ |
429 | */ |
430 | void l_apic_timer_interrupt(int n, void *stack) |
430 | void l_apic_timer_interrupt(int n, istate_t *istate) |
431 | { |
431 | { |
432 | l_apic_eoi(); |
432 | l_apic_eoi(); |
433 | clock(); |
433 | clock(); |
434 | } |
434 | } |
435 | 435 |