[coreboot-gerrit] Change in coreboot[master]: pci: Guard ACPI

Patrick Rudolph (Code Review) gerrit at coreboot.org
Wed Apr 18 10:36:41 CEST 2018


Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/25722


Change subject: pci: Guard ACPI
......................................................................

pci: Guard ACPI

Guard ACPI headers and functions with preprocessor directives.
Fixes compilation on non ACPI enabled platforms.

Change-Id: Iaff20463375d1e3ec573d9486a859a0514b0b390
Signed-off-by: Patrick Rudolph <patrick.rudolph at 9elements.com>
---
M src/device/pci_device.c
M src/device/pci_rom.c
M src/include/device/pci_rom.h
3 files changed, 12 insertions(+), 3 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/22/25722/1

diff --git a/src/device/pci_device.c b/src/device/pci_device.c
index c18f529..539c2a3 100644
--- a/src/device/pci_device.c
+++ b/src/device/pci_device.c
@@ -30,8 +30,9 @@
 /*
  * PCI Bus Services, see include/linux/pci.h for further explanation.
  */
-
+#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
 #include <arch/acpi.h>
+#endif
 #include <arch/io.h>
 #include <bootmode.h>
 #include <console/console.h>
@@ -695,9 +696,11 @@
 	/* If S3_VGA_ROM_RUN is disabled, skip running VGA option
 	 * ROMs when coming out of an S3 resume.
 	 */
+#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
 	if (!IS_ENABLED(CONFIG_S3_VGA_ROM_RUN) && acpi_is_wakeup_s3() &&
 		((dev->class >> 8) == PCI_CLASS_DISPLAY_VGA))
 		return 0;
+#endif
 	if (IS_ENABLED(CONFIG_ALWAYS_LOAD_OPROM))
 		return 1;
 	if (should_run_oprom(dev))
diff --git a/src/device/pci_rom.c b/src/device/pci_rom.c
index 15b0c4c..d772884 100644
--- a/src/device/pci_rom.c
+++ b/src/device/pci_rom.c
@@ -26,7 +26,9 @@
 #include <string.h>
 #include <cbfs.h>
 #include <cbmem.h>
+#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
 #include <arch/acpigen.h>
+#endif
 
 /* Rmodules don't like weak symbols. */
 u32 __attribute__((weak)) map_oprom_vendev(u32 vendev) { return vendev; }
diff --git a/src/include/device/pci_rom.h b/src/include/device/pci_rom.h
index a4aa52a..dc9f97b 100644
--- a/src/include/device/pci_rom.h
+++ b/src/include/device/pci_rom.h
@@ -2,7 +2,9 @@
 #define PCI_ROM_H
 #include <endian.h>
 #include <stddef.h>
+#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
 #include <arch/acpi.h>
+#endif
 
 #define PCI_ROM_HDR 0xAA55
 #define PCI_DATA_HDR ((uint32_t) (('R' << 24) | ('I' << 16) | ('C' << 8) | 'P'))
@@ -38,10 +40,12 @@
 struct rom_header *pci_rom_load(struct device *dev,
 	struct rom_header *rom_header);
 
+#if IS_ENABLED(CONFIG_HAVE_ACPI_TABLES)
 unsigned long
 pci_rom_write_acpi_tables(struct device *device,
-						  unsigned long current,
-						  struct acpi_rsdp *rsdp);
+			  unsigned long current,
+			  struct acpi_rsdp *rsdp);
+#endif
 
 void pci_rom_ssdt(struct device *device);
 

-- 
To view, visit https://review.coreboot.org/25722
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaff20463375d1e3ec573d9486a859a0514b0b390
Gerrit-Change-Number: 25722
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <patrick.rudolph at 9elements.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180418/0f1a9a4b/attachment-0001.html>


More information about the coreboot-gerrit mailing list