diff options
| author | mrg <mrg@NetBSD.org> | 2022-05-31 20:28:57 +0000 |
|---|---|---|
| committer | mrg <mrg@NetBSD.org> | 2022-05-31 20:28:57 +0000 |
| commit | 8ea822e8bc7d5c7462d0bff63ca220e1f262ec10 (patch) | |
| tree | 7e0b044f4adbf569d9abdc1a0f2d4baf354f64dc /sys/dev | |
| parent | 9157cd89729e228937709db0d9984116c1632c09 (diff) | |
allow ACPI to compile without PCI support. fixes ia64 build.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/acpi/acpi.c | 6 | ||||
| -rw-r--r-- | sys/dev/acpi/acpi_power.c | 11 | ||||
| -rw-r--r-- | sys/dev/acpi/acpi_verbose.c | 8 | ||||
| -rw-r--r-- | sys/dev/acpi/acpi_wakedev.c | 11 | ||||
| -rw-r--r-- | sys/dev/acpi/acpica/OsdHardware.c | 14 |
5 files changed, 36 insertions, 14 deletions
diff --git a/sys/dev/acpi/acpi.c b/sys/dev/acpi/acpi.c index 000553f8a83..4ade9c47efa 100644 --- a/sys/dev/acpi/acpi.c +++ b/sys/dev/acpi/acpi.c @@ -1,4 +1,4 @@ -/* $NetBSD: acpi.c,v 1.297 2022/02/27 21:22:09 riastradh Exp $ */ +/* $NetBSD: acpi.c,v 1.298 2022/05/31 20:28:57 mrg Exp $ */ /*- * Copyright (c) 2003, 2007 The NetBSD Foundation, Inc. @@ -100,7 +100,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.297 2022/02/27 21:22:09 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi.c,v 1.298 2022/05/31 20:28:57 mrg Exp $"); #include "pci.h" #include "opt_acpi.h" @@ -698,10 +698,12 @@ acpi_build_tree(struct acpi_softc *sc) (void)AcpiWalkNamespace(ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, UINT32_MAX, acpi_make_devnode, acpi_make_devnode_post, &awc, NULL); +#if NPCI > 0 /* * Scan the internal namespace. */ (void)acpi_pcidev_scan(sc->sc_root); +#endif } static void diff --git a/sys/dev/acpi/acpi_power.c b/sys/dev/acpi/acpi_power.c index cbe0db31ec5..d86803ae6dd 100644 --- a/sys/dev/acpi/acpi_power.c +++ b/sys/dev/acpi/acpi_power.c @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_power.c,v 1.35 2017/06/01 02:45:09 chs Exp $ */ +/* $NetBSD: acpi_power.c,v 1.36 2022/05/31 20:28:57 mrg Exp $ */ /*- * Copyright (c) 2009, 2010, 2011 The NetBSD Foundation, Inc. @@ -56,7 +56,9 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: acpi_power.c,v 1.35 2017/06/01 02:45:09 chs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_power.c,v 1.36 2022/05/31 20:28:57 mrg Exp $"); + +#include "pci.h" #include <sys/param.h> #include <sys/kmem.h> @@ -670,7 +672,6 @@ void acpi_power_add(struct acpi_devnode *ad) { const char *str = NULL; - device_t dev; int err; KASSERT(ad != NULL && ad->ad_root != NULL); @@ -682,12 +683,14 @@ acpi_power_add(struct acpi_devnode *ad) if (ad->ad_device != NULL) str = device_xname(ad->ad_device); +#if NPCI > 0 else { - dev = acpi_pcidev_find_dev(ad); + device_t dev = acpi_pcidev_find_dev(ad); if (dev != NULL) str = device_xname(dev); } +#endif if (str == NULL) return; diff --git a/sys/dev/acpi/acpi_verbose.c b/sys/dev/acpi/acpi_verbose.c index 40467ca10f3..12b5c7466a6 100644 --- a/sys/dev/acpi/acpi_verbose.c +++ b/sys/dev/acpi/acpi_verbose.c @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_verbose.c,v 1.20 2021/12/20 11:17:40 skrll Exp $ */ +/* $NetBSD: acpi_verbose.c,v 1.21 2022/05/31 20:28:57 mrg Exp $ */ /*- * Copyright (c) 2003, 2007, 2010 The NetBSD Foundation, Inc. @@ -65,7 +65,9 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: acpi_verbose.c,v 1.20 2021/12/20 11:17:40 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_verbose.c,v 1.21 2022/05/31 20:28:57 mrg Exp $"); + +#include "pci.h" #include <sys/param.h> #include <sys/device.h> @@ -515,6 +517,7 @@ acpi_print_tree(struct acpi_devnode *ad, uint32_t level) if (ad->ad_device != NULL) aprint_normal(" <%s>", device_xname(ad->ad_device)); +#if NPCI > 0 if (ad->ad_pciinfo != NULL) { aprint_normal(" (PCI)"); @@ -539,6 +542,7 @@ acpi_print_tree(struct acpi_devnode *ad, uint32_t level) if (dev != NULL) aprint_normal(" <%s>", device_xname(dev)); } +#endif aprint_normal("\n"); diff --git a/sys/dev/acpi/acpi_wakedev.c b/sys/dev/acpi/acpi_wakedev.c index 8b7384c8b6e..ed92548cf1f 100644 --- a/sys/dev/acpi/acpi_wakedev.c +++ b/sys/dev/acpi/acpi_wakedev.c @@ -1,4 +1,4 @@ -/* $NetBSD: acpi_wakedev.c,v 1.28 2021/12/20 11:17:40 skrll Exp $ */ +/* $NetBSD: acpi_wakedev.c,v 1.29 2022/05/31 20:28:57 mrg Exp $ */ /*- * Copyright (c) 2009, 2010, 2011 Jared D. McNeill <jmcneill@invisible.ca> @@ -27,7 +27,9 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: acpi_wakedev.c,v 1.28 2021/12/20 11:17:40 skrll Exp $"); +__KERNEL_RCSID(0, "$NetBSD: acpi_wakedev.c,v 1.29 2022/05/31 20:28:57 mrg Exp $"); + +#include "pci.h" #include <sys/param.h> #include <sys/device.h> @@ -210,7 +212,6 @@ acpi_wakedev_add(struct acpi_devnode *ad) { struct acpi_wakedev *aw; const char *str = NULL; - device_t dev; int err; KASSERT(ad != NULL && ad->ad_wakedev != NULL); @@ -228,12 +229,14 @@ acpi_wakedev_add(struct acpi_devnode *ad) if (ad->ad_device != NULL) str = device_xname(ad->ad_device); +#if NPCI > 0 else { - dev = acpi_pcidev_find_dev(ad); + device_t dev = acpi_pcidev_find_dev(ad); if (dev != NULL) str = device_xname(dev); } +#endif if (str == NULL) return; diff --git a/sys/dev/acpi/acpica/OsdHardware.c b/sys/dev/acpi/acpica/OsdHardware.c index 19072f02d82..ca343af182d 100644 --- a/sys/dev/acpi/acpica/OsdHardware.c +++ b/sys/dev/acpi/acpica/OsdHardware.c @@ -1,4 +1,4 @@ -/* $NetBSD: OsdHardware.c,v 1.13 2021/12/31 17:22:15 riastradh Exp $ */ +/* $NetBSD: OsdHardware.c,v 1.14 2022/05/31 20:28:57 mrg Exp $ */ /* * Copyright 2001 Wasabi Systems, Inc. @@ -44,7 +44,9 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: OsdHardware.c,v 1.13 2021/12/31 17:22:15 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: OsdHardware.c,v 1.14 2022/05/31 20:28:57 mrg Exp $"); + +#include "pci.h" #include <sys/param.h> #include <sys/device.h> @@ -210,6 +212,7 @@ ACPI_STATUS AcpiOsReadPciConfiguration(ACPI_PCI_ID *PciId, UINT32 Register, UINT64 *Value, UINT32 Width) { +#if NPCI > 0 pci_chipset_tag_t pc; pcitag_t tag; pcireg_t tmp; @@ -240,6 +243,9 @@ AcpiOsReadPciConfiguration(ACPI_PCI_ID *PciId, UINT32 Register, UINT64 *Value, } return AE_OK; +#else + return AE_BAD_PARAMETER; +#endif } /* @@ -251,6 +257,7 @@ ACPI_STATUS AcpiOsWritePciConfiguration(ACPI_PCI_ID *PciId, UINT32 Register, ACPI_INTEGER Value, UINT32 Width) { +#if NPCI > 0 pci_chipset_tag_t pc; pcitag_t tag; pcireg_t tmp; @@ -282,4 +289,7 @@ AcpiOsWritePciConfiguration(ACPI_PCI_ID *PciId, UINT32 Register, pci_conf_write(pc, tag, Register & ~3, tmp); return AE_OK; +#else + return AE_BAD_PARAMETER; +#endif } |
