1 /* 2 * Copyright (c) 2001-2019, Arm Limited and Contributors. All rights reserved. 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 */ 6 7 #ifndef _CC_PAL_MEM_INT_H 8 #define _CC_PAL_MEM_INT_H 9 10 11 #ifdef __cplusplus 12 extern "C" 13 { 14 #endif 15 16 #include <stdlib.h> 17 #include <string.h> 18 19 #include "cc_pal_compiler.h" 20 21 /** 22 * @brief File Description: 23 * This file contains the implementation for memory operations APIs. 24 * The functions implementations are generally just wrappers to different operating system calls. 25 */ 26 27 28 /*---------------------------- 29 PUBLIC FUNCTIONS 30 -------------------------------*/ 31 32 33 /*! 34 * @brief This function purpose is to compare between two given buffers according to given size. 35 * 36 * @return The return values is according to operating system return values. 37 */ 38 int32_t CC_PalMemCmpPlat( const void* aTarget, /*!< [in] The target buffer to compare. */ 39 const void* aSource, /*!< [in] The Source buffer to compare to. */ 40 size_t aSize /*!< [in] Number of bytes to compare. */); 41 /*! 42 * @brief This function purpose is to copy aSize bytes from source buffer to destination buffer. 43 * 44 * @return void. 45 */ 46 void* CC_PalMemCopyPlat( void* aDestination, /*!< [out] The destination buffer to copy bytes to. */ 47 const void* aSource, /*!< [in] The Source buffer to copy from. */ 48 size_t aSize /*!< [in] Number of bytes to copy. */ ); 49 50 51 /*! 52 * @brief This function purpose is to copy aSize bytes from source buffer to destination buffer. 53 * This function Supports overlapped buffers. 54 * 55 * @return void. 56 */ 57 void CC_PalMemMovePlat( void* aDestination, /*!< [out] The destination buffer to copy bytes to. */ 58 const void* aSource, /*!< [in] The Source buffer to copy from. */ 59 size_t aSize /*!< [in] Number of bytes to copy. */); 60 61 62 63 /*! 64 * @brief This function purpose is to set aSize bytes in the given buffer with aChar. 65 * 66 * @return void. 67 */ 68 void CC_PalMemSetPlat( void* aTarget, /*!< [out] The target buffer to set. */ 69 uint8_t aChar, /*!< [in] The char to set into aTarget. */ 70 size_t aSize /*!< [in] Number of bytes to set. */); 71 72 /*! 73 * @brief This function purpose is to set aSize bytes in the given buffer with zeroes. 74 * 75 * @return void. 76 */ 77 void CC_PalMemSetZeroPlat( void* aTarget, /*!< [out] The target buffer to set. */ 78 size_t aSize /*!< [in] Number of bytes to set. */); 79 80 81 #ifdef __cplusplus 82 } 83 #endif 84 85 #endif 86 87 88