summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpi/acpi.c8
-rw-r--r--sys/dev/acpi/acpimcfg.c10
-rw-r--r--sys/dev/acpi/acpivar.h6
3 files changed, 13 insertions, 11 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c
index d6d5f4d5a9e..458d3594c7e 100644
--- a/sys/dev/acpi/acpi.c
+++ b/sys/dev/acpi/acpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi.c,v 1.352 2018/07/01 15:52:12 kettenis Exp $ */
+/* $OpenBSD: acpi.c,v 1.353 2018/07/04 20:46:22 kettenis Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
* Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org>
@@ -352,7 +352,7 @@ acpi_gasio(struct acpi_softc *sc, int iodir, int iospace, uint64_t address,
return (0);
}
- pc = NULL;
+ pc = sc->sc_pc;
tag = pci_make_tag(pc,
ACPI_PCI_BUS(address), ACPI_PCI_DEV(address),
ACPI_PCI_FN(address));
@@ -540,7 +540,7 @@ acpi_getpci(struct aml_node *node, void *arg)
struct acpi_pci *pci, *ppci;
struct aml_value res;
struct acpi_softc *sc = arg;
- pci_chipset_tag_t pc = NULL;
+ pci_chipset_tag_t pc = sc->sc_pc;
pcitag_t tag;
uint64_t val;
uint32_t reg;
@@ -776,7 +776,7 @@ int
acpi_pci_notify(struct aml_node *node, int ntype, void *arg)
{
struct acpi_pci *pdev = arg;
- pci_chipset_tag_t pc = NULL;
+ pci_chipset_tag_t pc = acpi_softc->sc_pc;
pcitag_t tag;
pcireg_t reg;
int offset;
diff --git a/sys/dev/acpi/acpimcfg.c b/sys/dev/acpi/acpimcfg.c
index 23772cae0aa..311016dbd5e 100644
--- a/sys/dev/acpi/acpimcfg.c
+++ b/sys/dev/acpi/acpimcfg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpimcfg.c,v 1.2 2011/01/05 22:29:31 kettenis Exp $ */
+/* $OpenBSD: acpimcfg.c,v 1.3 2018/07/04 20:46:22 kettenis Exp $ */
/*
* Copyright (c) 2010 Mark Kettenis <kettenis@openbsd.org>
*
@@ -19,8 +19,6 @@
#include <sys/systm.h>
#include <sys/device.h>
-#include <machine/apicvar.h>
-
#include <dev/acpi/acpireg.h>
#include <dev/acpi/acpivar.h>
#include <dev/pci/pcivar.h>
@@ -61,6 +59,7 @@ acpimcfg_match(struct device *parent, void *match, void *aux)
void
acpimcfg_attach(struct device *parent, struct device *self, void *aux)
{
+ struct acpi_softc *sc = (struct acpi_softc *)parent;
struct acpi_attach_args *aaa = aux;
struct acpi_mcfg *mcfg = (struct acpi_mcfg *)aaa->aaa_table;
@@ -74,7 +73,6 @@ acpimcfg_attach(struct device *parent, struct device *self, void *aux)
if (mcfg->min_bus_number == mcfg->max_bus_number)
return;
- pci_mcfg_addr = mcfg->base_address;
- pci_mcfg_min_bus = mcfg->min_bus_number;
- pci_mcfg_max_bus = mcfg->max_bus_number;
+ sc->sc_pc = pci_mcfg_init(aaa->aaa_memt, mcfg->base_address,
+ mcfg->min_bus_number, mcfg->max_bus_number);
}
diff --git a/sys/dev/acpi/acpivar.h b/sys/dev/acpi/acpivar.h
index 121a28edcdd..575b04d5986 100644
--- a/sys/dev/acpi/acpivar.h
+++ b/sys/dev/acpi/acpivar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpivar.h,v 1.94 2018/07/01 10:27:34 kettenis Exp $ */
+/* $OpenBSD: acpivar.h,v 1.95 2018/07/04 20:46:22 kettenis Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
@@ -28,6 +28,8 @@
#include <machine/bus.h>
+#include <dev/pci/pcivar.h>
+
#include "acpipwrres.h"
/* #define ACPI_DEBUG */
@@ -207,6 +209,8 @@ struct acpi_softc {
bus_space_tag_t sc_memt;
bus_dma_tag_t sc_dmat;
+ pci_chipset_tag_t sc_pc; /* XXX assume single segment */
+
/*
* First-level ACPI tables
*/