--- io_apic.c.orig Sun Apr 3 20:36:49 2005 +++ io_apic.c Sun Apr 3 23:39:30 2005 @@ -130,6 +130,7 @@ static void ioapic_program_destination(struct ioapic_intsrc *intpin); static void ioapic_program_intpin(struct ioapic_intsrc *intpin); static void ioapic_setup_mixed_mode(struct ioapic_intsrc *intpin); +static void ioapic_print_redtbl(struct ioapic *io); static STAILQ_HEAD(,ioapic) ioapic_list = STAILQ_HEAD_INITIALIZER(ioapic_list); struct pic ioapic_template = { ioapic_enable_source, ioapic_disable_source, @@ -817,6 +818,9 @@ if (io->io_pins[i].io_dest != DEST_NONE && io->io_pins[i].io_dest != DEST_EXTINT) ioapic_program_destination(&io->io_pins[i]); + + STAILQ_FOREACH(io, &ioapic_list, io_next) + ioapic_print_redtbl(io); } SYSINIT(ioapic_destinations, SI_SUB_SMP, SI_ORDER_SECOND, ioapic_set_logical_destinations, NULL) @@ -848,4 +852,37 @@ if (extint->io_dest == DEST_NONE) ioapic_assign_cluster(extint); #endif +} + +static void +ioapic_print_redtbl(struct ioapic *io) +{ + int i; + u_int numintr, loword, hiword; + + printf("*** REDIRECTION TABLE FOR IOAPIC AT %p ***\n", (void *)(uintptr_t)io->io_addr); + printf("E# Vect DestM Dest DelM Stat Pol IRR Trig Mask LoW HiW\n"); + + numintr = io->io_numintr; + + for(i = 0; i < numintr; i++) { + loword = ioapic_read(io->io_addr, + IOAPIC_REDTBL_LO(i)); + hiword = ioapic_read(io->io_addr, + IOAPIC_REDTBL_HI(i)); + + printf("%02d %02x %c %02x %02x %c %c %c %c %c 0x%08x 0x%08x\n", + i, + loword & IOART_INTVEC, + (loword & IOART_DESTMOD ? 'P' : 'L'), + ((hiword & IOART_DEST) >> 24), + ((loword & IOART_DELMOD) >> 8), + (loword & IOART_DELIVS ? '1' : '0'), + (loword & IOART_INTPOL ? 'L' : 'H'), + (loword & IOART_REM_IRR ? '1' : '0'), + (loword & IOART_TRGRMOD ? 'L' : 'E'), + (loword & IOART_INTMASK ? '1' : '0'), + loword, + hiword); + } }