summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2018-07-10 17:11:43 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2018-07-10 17:11:43 +0000
commit0475b5df81fd59f654b39c25ec6fe0d488f2ac4b (patch)
tree94ea5c83d8a6bb4b9947849459ffd360f2a8405e /sys/dev
parent52df7ffd698eeb5bfd870e3e0461a3bfe39868bf (diff)
Make legacy interrupts work in acpipci(4).
ok patrick@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpi/acpi.c17
-rw-r--r--sys/dev/acpi/acpivar.h4
2 files changed, 19 insertions, 2 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index 62b33277e81..601bf9717dd 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.354 2018/07/05 19:25:38 kettenis Exp $ */
+/* $OpenBSD: acpi.c,v 1.355 2018/07/10 17:11:42 kettenis Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -648,6 +648,21 @@ acpi_getpci(struct aml_node *node, void *arg)
}
struct aml_node *
+acpi_find_pci(pci_chipset_tag_t pc, pcitag_t tag)
+{
+ struct acpi_pci *pdev;
+ int bus, dev, fun;
+
+ pci_decompose_tag(pc, tag, &bus, &dev, &fun);
+ TAILQ_FOREACH(pdev, &acpi_pcidevs, next) {
+ if (pdev->bus == bus && pdev->dev == dev && pdev->fun == fun)
+ return pdev->node;
+ }
+
+ return NULL;
+}
+
+struct aml_node *
acpi_pci_match(struct device *dev, struct pci_attach_args *pa)
{
struct acpi_pci *pdev;
diff --git a/sys/dev/acpi/acpivar.h b/sys/dev/acpi/acpivar.h
index 575b04d5986..23f9b5e9fcd 100644
--- a/sys/dev/acpi/acpivar.h
+++ b/sys/dev/acpi/acpivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpivar.h,v 1.95 2018/07/04 20:46:22 kettenis Exp $ */
+/* $OpenBSD: acpivar.h,v 1.96 2018/07/10 17:11:42 kettenis Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
@@ -388,6 +388,8 @@ int acpi_release_glk(uint32_t *);
void acpi_pciroots_attach(struct device *, void *, cfprint_t);
void acpi_attach_deps(struct acpi_softc *, struct aml_node *);
+struct aml_node *acpi_find_pci(pci_chipset_tag_t, pcitag_t);
+
void *acpi_intr_establish(int, int, int, int (*)(void *), void *,
const char *);