SPRT: Rename the folder name to 'runtime'
The original name 'sprt' can be confusing if user did not read
SPRTL related document, hence rename it as 'runtime' to
indicate it is a secure partition runtime API set.
Signed-off-by: Ken Liu <Ken.Liu@arm.com>
Change-Id: I3ba7d5e80dd2ee32d52463bcdf012a2f5bf6017c
diff --git a/secure_fw/partitions/lib/runtime/rt_main.c b/secure_fw/partitions/lib/runtime/rt_main.c
new file mode 100644
index 0000000..e9ad7be
--- /dev/null
+++ b/secure_fw/partitions/lib/runtime/rt_main.c
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2022, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#include "compiler_ext_defs.h"
+#include "runtime_defs.h"
+#include "sprt_partition_metadata_indicator.h"
+#include "rt_main.h"
+
+extern void common_sfn_thread(void);
+
+__used static uintptr_t runtime_init_c(void)
+{
+ struct runtime_metadata_t *p_rt_meta;
+
+ p_rt_meta = PART_METADATA();
+
+ if (p_rt_meta->n_sfn == 0) {
+ /* IPC Partition */
+ return p_rt_meta->entry;
+ } else {
+ /* SFN Partition */
+ return (uintptr_t)common_sfn_thread;
+ }
+}
+
+#if defined(__ICCARM__)
+#pragma required = runtime_init_c
+#endif
+
+__naked void sprt_main(void)
+{
+ __asm volatile(
+#if !defined(__ICCARM__)
+ ".syntax unified \n"
+#endif
+ "bl runtime_init_c \n"
+ "bx r0 \n"
+ );
+}