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/docs/contributing/code_review_guide.rst b/docs/contributing/code_review_guide.rst
index cfc9f4d..72df4b3 100644
--- a/docs/contributing/code_review_guide.rst
+++ b/docs/contributing/code_review_guide.rst
@@ -223,7 +223,7 @@
 Service        Multiple service related changes.
 Service Name   Specific service related changes.
 SPM            secure_fw/spm/*
-SPRTL          secure-fw/partitions/lib/sprt/*
+SPRTL          secure-fw/partitions/lib/runtime/*
 ============== ====================================================
 
 .. note::
diff --git a/docs/technical_references/design_docs/source_structure.rst b/docs/technical_references/design_docs/source_structure.rst
index 74219d0..a42529e 100644
--- a/docs/technical_references/design_docs/source_structure.rst
+++ b/docs/technical_references/design_docs/source_structure.rst
@@ -117,8 +117,8 @@
 ================================= =============================================
 Folder name                       Purpose
 ================================= =============================================
-lib/sprt/\*                       The SPRTL sources and intermedia files. [1]
-lib/sprt/shared\*                 Sources can be shared by out of SPRTL. [2]
+lib/runtime/\*                    The SPRTL sources and intermedia files. [1]
+lib/runtime/shared\*              Sources can be shared by out of SPRTL. [2]
 <partition_x>/\*                  Files for 'partition_x'.
 <partition_x>/include/\*          RoT Service API headers of 'partition_x'. [3]
 <partition_y>/\*                  Files for 'partition_y'.
diff --git a/docs/technical_references/design_docs/tfm_secure_partition_runtime_library.rst b/docs/technical_references/design_docs/tfm_secure_partition_runtime_library.rst
index 97e8444..6df1c28 100644
--- a/docs/technical_references/design_docs/tfm_secure_partition_runtime_library.rst
+++ b/docs/technical_references/design_docs/tfm_secure_partition_runtime_library.rst
@@ -308,7 +308,7 @@
 Implementation
 ==============
 The SPRTL C Runtime sources are put under:
-'$TFM_ROOT/secure_fw/partitions/lib/sprt/'
+'$TFM_ROOT/secure_fw/partitions/lib/runtime/'
 
 The output of this folder is a static library named as 'libtfm_sprt.a'. The code
 of 'libtfm_sprt.a' is put into a dedicated section so that a hardware protected
diff --git a/secure_fw/partitions/CMakeLists.txt b/secure_fw/partitions/CMakeLists.txt
index d654ef9..5ad7604 100644
--- a/secure_fw/partitions/CMakeLists.txt
+++ b/secure_fw/partitions/CMakeLists.txt
@@ -20,7 +20,7 @@
 # directories of the partitions
 add_library(tfm_partition_defs INTERFACE)
 
-add_subdirectory(lib/sprt)
+add_subdirectory(lib/runtime)
 add_subdirectory(audit_logging)
 add_subdirectory(crypto)
 add_subdirectory(initial_attestation)
diff --git a/secure_fw/partitions/lib/sprt/CMakeLists.txt b/secure_fw/partitions/lib/runtime/CMakeLists.txt
similarity index 97%
rename from secure_fw/partitions/lib/sprt/CMakeLists.txt
rename to secure_fw/partitions/lib/runtime/CMakeLists.txt
index fede342..395045e 100644
--- a/secure_fw/partitions/lib/sprt/CMakeLists.txt
+++ b/secure_fw/partitions/lib/runtime/CMakeLists.txt
@@ -24,7 +24,7 @@
         ${CMAKE_SOURCE_DIR}/secure_fw/shared/crt_memcpy.c
         ${CMAKE_SOURCE_DIR}/secure_fw/shared/crt_memset.c
         $<$<BOOL:${CONFIG_TFM_PARTITION_META}>:./sprt_partition_metadata_indicator.c>
-        $<$<BOOL:${CONFIG_TFM_PARTITION_META}>:./sprt_main.c>
+        $<$<BOOL:${CONFIG_TFM_PARTITION_META}>:./rt_main.c>
         $<$<BOOL:${CONFIG_TFM_SPM_BACKEND_IPC}>:./sfn_common_thread.c>
 )
 
diff --git a/secure_fw/partitions/lib/sprt/crt_memcmp.c b/secure_fw/partitions/lib/runtime/crt_memcmp.c
similarity index 99%
rename from secure_fw/partitions/lib/sprt/crt_memcmp.c
rename to secure_fw/partitions/lib/runtime/crt_memcmp.c
index 0370ff0..da17839 100644
--- a/secure_fw/partitions/lib/sprt/crt_memcmp.c
+++ b/secure_fw/partitions/lib/runtime/crt_memcmp.c
@@ -13,6 +13,7 @@
     int result = 0;
     const uint8_t *p1 = (const uint8_t *)s1;
     const uint8_t *p2 = (const uint8_t *)s2;
+
     while (n--) {
         if ((*p1 != *p2) && (result == 0)) {
             result = *p1 - *p2;
diff --git a/secure_fw/partitions/lib/sprt/crt_memmove.c b/secure_fw/partitions/lib/runtime/crt_memmove.c
similarity index 100%
rename from secure_fw/partitions/lib/sprt/crt_memmove.c
rename to secure_fw/partitions/lib/runtime/crt_memmove.c
diff --git a/secure_fw/partitions/lib/sprt/crt_strnlen.c b/secure_fw/partitions/lib/runtime/crt_strnlen.c
similarity index 100%
rename from secure_fw/partitions/lib/sprt/crt_strnlen.c
rename to secure_fw/partitions/lib/runtime/crt_strnlen.c
diff --git a/secure_fw/partitions/lib/sprt/include/sprt_main.h b/secure_fw/partitions/lib/runtime/include/rt_main.h
similarity index 70%
rename from secure_fw/partitions/lib/sprt/include/sprt_main.h
rename to secure_fw/partitions/lib/runtime/include/rt_main.h
index eee88cb..22169ce 100644
--- a/secure_fw/partitions/lib/sprt/include/sprt_main.h
+++ b/secure_fw/partitions/lib/runtime/include/rt_main.h
@@ -5,10 +5,10 @@
  *
  */
 
