1 /* 2 ** Copyright 2003-2010, VisualOn, Inc. 3 ** 4 ** Licensed under the Apache License, Version 2.0 (the "License"); 5 ** you may not use this file except in compliance with the License. 6 ** You may obtain a copy of the License at 7 ** 8 ** http://www.apache.org/licenses/LICENSE-2.0 9 ** 10 ** Unless required by applicable law or agreed to in writing, software 11 ** distributed under the License is distributed on an "AS IS" BASIS, 12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 ** See the License for the specific language governing permissions and 14 ** limitations under the License. 15 */ 16 /******************************************************************************* 17 File: cmnMemory.h 18 19 Content: memory operator implementation header file 20 21 *******************************************************************************/ 22 23 #ifndef __cmnMemory_H__ 24 #define __cmnMemory_H__ 25 26 #ifdef __cplusplus 27 extern "C" { 28 #endif /* __cplusplus */ 29 30 #include <voMem.h> 31 32 //extern VO_MEM_OPERATOR g_memOP; 33 34 /** 35 * Allocate memory 36 * \param uID [in] module ID 37 * \param uSize [in] size of memory 38 * \return value is the allocated memory address. NULL is failed. 39 */ 40 VO_U32 cmnMemAlloc (VO_S32 uID, VO_MEM_INFO * pMemInfo); 41 42 /** 43 * Free up memory 44 * \param uID [in] module ID 45 * \param pMem [in] address of memory 46 * \return value 0, if succeeded. 47 */ 48 VO_U32 cmnMemFree (VO_S32 uID, VO_PTR pBuffer); 49 50 /** 51 * memory set function 52 * \param uID [in] module ID 53 * \param pBuff [in/out] address of memory 54 * \param uValue [in] the value to be set 55 * \param uSize [in] the size to be set 56 * \return value 0, if succeeded. 57 */ 58 VO_U32 cmnMemSet (VO_S32 uID, VO_PTR pBuff, VO_U8 uValue, VO_U32 uSize); 59 60 /** 61 * memory copy function 62 * \param uID [in] module ID 63 * \param pDest [in/out] address of destination memory 64 * \param pSource [in] address of source memory 65 * \param uSize [in] the size to be copied 66 * \return value 0, if succeeded. 67 */ 68 VO_U32 cmnMemCopy (VO_S32 uID, VO_PTR pDest, VO_PTR pSource, VO_U32 uSize); 69 70 /** 71 * memory check function 72 * \param uID [in] module ID 73 * \param pBuff [in] address of buffer to be checked 74 * \param uSize [in] the size to be checked 75 * \return value 0, if succeeded. 76 */ 77 VO_U32 cmnMemCheck (VO_S32 uID, VO_PTR pBuffer, VO_U32 uSize); 78 79 /** 80 * memory compare function 81 * \param uID [in] module ID 82 * \param pBuffer1 [in] address of buffer 1 to be compared 83 * \param pBuffer2 [in] address of buffer 2 to be compared 84 * \param uSize [in] the size to be compared 85 * \return value: same as standard C run-time memcmp() function. 86 */ 87 VO_S32 cmnMemCompare (VO_S32 uID, VO_PTR pBuffer1, VO_PTR pBuffer2, VO_U32 uSize); 88 89 /** 90 * memory move function 91 * \param uID [in] module ID 92 * \param pDest [in/out] address of destination memory 93 * \param pSource [in] address of source memory 94 * \param uSize [in] the size to be moved 95 * \return value 0, if succeeded. 96 */ 97 VO_U32 cmnMemMove (VO_S32 uID, VO_PTR pDest, VO_PTR pSource, VO_U32 uSize); 98 99 100 #ifdef __cplusplus 101 } 102 #endif /* __cplusplus */ 103 104 #endif // __cmnMemory_H__ 105 106 107