Lines Matching refs:io

155 	struct ioapic *io;
165 io = (struct ioapic *)isrc->is_pic;
171 if (io->io_haseoi) {
177 io->io_addr + IOAPIC_EOIR);
191 ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(src->io_intpin),
196 ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(src->io_intpin),
264 struct ioapic *io = (struct ioapic *)isrc->is_pic;
270 ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin),
281 struct ioapic *io = (struct ioapic *)isrc->is_pic;
287 ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin),
312 struct ioapic *io = (struct ioapic *)intpin->io_intsrc.is_pic;
325 low = ioapic_read(io->io_addr,
328 ioapic_write(io->io_addr,
333 iommu_unmap_ioapic_intr(io->io_apic_id,
342 error = iommu_map_ioapic_intr(io->io_apic_id,
348 ioapic_write(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin),
351 ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin),
401 ioapic_write(io->io_addr, IOAPIC_REDTBL_HI(intpin->io_intpin), high);
403 ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin), low);
419 struct ioapic *io = (struct ioapic *)isrc->is_pic;
465 ioapic_write(io->io_addr, IOAPIC_REDTBL_LO(intpin->io_intpin),
477 printf("ioapic%u: routing intpin %u (", io->io_id,
554 struct ioapic *io = (struct ioapic *)isrc->is_pic;
574 io->io_id, intpin->io_intpin,
582 io->io_id, intpin->io_intpin,
596 struct ioapic *io = (struct ioapic *)pic;
600 for (i = 0; i < io->io_numintr; i++)
601 ioapic_program_intpin(&io->io_pins[i]);
611 struct ioapic *io;
631 io = malloc(sizeof(struct ioapic) +
633 io->io_pic = ioapic_template;
634 io->pci_dev = NULL;
635 io->pci_wnd = NULL;
637 io->io_id = next_id++;
638 io->io_apic_id = ioapic_read(apic, IOAPIC_ID) >> APIC_ID_SHIFT;
639 if (apic_id != -1 && io->io_apic_id != apic_id) {
642 io->io_apic_id = apic_id;
643 printf("ioapic%u: Changing APIC ID to %d\n", io->io_id,
649 printf("ioapic%u: Assuming intbase of %d\n", io->io_id,
653 io->io_id, intbase, next_ioapic_base);
654 io->io_intbase = intbase;
658 io->io_numintr = numintr;
659 io->io_addr = apic;
660 io->io_paddr = addr;
663 printf("ioapic%u: ver 0x%02x maxredir 0x%02x\n", io->io_id,
676 io->io_haseoi = (value & IOART_VER_VERSION) >= 0x20;
683 bzero(io->io_pins, sizeof(struct ioapic_intsrc) * numintr);
685 for (i = 0, intpin = io->io_pins; i < numintr; i++, intpin++) {
686 intpin->io_intsrc.is_pic = (struct pic *)io;
696 ioapic_set_extint(io, i);
719 iommu_map_ioapic_intr(io->io_apic_id,
728 return (io);
734 struct ioapic *io;
736 io = (struct ioapic *)cookie;
737 if (pin >= io->io_numintr)
739 return (io->io_pins[pin].io_irq);
745 struct ioapic *io;
747 io = (struct ioapic *)cookie;
748 if (pin >= io->io_numintr)
750 if (io->io_pins[pin].io_irq == IRQ_DISABLED)
752 io->io_pins[pin].io_irq = IRQ_DISABLED;
754 printf("ioapic%u: intpin %d disabled\n", io->io_id, pin);
761 struct ioapic *io;
763 io = (struct ioapic *)cookie;
764 if (pin >= io->io_numintr || vector < 0)
766 if (io->io_pins[pin].io_irq < 0)
768 io->io_pins[pin].io_irq = vector;
770 printf("ioapic%u: Routing IRQ %d -> intpin %d\n", io->io_id,
778 struct ioapic *io;
782 io = (struct ioapic *)cookie;
783 if (pin >= io->io_numintr)
785 if (io->io_pins[pin].io_irq < 0)
787 if (io->io_pins[pin].io_bus == bus_type)
789 io->io_pins[pin].io_bus = bus_type;
791 printf("ioapic%u: intpin %d bus %s\n", io->io_id, pin,
799 struct ioapic *io;
801 io = (struct ioapic *)cookie;
802 if (pin >= io->io_numintr)
804 if (io->io_pins[pin].io_irq == IRQ_NMI)
806 if (io->io_pins[pin].io_irq < 0)
808 io->io_pins[pin].io_bus = APIC_BUS_UNKNOWN;
809 io->io_pins[pin].io_irq = IRQ_NMI;
810 io->io_pins[pin].io_masked = 0;
811 io->io_pins[pin].io_edgetrigger = 1;
812 io->io_pins[pin].io_activehi = 1;
815 io->io_id, pin);
822 struct ioapic *io;
824 io = (struct ioapic *)cookie;
825 if (pin >= io->io_numintr)
827 if (io->io_pins[pin].io_irq == IRQ_SMI)
829 if (io->io_pins[pin].io_irq < 0)
831 io->io_pins[pin].io_bus = APIC_BUS_UNKNOWN;
832 io->io_pins[pin].io_irq = IRQ_SMI;
833 io->io_pins[pin].io_masked = 0;
834 io->io_pins[pin].io_edgetrigger = 1;
835 io->io_pins[pin].io_activehi = 1;
838 io->io_id, pin);
845 struct ioapic *io;
847 io = (struct ioapic *)cookie;
848 if (pin >= io->io_numintr)
850 if (io->io_pins[pin].io_irq == IRQ_EXTINT)
852 if (io->io_pins[pin].io_irq < 0)
854 io->io_pins[pin].io_bus = APIC_BUS_UNKNOWN;
855 io->io_pins[pin].io_irq = IRQ_EXTINT;
857 io->io_pins[pin].io_masked = 0;
859 io->io_pins[pin].io_masked = 1;
860 io->io_pins[pin].io_edgetrigger = 1;
861 io->io_pins[pin].io_activehi = 1;
864 io->io_id, pin);
871 struct ioapic *io;
874 io = (struct ioapic *)cookie;
875 if (pin >= io->io_numintr || pol == INTR_POLARITY_CONFORM)
877 if (io->io_pins[pin].io_irq < 0)
880 if (io->io_pins[pin].io_activehi == activehi)
882 io->io_pins[pin].io_activehi = activehi;
884 printf("ioapic%u: intpin %d polarity: %s\n", io->io_id, pin,
892 struct ioapic *io;
895 io = (struct ioapic *)cookie;
896 if (pin >= io->io_numintr || trigger == INTR_TRIGGER_CONFORM)
898 if (io->io_pins[pin].io_irq < 0)
901 if (io->io_pins[pin].io_edgetrigger == edgetrigger)
903 io->io_pins[pin].io_edgetrigger = edgetrigger;
905 printf("ioapic%u: intpin %d trigger: %s\n", io->io_id, pin,
917 struct ioapic *io;
922 io = (struct ioapic *)cookie;
923 apic = io->io_addr;
926 STAILQ_INSERT_TAIL(&ioapic_list, io, io_next);
929 io->io_id, flags >> 4, flags & 0xf, io->io_intbase,
930 io->io_intbase + io->io_numintr - 1);
936 intr_register_pic(&io->io_pic);
937 for (i = 0, pin = io->io_pins; i < io->io_numintr; i++, pin++)
948 struct ioapic *io;
951 io = (struct ioapic *)pic;
952 for (i = 0, pin = io->io_pins; i < io->io_numintr; i++, pin++) {
986 struct ioapic *io;
993 * same as the MADT reported io window, but an alias, read the
1014 /* First match by io window address */
1015 STAILQ_FOREACH(io, &ioapic_list, io_next) {
1016 if (io->io_paddr == (vm_paddr_t)rman_get_start(res))
1020 STAILQ_FOREACH(io, &ioapic_list, io_next) {
1021 if (io->io_apic_id == apic_id)
1033 KASSERT(io->pci_dev == NULL,
1034 ("ioapic %d pci_dev not NULL", io->io_id));
1035 KASSERT(io->pci_wnd == NULL,
1036 ("ioapic %d pci_wnd not NULL", io->io_id));
1038 io->pci_dev = dev;
1039 io->pci_wnd = res;
1040 if (bootverbose && (io->io_paddr != (vm_paddr_t)rman_get_start(res) ||
1041 io->io_apic_id != apic_id)) {
1047 io->io_apic_id, (uintmax_t)io->io_paddr);
1069 struct ioapic *io;
1074 STAILQ_FOREACH(io, &ioapic_list, io_next) {
1075 if (io->io_apic_id == apic_id)
1079 if (io == NULL || io->pci_dev == NULL)
1081 error = pci_get_id(io->pci_dev, PCI_ID_RID, &rid);
1131 struct ioapic *io;
1137 STAILQ_FOREACH(io, &ioapic_list, io_next) {
1138 apic_add_resource(dev, i, io->io_paddr, IOAPIC_MEM_REGION);