summaryrefslogtreecommitdiff
path: root/include/lib/utils_def.h
diff options
context:
space:
mode:
authorJeenu Viswambharan <jeenu.viswambharan@arm.com>2017-08-16 11:44:25 +0100
committerIsla Mitchell <isla.mitchell@arm.com>2017-08-24 17:23:43 +0100
commitf45e232ab9c93c22c1cffa2ee4c17f34d808b918 (patch)
tree90c0c11a5cd8079afbaed3401dfc31f036864cc1 /include/lib/utils_def.h
parent096b7af7c93953673c0500156f482ad8c6da525e (diff)
Add macro to test for minimum architecture version
The macro concisely expresses and requires architecture version to be at least as required by its arguments. This would be useful when extending Trusted Firmware functionality for future architecture revisions. Replace similar usage in the current code base with the new macro. Change-Id: I9dcd0aa71a663eabd02ed9632b8ce87611fa5a57 Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
Diffstat (limited to 'include/lib/utils_def.h')
-rw-r--r--include/lib/utils_def.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/lib/utils_def.h b/include/lib/utils_def.h
index 52496000..26ac4409 100644
--- a/include/lib/utils_def.h
+++ b/include/lib/utils_def.h
@@ -73,4 +73,12 @@
# define ULL(_x) (_x##ull)
#endif
+/*
+ * Test for the current architecture version to be at least the version
+ * expected.
+ */
+#define ARM_ARCH_AT_LEAST(_maj, _min) \
+ ((ARM_ARCH_MAJOR > _maj) || \
+ ((ARM_ARCH_MAJOR == _maj) && (ARM_ARCH_MINOR >= _min)))
+
#endif /* __UTILS_DEF_H__ */