SPM: Remove thread management in SFN backend
In SFN backend, there is only one thread, so thread switch
will never happen. This patch is to remove the thread
context in partition struct and thread management in SPM.
Signed-off-by: Sherry Zhang <sherry.zhang2@arm.com>
Change-Id: Ie31dc5271f5fb1b32bbfc5312b02c736a85b9103
diff --git a/secure_fw/spm/include/current.h b/secure_fw/spm/include/current.h
index e69473d..63a25bd 100644
--- a/secure_fw/spm/include/current.h
+++ b/secure_fw/spm/include/current.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021, Arm Limited. All rights reserved.
+ * Copyright (c) 2021-2022, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -10,9 +10,17 @@
#include "thread.h"
#include "spm_ipc.h"
+#if CONFIG_TFM_SPM_BACKEND_SFN != 1
/* Get current component */
#define GET_CURRENT_COMPONENT() GET_CTX_OWNER(CURRENT_THREAD->p_context_ctrl)
/* Set current component */
#define SET_CURRENT_COMPONENT(p) THRD_UPDATE_CUR_CTXCTRL(&(p)->ctx_ctrl)
+#else
+extern struct partition_t *p_current_partition;
+/* Get current component */
+#define GET_CURRENT_COMPONENT() p_current_partition
+/* Set current component */
+#define SET_CURRENT_COMPONENT(p) p_current_partition = p
+#endif
#endif /* __CURRENT_H__ */