[coreboot-gerrit] Change in coreboot[master]: Makefile.inc: Ignore IASL empty resource template warnings

Martin Roth (Code Review) gerrit at coreboot.org
Thu May 17 18:20:24 CEST 2018


Martin Roth has uploaded this change for review. ( https://review.coreboot.org/26352


Change subject: Makefile.inc: Ignore IASL empty resource template warnings
......................................................................

Makefile.inc: Ignore IASL empty resource template warnings

As I mention in the comment, this is valid ASL, which was added as
a warning with the comment "This would appear to be worthless in
real-world ASL code."  While code using empty resource templates
could probably be rewritten, this seems like an arbitrary choice
to generate this as a warning, since it's valid.

This gets rid of warnings such as this one:
dsdt.aml   2975:    Return (ResourceTemplate() {})
Warning  3150 - Empty Resource Template (END_TAG only)

Which is generated by this code in google/rambi/acpi/mainboard.asl:
Method (_CRS)
{
  /* Only return interrupt if I2C1 is PCI mode */
  If (LEqual (\S1EN, 0)) {
    Return (^RBUF)
  }
  /* Return empty resource template otherwise */
  Return (ResourceTemplate() {})
}

Change-Id: I9cfe9069c738a284aa85feada9d58e1aee97e433
Signed-off-by: Martin Roth <martinroth at google.com>
---
M Makefile.inc
1 file changed, 10 insertions(+), 1 deletion(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/52/26352/1

diff --git a/Makefile.inc b/Makefile.inc
index b11f6e2..e845541 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -241,6 +241,15 @@
 # Add handler to compile ACPI's ASL
 # arg1: base file name
 # arg2: y or n for including in cbfs. defaults to y
+
+# Empty resource templates were marked as a warning in IASL with the comment
+# "This would appear to be worthless in real-world ASL code.", which is
+# possibly true in many cases.  In other cases it seems that an empty
+# ResourceTemplate is the correct code.
+# As it's valid ASL, disable the warning.
+EMPTY_RESOURCE_TEMPLATE_WARNING = 3150
+IGNORED_IASL_WARNINGS = -vw $(EMPTY_RESOURCE_TEMPLATE_WARNING)
+
 define asl_template
 $(CONFIG_CBFS_PREFIX)/$(1).aml-file = $(obj)/$(1).aml
 $(CONFIG_CBFS_PREFIX)/$(1).aml-type = raw
@@ -250,7 +259,7 @@
 $(obj)/$(1).aml: $(src)/mainboard/$(MAINBOARDDIR)/$(1).asl $(obj)/config.h
 	@printf "    IASL       $$(subst $(top)/,,$$(@))\n"
 	$(CC_ramstage) -x assembler-with-cpp -E -MMD -MT $$(@) $$(CPPFLAGS_ramstage) -D__ACPI__ -P -include $(src)/include/kconfig.h -I$(obj) -I$(src) -I$(src)/include -I$(src)/arch/$(ARCHDIR-$(ARCH-ramstage-y))/include -I$(src)/mainboard/$(MAINBOARDDIR) $$< -o $$@
-	cd $$(dir $$@); $(IASL) -we -p $$(notdir $$@) $$(notdir $$@)
+	cd $$(dir $$@); $(IASL) $(IGNORED_IASL_WARNINGS) -we -p $$(notdir $$@) $$(notdir $$@)
 	if [ -z "$$$$($(IASL) -d $$@ 2>&1 | grep 'ACPI Warning')" ]; then echo "    IASL       $$@ disassembled correctly."; true; else echo "Error: Could not correctly disassemble $$@"; $(IASL) -d $$@; false; fi
 endef
 

-- 
To view, visit https://review.coreboot.org/26352
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: I9cfe9069c738a284aa85feada9d58e1aee97e433
Gerrit-Change-Number: 26352
Gerrit-PatchSet: 1
Gerrit-Owner: Martin Roth <martinroth at google.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180517/f7040313/attachment.html>


More information about the coreboot-gerrit mailing list