Changeset 3e35fd7 in mainline
- Timestamp:
- 2006-10-29T12:40:26Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 14de0dd8
- Parents:
- 410ed0d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/smp/apic.c
r410ed0d r3e35fd7 45 45 #include <arch/asm.h> 46 46 #include <arch.h> 47 #include <ddi/irq.h> 48 #include <ddi/device.h> 47 49 48 50 #ifdef CONFIG_SMP … … 72 74 73 75 uint32_t apic_id_mask = 0; 76 static irq_t l_apic_timer_irq; 74 77 75 78 static int apic_poll_errors(void); … … 118 121 #endif /* LAPIC_VERBOSE */ 119 122 120 121 static void apic_spurious(int n, istate_t *istate); 122 static void l_apic_timer_interrupt(int n, istate_t *istate); 123 /** APIC spurious interrupt handler. 124 * 125 * @param n Interrupt vector. 126 * @param istate Interrupted state. 127 */ 128 static void apic_spurious(int n, istate_t *istate) 129 { 130 #ifdef CONFIG_DEBUG 131 printf("cpu%d: APIC spurious interrupt\n", CPU->id); 132 #endif 133 } 134 135 static irq_ownership_t l_apic_timer_claim(void) 136 { 137 return IRQ_ACCEPT; 138 } 139 140 static void l_apic_timer_irq_handler(irq_t *irq, void *arg, ...) 141 { 142 clock(); 143 } 123 144 124 145 /** Initialize APIC on BSP. */ … … 140 161 */ 141 162 io_apic_disable_irqs(0xffff); 142 exc_register(VECTOR_CLK, "l_apic_timer", (iroutine) l_apic_timer_interrupt); 163 164 irq_initialize(&l_apic_timer_irq); 165 l_apic_timer_irq.devno = device_assign_devno(); 166 l_apic_timer_irq.inr = IRQ_CLK; 167 l_apic_timer_irq.claim = l_apic_timer_claim; 168 l_apic_timer_irq.handler = l_apic_timer_irq_handler; 169 irq_register(&l_apic_timer_irq); 170 143 171 for (i = 0; i < IRQ_COUNT; i++) { 144 172 int pin; 145 173 146 if ((pin = smp_irq_to_pin(i)) != -1) {174 if ((pin = smp_irq_to_pin(i)) != -1) 147 175 io_apic_change_ioredtbl(pin, DEST_ALL, IVT_IRQBASE+i, LOPRI); 148 }149 176 } 150 177 … … 153 180 */ 154 181 idreg.value = io_apic_read(IOAPICID); 155 if ((1 <<idreg.apic_id) & apic_id_mask) { /* see if IO APIC ID is used already */182 if ((1 << idreg.apic_id) & apic_id_mask) { /* see if IO APIC ID is used already */ 156 183 for (i = 0; i < APIC_ID_COUNT; i++) { 157 if (!((1 <<i) & apic_id_mask)) {184 if (!((1 << i) & apic_id_mask)) { 158 185 idreg.apic_id = i; 159 186 io_apic_write(IOAPICID, idreg.value); … … 169 196 170 197 l_apic_debug(); 171 }172 173 /** APIC spurious interrupt handler.174 *175 * @param n Interrupt vector.176 * @param istate Interrupted state.177 */178 void apic_spurious(int n, istate_t *istate)179 {180 #ifdef CONFIG_DEBUG181 printf("cpu%d: APIC spurious interrupt\n", CPU->id);182 #endif183 198 } 184 199 … … 441 456 } 442 457 443 /** Local APIC Timer Interrupt.444 *445 * @param n Interrupt vector number.446 * @param istate Interrupted state.447 */448 void l_apic_timer_interrupt(int n, istate_t *istate)449 {450 l_apic_eoi();451 clock();452 }453 454 458 /** Get Local APIC ID. 455 459 *
Note:
See TracChangeset
for help on using the changeset viewer.