refactor(cpus): shorten errata flag defines

The cpu-ops makefile has errata flag definition and flag processing done
per flag in separate parts in the file. Rework this to make a list and
do this in a much more concise way.

To ensure no flags were missed, a bash script [1] was used to verify all
errata flags made it across. Only the first few flags with different
naming were checked manually.

[1]:
sed -n "s/CPU_FLAG_LIST += ERRATA_\(.*\)/\1/p" lib/cpus/cpu-ops.mk > \
	/tmp/new
git checkout origin/master
sed -n "s/ERRATA_\([[:alnum:]_-]*\)\s*?=0/\1/p" lib/cpus/cpu-ops.mk > \
	/tmp/old
diff /tmp/old /tmp/new

Signed-off-by: Boyan Karatotev <boyan.karatotev@arm.com>
Change-Id: I3b88af46838cc26f42d2c66b31f96c0855fa406c
This commit is contained in:
Boyan Karatotev 2022-11-17 12:01:29 +00:00
parent 4c985e8674
commit e444763d65
2 changed files with 730 additions and 1421 deletions

File diff suppressed because it is too large Load diff

View file

@ -38,6 +38,18 @@ define uppercase
$(eval uppercase_result:=$(call uppercase_internal,$(uppercase_table),$(1)))$(uppercase_result)
endef
# Convenience function for setting a variable to 0 if not previously set
# $(eval $(call default_zero,FOO))
define default_zero
$(eval $(1) ?= 0)
endef
# Convenience function for setting a list of variables to 0 if not previously set
# $(eval $(call default_zeros,FOO BAR))
define default_zeros
$(foreach var,$1,$(eval $(call default_zero,$(var))))
endef
# Convenience function for adding build definitions
# $(eval $(call add_define,FOO)) will have:
# -DFOO if $(FOO) is empty; -DFOO=$(FOO) otherwise
@ -45,7 +57,6 @@ define add_define
DEFINES += -D$(1)$(if $(value $(1)),=$(value $(1)),)
endef
# Convenience function for addding multiple build definitions
# $(eval $(call add_defines,FOO BOO))
define add_defines