Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/acpi allow ACPI to compile without PCI support. fix...
details: https://anonhg.NetBSD.org/src/rev/9cd77c9e433d
branches: trunk
changeset: 366596:9cd77c9e433d
user: mrg <mrg%NetBSD.org@localhost>
date: Tue May 31 20:28:57 2022 +0000
description:
allow ACPI to compile without PCI support. fixes ia64 build.
diffstat:
sys/dev/acpi/acpi.c | 6 ++++--
sys/dev/acpi/acpi_power.c | 11 +++++++----
sys/dev/acpi/acpi_verbose.c | 8 ++++++--
sys/dev/acpi/acpi_wakedev.c | 11 +++++++----
sys/dev/acpi/acpica/OsdHardware.c | 14 ++++++++++++--
5 files changed, 36 insertions(+), 14 deletions(-)
diffs (209 lines):
diff -r f49329d31e12 -r 9cd77c9e433d sys/dev/acpi/acpi.c
--- a/sys/dev/acpi/acpi.c Tue May 31 19:14:10 2022 +0000
+++ b/sys/dev/acpi/acpi.c Tue May 31 20:28:57 2022 +0000
@@ -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 @@
(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 -r f49329d31e12 -r 9cd77c9e433d sys/dev/acpi/acpi_power.c
--- a/sys/dev/acpi/acpi_power.c Tue May 31 19:14:10 2022 +0000
+++ b/sys/dev/acpi/acpi_power.c Tue May 31 20:28:57 2022 +0000
@@ -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 @@
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 @@
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 -r f49329d31e12 -r 9cd77c9e433d sys/dev/acpi/acpi_verbose.c
--- a/sys/dev/acpi/acpi_verbose.c Tue May 31 19:14:10 2022 +0000
+++ b/sys/dev/acpi/acpi_verbose.c Tue May 31 20:28:57 2022 +0000
@@ -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 @@
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 @@
if (dev != NULL)
aprint_normal(" <%s>", device_xname(dev));
}
+#endif
aprint_normal("\n");
diff -r f49329d31e12 -r 9cd77c9e433d sys/dev/acpi/acpi_wakedev.c
--- a/sys/dev/acpi/acpi_wakedev.c Tue May 31 19:14:10 2022 +0000
+++ b/sys/dev/acpi/acpi_wakedev.c Tue May 31 20:28:57 2022 +0000
@@ -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@localhost>
@@ -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 @@
{
struct acpi_wakedev *aw;
const char *str = NULL;
- device_t dev;
int err;
KASSERT(ad != NULL && ad->ad_wakedev != NULL);
@@ -228,12 +229,14 @@
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 -r f49329d31e12 -r 9cd77c9e433d sys/dev/acpi/acpica/OsdHardware.c
--- a/sys/dev/acpi/acpica/OsdHardware.c Tue May 31 19:14:10 2022 +0000
+++ b/sys/dev/acpi/acpica/OsdHardware.c Tue May 31 20:28:57 2022 +0000
@@ -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 @@
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 @@
}
return AE_OK;
+#else
+ return AE_BAD_PARAMETER;
+#endif
}
/*
@@ -251,6 +257,7 @@
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 @@
pci_conf_write(pc, tag, Register & ~3, tmp);
return AE_OK;
+#else
+ return AE_BAD_PARAMETER;
+#endif
}
Home |
Main Index |
Thread Index |
Old Index