SPRTL: 'memory copy' and 'memory move' functions
- Create a directory for Secure Partition Runtime Library source files.
- Implement tfm_sprt_c_memcpy() and tfm_sprt_c_memmove() functions.
- Create CMakefile for Secure Partition Runtime Library.
- Support byte, double byte, quad byte copy.
Change-Id: I77151a1cae3aa43c7ce265d1c19e458ade4b51f3
Signed-off-by: Mingyang Sun <mingyang.sun@arm.com>
diff --git a/secure_fw/lib/sprt/tfm_libsprt_c.h b/secure_fw/lib/sprt/tfm_libsprt_c.h
new file mode 100644
index 0000000..7dd2259
--- /dev/null
+++ b/secure_fw/lib/sprt/tfm_libsprt_c.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2019, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#ifndef __TFM_LIBSPRT_C_H__
+#define __TFM_LIBSPRT_C_H__
+
+#include <stddef.h>
+
+/**
+ * \brief This function moves 'n' bytes from 'src' to 'dest'.
+ *
+ * \param[out] dest Destination address
+ * \param[in] src Source address
+ * \param[in] n Number of bytes to be moved
+ *
+ * \retval dest Destination address
+ * \note Memory overlap has been taken into consideration
+ * and processed properly in the function.
+ */
+void *tfm_sprt_c_memmove(void *dest, const void *src, size_t n);
+
+/**
+ * \brief This function copies 'n' bytes from 'src' to 'dest'.
+ *
+ * \param[out] dest Destination address
+ * \param[in] src Source address
+ * \param[in] n Number of bytes to be copied
+ *
+ * \retval dest Destination address
+ * \note It has the same effect as tfm_sprt_c_memmove().
+ */
+void *tfm_sprt_c_memcpy(void *dest, const void *src, size_t n);
+
+#endif /* __TFM_LIBSPRT_C_H__ */