[coreboot] Patch set updated for coreboot: 8fbe22e Add macros for component paths

Kyösti Mälkki (kyosti.malkki@gmail.com) gerrit at coreboot.org
Thu Dec 6 11:11:37 CET 2012

Kyösti Mälkki (kyosti.malkki at gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1949


commit 8fbe22e701ef6cf6caae40c42e2550d66a083f85
Author: Kyösti Mälkki <kyosti.malkki at gmail.com>
Date:   Tue Nov 27 13:51:30 2012 +0200

    Add macros for component paths
    __CHIP_PREFIX__ expands to the component path, like
    The prefix is used for DEVICE_NAME and ROOT_COMPLEX_NAME to assign
    the device name in a follow-up patch. It should be used in a similar
    fashion for struct chip_operations.
    Change-Id: I0460dc88d7551b02d54868d40437414351bd3296
    Signed-off-by: Kyösti Mälkki <kyosti.malkki at gmail.com>
 Makefile.inc                | 3 +++
 src/include/device/device.h | 7 +++++++
 2 files changed, 10 insertions(+)

diff --git a/Makefile.inc b/Makefile.inc
index b0a5341..68cd5d1 100644
--- a/Makefile.inc
+++ b/Makefile.inc
@@ -100,6 +100,9 @@ ifeq ($(CONFIG_TRACE),y)
 ramstage-c-ccopts:= -finstrument-functions
+# This macro expands to the component path like "southbridge_intel_i82801gx".
+ramstage-c-ccopts:=-D__CHIP_PREFIX__="$$(subst /,_,$$(dir $$(1)))"
 ifeq ($(CONFIG_USE_BLOBS),y)
 forgetthis:=$(shell git submodule update --init --checkout 3rdparty)
diff --git a/src/include/device/device.h b/src/include/device/device.h
index b248aaf..a32acc6 100644
--- a/src/include/device/device.h
+++ b/src/include/device/device.h
@@ -23,6 +23,13 @@ struct chip_operations {
 #define CHIP_NAME(X) .name = X,
+#define __CONCAT1(x,y) x ## y
+#define __CONCAT2(x,y) __CONCAT1(x,y)
+#define CHIP_GLOBAL(f) __CONCAT2(__CHIP_PREFIX__,f)
+#define DEVICE_NAME(s) const char CHIP_GLOBAL(name)[] = s
+#define ROOT_COMPLEX_NAME(s) const char CHIP_GLOBAL(root_complex_name)[] = s
 struct bus;
 struct device_operations {

More information about the coreboot mailing list