refactor(spm): helper functions for SPM's MP tests
Factored out code to power on cpus from direct messaging test, and
placed in a helper function. To be used to test other multicore
functionality.
The function expects the cpu on handler to be implemented in the scope
of the functionality to be tested.
Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: Ic0074dc85e0a906bae9d7b8cc071aff476f94de5
diff --git a/include/common/test_helpers.h b/include/common/test_helpers.h
index 332f1d8..9031b34 100644
--- a/include/common/test_helpers.h
+++ b/include/common/test_helpers.h
@@ -10,6 +10,7 @@
#include <arch_features.h>
#include <ffa_svc.h>
#include <plat_topology.h>
+#include <events.h>
#include <psci.h>
#include <spm_common.h>
#include <tftf_lib.h>
@@ -341,4 +342,14 @@
uint32_t ffa_version_minor, const struct ffa_uuid *ffa_uuids,
size_t ffa_uuids_size);
+/**
+ * Turn on all cpus to execute a test in all.
+ * - 'cpu_on_handler' should have the code containing the test.
+ * - 'cpu_booted' is used for notifying which cores the test has been executed.
+ * This should be used in the test executed by cpu_on_handler at the end of
+ * processing to make sure it complies with this function's implementation.
+ */
+test_result_t spm_run_multi_core_test(uintptr_t cpu_on_handler,
+ event_t *cpu_booted);
+
#endif /* __TEST_HELPERS_H__ */