Lines Matching refs:io

206 	struct ioapic *io = (struct ioapic *)isrc->is_pic;
212 ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin),
223 struct ioapic *io = (struct ioapic *)isrc->is_pic;
229 ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin),
254 struct ioapic *io = (struct ioapic *)intpin->io_intsrc.is_pic;
264 low = ioapic_read(io->io_addr,
267 ioapic_write(io->io_addr,
312 ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), low);
313 value = ioapic_read(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin));
316 ioapic_write(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin), value);
323 struct ioapic *io = (struct ioapic *)isrc->is_pic;
357 ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin),
369 printf("ioapic%u: routing intpin %u (", io->io_id,
446 struct ioapic *io = (struct ioapic *)isrc->is_pic;
466 io->io_id, intpin->io_intpin,
474 io->io_id, intpin->io_intpin,
488 struct ioapic *io = (struct ioapic *)pic;
492 for (i = 0; i < io->io_numintr; i++)
493 ioapic_program_intpin(&io->io_pins[i]);
503 struct ioapic *io;
523 io = malloc(sizeof(struct ioapic) +
525 io->io_pic = ioapic_template;
527 io->io_id = next_id++;
528 io->io_apic_id = ioapic_read(apic, IOAPIC_ID) >> APIC_ID_SHIFT;
529 if (apic_id != -1 && io->io_apic_id != apic_id) {
532 io->io_apic_id = apic_id;
533 printf("ioapic%u: Changing APIC ID to %d\n", io->io_id,
539 printf("ioapic%u: Assuming intbase of %d\n", io->io_id,
543 io->io_id, intbase, next_ioapic_base);
544 io->io_intbase = intbase;
546 io->io_numintr = numintr;
547 io->io_addr = apic;
548 io->io_paddr = addr;
555 bzero(io->io_pins, sizeof(struct ioapic_intsrc) * numintr);
557 for (i = 0, intpin = io->io_pins; i < numintr; i++, intpin++) {
558 intpin->io_intsrc.is_pic = (struct pic *)io;
568 ioapic_set_extint(io, i);
591 return (io);
597 struct ioapic *io;
599 io = (struct ioapic *)cookie;
600 if (pin >= io->io_numintr)
602 return (io->io_pins[pin].io_irq);
608 struct ioapic *io;
610 io = (struct ioapic *)cookie;
611 if (pin >= io->io_numintr)
613 if (io->io_pins[pin].io_irq == IRQ_DISABLED)
615 io->io_pins[pin].io_irq = IRQ_DISABLED;
617 printf("ioapic%u: intpin %d disabled\n", io->io_id, pin);
624 struct ioapic *io;
626 io = (struct ioapic *)cookie;
627 if (pin >= io->io_numintr || vector < 0)
629 if (io->io_pins[pin].io_irq >= NUM_IO_INTS)
631 io->io_pins[pin].io_irq = vector;
633 printf("ioapic%u: Routing IRQ %d -> intpin %d\n", io->io_id,
641 struct ioapic *io;
645 io = (struct ioapic *)cookie;
646 if (pin >= io->io_numintr)
648 if (io->io_pins[pin].io_irq >= NUM_IO_INTS)
650 if (io->io_pins[pin].io_bus == bus_type)
652 io->io_pins[pin].io_bus = bus_type;
654 printf("ioapic%u: intpin %d bus %s\n", io->io_id, pin,
662 struct ioapic *io;
664 io = (struct ioapic *)cookie;
665 if (pin >= io->io_numintr)
667 if (io->io_pins[pin].io_irq == IRQ_NMI)
669 if (io->io_pins[pin].io_irq >= NUM_IO_INTS)
671 io->io_pins[pin].io_bus = APIC_BUS_UNKNOWN;
672 io->io_pins[pin].io_irq = IRQ_NMI;
673 io->io_pins[pin].io_masked = 0;
674 io->io_pins[pin].io_edgetrigger = 1;
675 io->io_pins[pin].io_activehi = 1;
678 io->io_id, pin);
685 struct ioapic *io;
687 io = (struct ioapic *)cookie;
688 if (pin >= io->io_numintr)
690 if (io->io_pins[pin].io_irq == IRQ_SMI)
692 if (io->io_pins[pin].io_irq >= NUM_IO_INTS)
694 io->io_pins[pin].io_bus = APIC_BUS_UNKNOWN;
695 io->io_pins[pin].io_irq = IRQ_SMI;
696 io->io_pins[pin].io_masked = 0;
697 io->io_pins[pin].io_edgetrigger = 1;
698 io->io_pins[pin].io_activehi = 1;
701 io->io_id, pin);
708 struct ioapic *io;
710 io = (struct ioapic *)cookie;
711 if (pin >= io->io_numintr)
713 if (io->io_pins[pin].io_irq == IRQ_EXTINT)
715 if (io->io_pins[pin].io_irq >= NUM_IO_INTS)
717 io->io_pins[pin].io_bus = APIC_BUS_UNKNOWN;
718 io->io_pins[pin].io_irq = IRQ_EXTINT;
720 io->io_pins[pin].io_masked = 0;
722 io->io_pins[pin].io_masked = 1;
723 io->io_pins[pin].io_edgetrigger = 1;
724 io->io_pins[pin].io_activehi = 1;
727 io->io_id, pin);
734 struct ioapic *io;
737 io = (struct ioapic *)cookie;
738 if (pin >= io->io_numintr || pol == INTR_POLARITY_CONFORM)
740 if (io->io_pins[pin].io_irq >= NUM_IO_INTS)
743 if (io->io_pins[pin].io_activehi == activehi)
745 io->io_pins[pin].io_activehi = activehi;
747 printf("ioapic%u: intpin %d polarity: %s\n", io->io_id, pin,
755 struct ioapic *io;
758 io = (struct ioapic *)cookie;
759 if (pin >= io->io_numintr || trigger == INTR_TRIGGER_CONFORM)
761 if (io->io_pins[pin].io_irq >= NUM_IO_INTS)
764 if (io->io_pins[pin].io_edgetrigger == edgetrigger)
766 io->io_pins[pin].io_edgetrigger = edgetrigger;
768 printf("ioapic%u: intpin %d trigger: %s\n", io->io_id, pin,
780 struct ioapic *io;
785 io = (struct ioapic *)cookie;
786 apic = io->io_addr;
789 STAILQ_INSERT_TAIL(&ioapic_list, io, io_next);
792 io->io_id, flags >> 4, flags & 0xf, io->io_intbase,
793 io->io_intbase + io->io_numintr - 1);
796 intr_register_pic(&io->io_pic);
797 for (i = 0, pin = io->io_pins; i < io->io_numintr; i++, pin++)
896 struct ioapic *io;
902 STAILQ_FOREACH(io, &ioapic_list, io_next) {
903 apic_add_resource(dev, i, io->io_paddr, IOAPIC_MEM_REGION);