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_PLAT_H 8 #define _CC_PAL_MEM_PLAT_H 9 10 11 #ifdef __cplusplus 12 extern "C" 13 { 14 #endif 15 16 #include <stdlib.h> 17 #include <string.h> 18 19 20 /** 21 * @brief File Description: 22 * This file contains the implementation for memory operations APIs. 23 * The functions implementations are generally just wrappers to different operating system calls. 24 */ 25 26 27 /*---------------------------- 28 PUBLIC FUNCTIONS 29 -------------------------------*/ 30 31 32 /*! 33 * @brief This function purpose is to compare between two given buffers according to given size. 34 * 35 * @return The return values is according to operating system return values. 36 */ 37 int32_t CC_PalMemCmpPlat( const void* aTarget, /*!< [in] The target buffer to compare. */ 38 const void* aSource, /*!< [in] The Source buffer to compare to. */ 39 size_t aSize /*!< [in] Number of bytes to compare. */); 40 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