Kyösti Mälkki ([email protected]) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1949
-gerrit commit 8fbe22e701ef6cf6caae40c42e2550d66a083f85 Author: Kyösti Mälkki <[email protected]> Date: Tue Nov 27 13:51:30 2012 +0200 Add macros for component paths __CHIP_PREFIX__ expands to the component path, like southbridge_intel_i82801gx_ 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 <[email protected]> --- 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 endif +# 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) else 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 { -- coreboot mailing list: [email protected] http://www.coreboot.org/mailman/listinfo/coreboot

