Lines Matching refs:ai

81 	struct acpi_intr *ai;  in acpi_intr_handler()  local
83 ai = arg; in acpi_intr_handler()
84 KASSERT(ai != NULL && ai->ai_handler != NULL, in acpi_intr_handler()
86 if (ai->ai_handler(ai->ai_context) == ACPI_INTERRUPT_HANDLED) in acpi_intr_handler()
92 acpi_intr_destroy(device_t dev, struct acpi_intr *ai) in acpi_intr_destroy() argument
95 if (ai->ai_handle != NULL) in acpi_intr_destroy()
96 bus_teardown_intr(dev, ai->ai_irq, ai->ai_handle); in acpi_intr_destroy()
97 if (ai->ai_irq != NULL) in acpi_intr_destroy()
98 bus_release_resource(dev, SYS_RES_IRQ, ai->ai_rid, ai->ai_irq); in acpi_intr_destroy()
99 bus_delete_resource(dev, SYS_RES_IRQ, ai->ai_rid); in acpi_intr_destroy()
100 free(ai, M_ACPIINTR); in acpi_intr_destroy()
108 struct acpi_intr *ai, *ap; in AcpiOsInstallInterruptHandler() local
119 ai = malloc(sizeof(*ai), M_ACPIINTR, M_WAITOK | M_ZERO); in AcpiOsInstallInterruptHandler()
126 free(ai, M_ACPIINTR); in AcpiOsInstallInterruptHandler()
129 if (ai->ai_rid <= ap->ai_rid) in AcpiOsInstallInterruptHandler()
130 ai->ai_rid = ap->ai_rid + 1; in AcpiOsInstallInterruptHandler()
132 ai->ai_number = InterruptNumber; in AcpiOsInstallInterruptHandler()
133 ai->ai_handler = ServiceRoutine; in AcpiOsInstallInterruptHandler()
134 ai->ai_context = Context; in AcpiOsInstallInterruptHandler()
135 SLIST_INSERT_HEAD(&acpi_intr_list, ai, ai_link); in AcpiOsInstallInterruptHandler()
151 bus_set_resource(sc->acpi_dev, SYS_RES_IRQ, ai->ai_rid, in AcpiOsInstallInterruptHandler()
153 ai->ai_irq = bus_alloc_resource_any(sc->acpi_dev, SYS_RES_IRQ, in AcpiOsInstallInterruptHandler()
154 &ai->ai_rid, RF_SHAREABLE | RF_ACTIVE); in AcpiOsInstallInterruptHandler()
155 if (ai->ai_irq == NULL) { in AcpiOsInstallInterruptHandler()
159 if (bus_setup_intr(sc->acpi_dev, ai->ai_irq, in AcpiOsInstallInterruptHandler()
160 INTR_TYPE_MISC | INTR_MPSAFE, acpi_intr_handler, NULL, ai, in AcpiOsInstallInterruptHandler()
161 &ai->ai_handle) != 0) { in AcpiOsInstallInterruptHandler()
169 SLIST_REMOVE(&acpi_intr_list, ai, acpi_intr, ai_link); in AcpiOsInstallInterruptHandler()
171 acpi_intr_destroy(sc->acpi_dev, ai); in AcpiOsInstallInterruptHandler()
180 struct acpi_intr *ai; in AcpiOsRemoveInterruptHandler() local
191 SLIST_FOREACH(ai, &acpi_intr_list, ai_link) in AcpiOsRemoveInterruptHandler()
192 if (InterruptNumber == ai->ai_number) { in AcpiOsRemoveInterruptHandler()
193 if (ServiceRoutine != ai->ai_handler) { in AcpiOsRemoveInterruptHandler()
197 SLIST_REMOVE(&acpi_intr_list, ai, acpi_intr, ai_link); in AcpiOsRemoveInterruptHandler()
201 if (ai == NULL) in AcpiOsRemoveInterruptHandler()
203 acpi_intr_destroy(sc->acpi_dev, ai); in AcpiOsRemoveInterruptHandler()