rules.h: Add ENV_ macros to detect current architecture

Hardware / Coreboot - Julius Werner [chromium.org] - 17 November 2015 14:31 UTC

This patch expands the existing ENV_ macros in with a set of ENV_ macros which can be used to detect which architecture the current compilation unit is built for. These are more consistent than compiler-defined macros (like '#ifdef __arm__') and will make it easier to write small, architecture-dependent differences in common code (where we currently often use IS_ENABLED(CONFIG_ARCH_...), which is technically incorrect in a world where every stage can run on a different architecture, and merely kinda happened to work out for now).

Also remove a vestigal from ARM64 which was no longer used, and genericise ARM subarchitecture Makefiles a little to make things like __COREBOOT_ARM_ARCH__ available from all file types (including .ld).

BUG=None TEST=Compiled Falco, Blaze, Jerry and Smaug.

Change-Id: Id51aeb290b5c215c653e42a51919d0838e28621f

d3634c1 rules.h: Add ENV_ macros to detect current architecture
src/arch/arm/armv4/Makefile.inc | 18 ++----
src/arch/arm/armv7/Makefile.inc | 42 ++++++------
src/arch/arm64/armv8/Makefile.inc | 23 ++-----
src/arch/arm64/include/armv8/arch/rules.h | 30 ---------
src/include/rules.h | 100 +++++++++++++++++++++++++++++
toolchain.inc | 2 +-
6 files changed, 134 insertions(+), 81 deletions(-)

Upstream: review.coreboot.org


  • Share