aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2024-10-25 14:40:28 +0100
committerMichael Brown <mcb30@ipxe.org>2024-10-25 14:40:28 +0100
commitcc45ca372c9e297c961ee40911753be89f38170a (patch)
tree35b89c6015993a1181024798936b5c7eb8b4213a
parentabfa7c3ab1323967c38b11d4732b2d27ecf2f094 (diff)
downloadipxe-cc45ca372c9e297c961ee40911753be89f38170a.tar.gz
[pci] Drag in PCI settings mechanism only when PCI support is present
Allow for the existence of platforms with no PCI bus by including the PCI settings mechanism only if PCI bus support is included. Signed-off-by: Michael Brown <mcb30@ipxe.org>
-rw-r--r--src/config/config.c3
-rw-r--r--src/config/config_pci.c36
-rw-r--r--src/drivers/bus/pci.c6
3 files changed, 42 insertions, 3 deletions
diff --git a/src/config/config.c b/src/config/config.c
index 4cfa5dd41..254bff995 100644
--- a/src/config/config.c
+++ b/src/config/config.c
@@ -352,9 +352,6 @@ REQUIRE_OBJECT ( efi_bofm );
/*
* Drag in relevant settings sources
*/
-#ifdef PCI_SETTINGS
-REQUIRE_OBJECT ( pci_settings );
-#endif
#ifdef VMWARE_SETTINGS
REQUIRE_OBJECT ( guestinfo );
#endif
diff --git a/src/config/config_pci.c b/src/config/config_pci.c
new file mode 100644
index 000000000..cb8df712a
--- /dev/null
+++ b/src/config/config_pci.c
@@ -0,0 +1,36 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ *
+ * You can also choose to distribute this program under the terms of
+ * the Unmodified Binary Distribution Licence (as given in the file
+ * COPYING.UBDL), provided that you have satisfied its requirements.
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+
+#include <config/settings.h>
+
+/** @file
+ *
+ * PCI configuration options
+ *
+ */
+
+PROVIDE_REQUIRING_SYMBOL();
+
+#ifdef PCI_SETTINGS
+REQUIRE_OBJECT ( pci_settings );
+#endif
diff --git a/src/drivers/bus/pci.c b/src/drivers/bus/pci.c
index 05c9a5c26..60740ac18 100644
--- a/src/drivers/bus/pci.c
+++ b/src/drivers/bus/pci.c
@@ -438,3 +438,9 @@ struct root_device pci_root_device __root_device = {
.dev = { .name = "PCI" },
.driver = &pci_root_driver,
};
+
+/* Drag in objects via pcibus_probe() */
+REQUIRING_SYMBOL ( pcibus_probe );
+
+/* Drag in PCI configuration */
+REQUIRE_OBJECT ( config_pci );