feat(ras): move wait logic from assembley to C
SDEI test uses a flag to be updated through SDEI handler to ensure that
test has passed, this logic was implemented in assembly, move this logic
in C to make it easily readable.
Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Change-Id: I4c92aa7a6fbeb5fcdb4c67b0166627a539609f18
diff --git a/tftf/tests/misc_tests/test_single_fault.c b/tftf/tests/misc_tests/test_single_fault.c
index dd30572..cacd0a7 100644
--- a/tftf/tests/misc_tests/test_single_fault.c
+++ b/tftf/tests/misc_tests/test_single_fault.c
@@ -11,7 +11,7 @@
#ifdef __aarch64__
-uint64_t sdei_event_received;
+static volatile uint64_t sdei_event_received;
extern void inject_unrecoverable_ras_error(void);
extern int serror_sdei_event_handler(int ev, uint64_t arg);
@@ -51,6 +51,11 @@
inject_unrecoverable_ras_error();
+ /* Wait until the SError fires */
+ do {
+ dmbish();
+ } while (sdei_event_received == 0);
+
return TEST_RESULT_SUCCESS;
}