-#ifndef __SPRT_MAIN_H__
-#define __SPRT_MAIN_H__
+#ifndef __RT_MAIN_H__
+#define __RT_MAIN_H__
 
 /* Common partition runtime entry - 'sprt_main' */
 void sprt_main(void);
 
-#endif /* __SPRT_MAIN_H__ */
+#endif /* __RT_MAIN_H__ */
diff --git a/secure_fw/partitions/lib/sprt/include/service_api.h b/secure_fw/partitions/lib/runtime/include/service_api.h
similarity index 100%
rename from secure_fw/partitions/lib/sprt/include/service_api.h
rename to secure_fw/partitions/lib/runtime/include/service_api.h
diff --git a/secure_fw/partitions/lib/sprt/include/tfm_sp_log.h b/secure_fw/partitions/lib/runtime/include/tfm_sp_log.h
similarity index 94%
rename from secure_fw/partitions/lib/sprt/include/tfm_sp_log.h
rename to secure_fw/partitions/lib/runtime/include/tfm_sp_log.h
index 576c0e8..bf2f67d 100644
--- a/secure_fw/partitions/lib/sprt/include/tfm_sp_log.h
+++ b/secure_fw/partitions/lib/runtime/include/tfm_sp_log.h
@@ -27,8 +27,8 @@
 #error "TFM_PARTITION_LOG_LEVEL not defined!"
 #endif
 
-#if (TFM_PARTITION_LOG_LEVEL > TFM_PARTITION_LOG_LEVEL_DEBUG || \
-     TFM_PARTITION_LOG_LEVEL < TFM_PARTITION_LOG_LEVEL_SILENCE)
+#if (TFM_PARTITION_LOG_LEVEL > TFM_PARTITION_LOG_LEVEL_DEBUG)  || \
+    (TFM_PARTITION_LOG_LEVEL < TFM_PARTITION_LOG_LEVEL_SILENCE)
 #error "Incorrect TFM_PARTITION_LOG_LEVEL value!"
 #endif
 
diff --git a/secure_fw/partitions/lib/sprt/include/tfm_strnlen.h b/secure_fw/partitions/lib/runtime/include/tfm_strnlen.h
similarity index 100%
rename from secure_fw/partitions/lib/sprt/include/tfm_strnlen.h
rename to secure_fw/partitions/lib/runtime/include/tfm_strnlen.h
diff --git a/secure_fw/partitions/lib/sprt/sprt_main.c b/secure_fw/partitions/lib/runtime/rt_main.c
similarity index 96%
rename from secure_fw/partitions/lib/sprt/sprt_main.c
rename to secure_fw/partitions/lib/runtime/rt_main.c
index caa5cd8..e9ad7be 100644
--- a/secure_fw/partitions/lib/sprt/sprt_main.c
+++ b/secure_fw/partitions/lib/runtime/rt_main.c
@@ -8,7 +8,7 @@
 #include "compiler_ext_defs.h"
 #include "runtime_defs.h"
 #include "sprt_partition_metadata_indicator.h"
-#include "sprt_main.h"
+#include "rt_main.h"
 
 extern void common_sfn_thread(void);
 
diff --git a/secure_fw/partitions/lib/sprt/service_api.c b/secure_fw/partitions/lib/runtime/service_api.c
similarity index 100%
rename from secure_fw/partitions/lib/sprt/service_api.c
rename to secure_fw/partitions/lib/runtime/service_api.c
diff --git a/secure_fw/partitions/lib/sprt/sfn_common_thread.c b/secure_fw/partitions/lib/runtime/sfn_common_thread.c
similarity index 100%
rename from secure_fw/partitions/lib/sprt/sfn_common_thread.c
rename to secure_fw/partitions/lib/runtime/sfn_common_thread.c
diff --git a/secure_fw/partitions/lib/sprt/sprt_partition_metadata_indicator.c b/secure_fw/partitions/lib/runtime/sprt_partition_metadata_indicator.c
similarity index 100%
rename from secure_fw/partitions/lib/sprt/sprt_partition_metadata_indicator.c
rename to secure_fw/partitions/lib/runtime/sprt_partition_metadata_indicator.c
diff --git a/secure_fw/partitions/lib/sprt/sprt_partition_metadata_indicator.h b/secure_fw/partitions/lib/runtime/sprt_partition_metadata_indicator.h
similarity index 100%
rename from secure_fw/partitions/lib/sprt/sprt_partition_metadata_indicator.h
rename to secure_fw/partitions/lib/runtime/sprt_partition_metadata_indicator.h
diff --git a/secure_fw/partitions/lib/sprt/tfm_sp_log_raw.c b/secure_fw/partitions/lib/runtime/tfm_sp_log_raw.c
similarity index 99%
rename from secure_fw/partitions/lib/sprt/tfm_sp_log_raw.c
rename to secure_fw/partitions/lib/runtime/tfm_sp_log_raw.c
index bf39b3d..8a8d462 100644
--- a/secure_fw/partitions/lib/sprt/tfm_sp_log_raw.c
+++ b/secure_fw/partitions/lib/runtime/tfm_sp_log_raw.c
@@ -102,7 +102,7 @@
 
     outputbuf.pos = 0;
 
-    if(fmt == NULL) {
+    if (fmt == NULL) {
         return TFM_HAL_ERROR_INVALID_INPUT;
     }