fix(rmm): replace ARRAY_READ/WRITE macros with direct read/write
In sysregs.c 'rt' index of reads/writes from/to 'rec->regs[rt]'
is being checked for maximum possible value of 31 corresonding
to XZR and all these cases are handled safely, so there is no
need for using ARRAY_READ/WRITE macros which cause performance
deterioration.
This patch replaces usage of ARRAY_READ/WRITE macros with direct
read and writes commands and renames those macros to
SAFE_ARRAY_READ/WRITE.
The patch removes 'esr_sysreg_rt()' inline function
defined in esr.h and replaces calls to it with modified
ESR_EL2_SYSREG_ISS_RT macro.
Signed-off-by: AlexeiFedorov <Alexei.Fedorov@arm.com>
Change-Id: Ib2d9996ef380ffb9cdcafa320ded9fa991d9a378
diff --git a/lib/common/include/utils_def.h b/lib/common/include/utils_def.h
index 2dc310a..604cd6e 100644
--- a/lib/common/include/utils_def.h
+++ b/lib/common/include/utils_def.h
@@ -85,7 +85,7 @@
* _i: index
* _v: variable/value to write
*/
-#define ARRAY_READ(_a, _i, _v) \
+#define SAFE_ARRAY_READ(_a, _i, _v) \
({ \
CHECK_ARRAY_TYPE(_a, _v); \
if (_i >= ARRAY_SIZE(_a)) { \
@@ -94,7 +94,7 @@
_v = _a[_i]; \
})
-#define ARRAY_WRITE(_a, _i, _v) \
+#define SAFE_ARRAY_WRITE(_a, _i, _v) \
({ \
CHECK_ARRAY_TYPE(_a, _v); \
if (_i >= ARRAY_SIZE(_a)) { \