Mistake on this page?
Report an issue in GitHub or email us
TARGET_TFM/COMPONENT_SPE/secure_fw/core/tfm_memory_utils.h
1 /*
2  * Copyright (c) 2019, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #ifndef __TFM_MEMORY_UTILS_H__
9 #define __TFM_MEMORY_UTILS_H__
10 
11 #include <string.h>
12 #include "cmsis_compiler.h"
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 /* FIXME: The following functions are wrappers around standard C library
19  * functions: memcpy, memcmp, memset
20  * In long term standard C library might be removed from TF-M project or
21  * replaced with a secure implementation due to security concerns.
22  */
23 __attribute__ ((always_inline)) __STATIC_INLINE
24 void *tfm_memcpy(void *dest, const void *src, size_t num)
25 {
26  return (memcpy(dest, src, num));
27 }
28 
29 __attribute__ ((always_inline)) __STATIC_INLINE
30 int tfm_memcmp(const void *ptr1, const void *ptr2, size_t num)
31 {
32  return (memcmp(ptr1, ptr2, num));
33 }
34 
35 __attribute__ ((always_inline)) __STATIC_INLINE
36 void *tfm_memset(void *ptr, int value, size_t num)
37 {
38  return (memset(ptr, value, num));
39 }
40 
41 #ifdef __cplusplus
42 }
43 #endif
44 
45 #endif /* __TFM_MEMORY_UTILS_H__ */
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.