feat: spm helper functions for MP tests
Added two helper functions to help with SPM tests in a MP setup.
- spm_core_sp_init: to initialize an SP in a given core.
- get_current_core_id: to get the current core ID.
Signed-off-by: J-Alves <joao.alves@arm.com>
Change-Id: Iad10d43f258f5ed05ce52b87c94a9333c228f26d
diff --git a/include/plat/common/platform.h b/include/plat/common/platform.h
index f3536ba..c8b785c 100644
--- a/include/plat/common/platform.h
+++ b/include/plat/common/platform.h
@@ -8,6 +8,7 @@
#define __PLATFORM_H__
#include <stdint.h>
+#include <arch_helpers.h>
#include <timer.h>
#include <xlat_tables_v2.h>
@@ -184,4 +185,12 @@
void plat_fwu_io_setup(void);
+/**
+ * Returns current executing core.
+ */
+static inline uint32_t get_current_core_id(void)
+{
+ return platform_get_core_pos(read_mpidr_el1() & MPID_MASK);
+}
+
#endif /* __PLATFORM_H__ */