SPM: Share 'memcpy' and 'memset' with partitions
TF-M applies isolation rule I3, which allows code-sharing between
cross-domain components. This makes separating fundamental APIs
such as memset/memcpy less significant. This patch shares these
two fundamental APIs memset/memcpy between SPM and partitions.
A slight optimization is made on the implementation - removes
unnecessary half-word copying.
Change-Id: I7d4c931aefd94d56468806ab768048da156e4656
Signed-off-by: Ken Liu <Ken.Liu@arm.com>
diff --git a/secure_fw/spm/include/utilities.h b/secure_fw/spm/include/utilities.h
index 2f27487..71180c5 100644
--- a/secure_fw/spm/include/utilities.h
+++ b/secure_fw/spm/include/utilities.h
@@ -8,7 +8,7 @@
#define __TFM_UTILS_H__
#include <stdbool.h>
-#include <stdio.h>
+#include <string.h>
#include "tfm_spm_log.h"
/*
@@ -41,4 +41,8 @@
#define STRINGIFY_EXPAND(x) #x
#define M2S(m) STRINGIFY_EXPAND(m)
+/* Runtime memory operations forwarding */
+#define spm_memcpy memcpy
+#define spm_memset memset
+
#endif /* __TFM_UTILS_H__ */