aboutsummaryrefslogtreecommitdiffstats
path: root/include/lib/utils_def.h
diff options
context:
space:
mode:
authorJeenu Viswambharan <jeenu.viswambharan@arm.com>2017-12-07 08:43:05 +0000
committerJeenu Viswambharan <jeenu.viswambharan@arm.com>2018-05-04 08:33:17 +0100
commit30d81c36da441bcd0fbccbc3ac1a7268d2cc5ad2 (patch)
tree4834b91958ace9dfd61d7776de15f6bd737ba6a3 /include/lib/utils_def.h
parent14c6016ad5ff4ac22861dff03129a646ad02c6dd (diff)
downloadplatform_external_arm-trusted-firmware-30d81c36da441bcd0fbccbc3ac1a7268d2cc5ad2.tar.gz
platform_external_arm-trusted-firmware-30d81c36da441bcd0fbccbc3ac1a7268d2cc5ad2.tar.bz2
platform_external_arm-trusted-firmware-30d81c36da441bcd0fbccbc3ac1a7268d2cc5ad2.zip
RAS: Add helpers to access Standard Error Records
The ARMv8 RAS Extensions introduced Standard Error Records which are a set of standard registers through which: - Platform can configure RAS node policy; e.g., notification mechanism; - RAS nodes can record and expose error information for error handling agents. Standard Error Records can either be accessed via. memory-mapped or System registers. This patch adds helper functions to access registers and fields within an error record. Change-Id: I6594ba799f4a1789d7b1e45b3e17fd40e7e0ba5c Signed-off-by: Jeenu Viswambharan <jeenu.viswambharan@arm.com>
Diffstat (limited to 'include/lib/utils_def.h')
-rw-r--r--include/lib/utils_def.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/lib/utils_def.h b/include/lib/utils_def.h
index 8abc73c09..31b129454 100644
--- a/include/lib/utils_def.h
+++ b/include/lib/utils_def.h
@@ -68,6 +68,13 @@
(((ptr) > UINTPTR_MAX - (inc)) ? 1 : 0)
/*
+ * Evaluates to 1 if (u32 + inc) overflows, 0 otherwise.
+ * Both arguments must be 32-bit unsigned integers (i.e. effectively uint32_t).
+ */
+#define check_u32_overflow(u32, inc) \
+ ((u32) > (UINT32_MAX - (inc)) ? 1 : 0)
+
+/*
* For those constants to be shared between C and other sources, apply a 'u'
* or 'ull' suffix to the argument only in C, to avoid undefined or unintended
* behaviour.