Cactus: make ffa_id global
Change-Id: Ic6744c726bbd452782a08b0791186b10f69981b0
Signed-off-by: Manish Pandey <manish.pandey2@arm.com>
Signed-off-by: Olivier Deprez <olivier.deprez@arm.com>
diff --git a/spm/cactus/cactus_main.c b/spm/cactus/cactus_main.c
index 8cd57e7..45d2db0 100644
--- a/spm/cactus/cactus_main.c
+++ b/spm/cactus/cactus_main.c
@@ -33,6 +33,9 @@
extern void secondary_cold_entry(void);
+/* Global ffa_id */
+ffa_vm_id_t g_ffa_id;
+
/*
*
* Message loop function
@@ -176,18 +179,17 @@
/* Get current FFA id */
smc_ret_values ffa_id_ret = ffa_id_get();
+ ffa_vm_id_t ffa_id = (ffa_vm_id_t)(ffa_id_ret.ret2 & 0xffff);
if (ffa_func_id(ffa_id_ret) != FFA_SUCCESS_SMC32) {
ERROR("FFA_ID_GET failed.\n");
panic();
}
- ffa_vm_id_t ffa_id = ffa_id_ret.ret2 & 0xffff;
if (primary_cold_boot == true) {
/* Clear BSS */
memset((void *)CACTUS_BSS_START,
0, CACTUS_BSS_END - CACTUS_BSS_START);
-
mb.send = (void *) get_sp_tx_start(ffa_id);
mb.recv = (void *) get_sp_rx_start(ffa_id);
@@ -195,6 +197,12 @@
cactus_plat_configure_mmu(ffa_id);
}
+ /*
+ * The local ffa_id value is held on the stack. The global g_ffa_id
+ * value is set after BSS is cleared.
+ */
+ g_ffa_id = ffa_id;
+
enable_mmu_el1(0);
/* Enable IRQ/FIQ */