blob: f303dc44a37276f07e12145533690f4cb34cf8e3 [file] [log] [blame]
Mingyang Sunc4b5d8d2019-07-16 17:57:52 +08001/*
2 * Copyright (c) 2019, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#ifndef __TFM_LIBSPRT_C_H__
9#define __TFM_LIBSPRT_C_H__
10
11#include <stddef.h>
12
13/**
14 * \brief This function moves 'n' bytes from 'src' to 'dest'.
15 *
16 * \param[out] dest Destination address
17 * \param[in] src Source address
18 * \param[in] n Number of bytes to be moved
19 *
20 * \retval dest Destination address
21 * \note Memory overlap has been taken into consideration
22 * and processed properly in the function.
23 */
24void *tfm_sprt_c_memmove(void *dest, const void *src, size_t n);
25
26/**
27 * \brief This function copies 'n' bytes from 'src' to 'dest'.
28 *
29 * \param[out] dest Destination address
30 * \param[in] src Source address
31 * \param[in] n Number of bytes to be copied
32 *
33 * \retval dest Destination address
34 * \note It has the same effect as tfm_sprt_c_memmove().
35 */
36void *tfm_sprt_c_memcpy(void *dest, const void *src, size_t n);
37
Shawn Shanb47ba8b2019-07-12 16:15:44 +080038/**
39 * \brief Compare the first 'n' bytes of the memory areas 's1' and 's2'.
40 *
41 * \param[in] s1 The address of the first memory area
42 * \param[in] s2 The address of the second memory area
43 * \param[in] n The size(Byte) to compare
44 *
45 * \retval > 0 The first n bytes of s1 great than the first n
46 * bytes of s2
47 * \retval < 0 The first n bytes of s1 less than the first n
48 * bytes of s2
49 * \retval = 0 The first n bytes of s1 equal to the first n
50 * bytes of s2
51 */
52int tfm_sprt_c_memcmp(const void *s1, const void *s2, size_t n);
53
Mingyang Sunc4b5d8d2019-07-16 17:57:52 +080054#endif /* __TFM_LIBSPRT_C_H__ */