Changeset 7f043c0 in mainline for kernel/arch/ia32/src/smp/apic.c
- Timestamp:
- 2007-05-31T21:39:13Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7bb0c32
- Parents:
- d8431986
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/smp/apic.c
rd8431986 r7f043c0 126 126 * @param istate Interrupted state. 127 127 */ 128 static void apic_spurious(int n , istate_t *istate)128 static void apic_spurious(int n __attribute__((unused)), istate_t *istate __attribute__((unused))) 129 129 { 130 130 #ifdef CONFIG_DEBUG 131 printf("cpu% d: APIC spurious interrupt\n", CPU->id);131 printf("cpu%u: APIC spurious interrupt\n", CPU->id); 132 132 #endif 133 133 } … … 138 138 } 139 139 140 static void l_apic_timer_irq_handler(irq_t *irq, void *arg , ...)140 static void l_apic_timer_irq_handler(irq_t *irq, void *arg __attribute__((unused)), ...) 141 141 { 142 142 /* … … 154 154 { 155 155 io_apic_id_t idreg; 156 unsigned int i; 157 156 158 157 exc_register(VECTOR_APIC_SPUR, "apic_spurious", (iroutine) apic_spurious); 159 158 … … 177 176 irq_register(&l_apic_timer_irq); 178 177 178 uint8_t i; 179 179 for (i = 0; i < IRQ_COUNT; i++) { 180 180 int pin; 181 181 182 182 if ((pin = smp_irq_to_pin(i)) != -1) 183 io_apic_change_ioredtbl( pin, DEST_ALL, IVT_IRQBASE + i, LOPRI);183 io_apic_change_ioredtbl((uint8_t) pin, DEST_ALL, (uint8_t) (IVT_IRQBASE + i), LOPRI); 184 184 } 185 185 … … 329 329 for (i = 0; i<2; i++) { 330 330 icr.lo = l_apic[ICRlo]; 331 icr.vector = ( (uintptr_t) ap_boot) / 4096; /* calculate the reset vector */331 icr.vector = (uint8_t) (((uintptr_t) ap_boot) >> 12); /* calculate the reset vector */ 332 332 icr.delmod = DELMOD_STARTUP; 333 333 icr.destmod = DESTMOD_PHYS; … … 426 426 427 427 /* Program Logical Destination Register. */ 428 ASSERT(CPU->id < 8) 428 429 ldr.value = l_apic[LDR]; 429 if (CPU->id < sizeof(CPU->id)*8) /* size in bits */ 430 ldr.id = (1<<CPU->id); 430 ldr.id = (uint8_t) (1 << CPU->id); 431 431 l_apic[LDR] = ldr.value; 432 432 … … 514 514 * @param flags Flags. 515 515 */ 516 void io_apic_change_ioredtbl( int pin, int dest, uint8_t v, int flags)516 void io_apic_change_ioredtbl(uint8_t pin, uint8_t dest, uint8_t v, int flags) 517 517 { 518 518 io_redirection_reg_t reg; … … 522 522 dlvr = DELMOD_LOWPRI; 523 523 524 reg.lo = io_apic_read( IOREDTBL + pin*2);525 reg.hi = io_apic_read( IOREDTBL + pin*2 + 1);524 reg.lo = io_apic_read((uint8_t) (IOREDTBL + pin * 2)); 525 reg.hi = io_apic_read((uint8_t) (IOREDTBL + pin * 2 + 1)); 526 526 527 527 reg.dest = dest; … … 532 532 reg.intvec = v; 533 533 534 io_apic_write( IOREDTBL + pin*2, reg.lo);535 io_apic_write( IOREDTBL + pin*2 + 1, reg.hi);534 io_apic_write((uint8_t) (IOREDTBL + pin * 2), reg.lo); 535 io_apic_write((uint8_t) (IOREDTBL + pin * 2 + 1), reg.hi); 536 536 } 537 537 … … 554 554 pin = smp_irq_to_pin(i); 555 555 if (pin != -1) { 556 reg.lo = io_apic_read( IOREDTBL + pin * 2);556 reg.lo = io_apic_read((uint8_t) (IOREDTBL + pin * 2)); 557 557 reg.masked = true; 558 io_apic_write( IOREDTBL + pin * 2, reg.lo);558 io_apic_write((uint8_t) (IOREDTBL + pin * 2), reg.lo); 559 559 } 560 560 … … 573 573 io_redirection_reg_t reg; 574 574 575 for (i = 0; i < 16; i++) {575 for (i = 0; i < 16; i++) { 576 576 if (irqmask & (1 << i)) { 577 577 /* … … 581 581 pin = smp_irq_to_pin(i); 582 582 if (pin != -1) { 583 reg.lo = io_apic_read( IOREDTBL + pin * 2);583 reg.lo = io_apic_read((uint8_t) (IOREDTBL + pin * 2)); 584 584 reg.masked = false; 585 io_apic_write( IOREDTBL + pin * 2, reg.lo);585 io_apic_write((uint8_t) (IOREDTBL + pin * 2), reg.lo); 586 586 } 587 587
Note:
See TracChangeset
for help on using the changeset viewer.