117299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong/* 217299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong ** Copyright 2003-2010, VisualOn, Inc. 317299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong ** 417299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong ** Licensed under the Apache License, Version 2.0 (the "License"); 517299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong ** you may not use this file except in compliance with the License. 617299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong ** You may obtain a copy of the License at 717299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong ** 817299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong ** http://www.apache.org/licenses/LICENSE-2.0 917299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong ** 1017299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong ** Unless required by applicable law or agreed to in writing, software 1117299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong ** distributed under the License is distributed on an "AS IS" BASIS, 1217299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1317299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong ** See the License for the specific language governing permissions and 1417299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong ** limitations under the License. 1517299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong */ 1617299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong/******************************************************************************* 1717299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong File: cmnMemory.h 1817299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong 1917299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong Content: memory operator implementation header file 2017299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong 2117299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong*******************************************************************************/ 2217299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong 2317299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong#ifndef __cmnMemory_H__ 2417299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong#define __cmnMemory_H__ 2517299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong 2617299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong#ifdef __cplusplus 2717299ab50ceb70d904e610e3b2d7fb2361a11e03James Dongextern "C" { 2817299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong#endif /* __cplusplus */ 2917299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong 3017299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong#include <voMem.h> 3117299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong 3217299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong//extern VO_MEM_OPERATOR g_memOP; 3317299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong 3417299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong/** 3517299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * Allocate memory 3617299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \param uID [in] module ID 3717299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \param uSize [in] size of memory 3817299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \return value is the allocated memory address. NULL is failed. 3917299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong */ 4017299ab50ceb70d904e610e3b2d7fb2361a11e03James DongVO_U32 cmnMemAlloc (VO_S32 uID, VO_MEM_INFO * pMemInfo); 4117299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong 4217299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong/** 4317299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * Free up memory 4417299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \param uID [in] module ID 4517299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \param pMem [in] address of memory 4617299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \return value 0, if succeeded. 4717299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong */ 4817299ab50ceb70d904e610e3b2d7fb2361a11e03James DongVO_U32 cmnMemFree (VO_S32 uID, VO_PTR pBuffer); 4917299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong 5017299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong/** 5117299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * memory set function 5217299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \param uID [in] module ID 5317299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \param pBuff [in/out] address of memory 5417299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \param uValue [in] the value to be set 5517299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \param uSize [in] the size to be set 5617299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \return value 0, if succeeded. 5717299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong */ 5817299ab50ceb70d904e610e3b2d7fb2361a11e03James DongVO_U32 cmnMemSet (VO_S32 uID, VO_PTR pBuff, VO_U8 uValue, VO_U32 uSize); 5917299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong 6017299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong/** 6117299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * memory copy function 6217299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \param uID [in] module ID 6317299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \param pDest [in/out] address of destination memory 6417299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \param pSource [in] address of source memory 6517299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \param uSize [in] the size to be copied 6617299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \return value 0, if succeeded. 6717299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong */ 6817299ab50ceb70d904e610e3b2d7fb2361a11e03James DongVO_U32 cmnMemCopy (VO_S32 uID, VO_PTR pDest, VO_PTR pSource, VO_U32 uSize); 6917299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong 7017299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong/** 7117299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * memory check function 7217299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \param uID [in] module ID 7317299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \param pBuff [in] address of buffer to be checked 7417299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \param uSize [in] the size to be checked 7517299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \return value 0, if succeeded. 7617299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong */ 7717299ab50ceb70d904e610e3b2d7fb2361a11e03James DongVO_U32 cmnMemCheck (VO_S32 uID, VO_PTR pBuffer, VO_U32 uSize); 7817299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong 7917299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong/** 8017299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * memory compare function 8117299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \param uID [in] module ID 8217299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \param pBuffer1 [in] address of buffer 1 to be compared 8317299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \param pBuffer2 [in] address of buffer 2 to be compared 8417299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \param uSize [in] the size to be compared 8517299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \return value: same as standard C run-time memcmp() function. 8617299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong */ 8717299ab50ceb70d904e610e3b2d7fb2361a11e03James DongVO_S32 cmnMemCompare (VO_S32 uID, VO_PTR pBuffer1, VO_PTR pBuffer2, VO_U32 uSize); 8817299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong 8917299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong/** 9017299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * memory move function 9117299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \param uID [in] module ID 9217299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \param pDest [in/out] address of destination memory 9317299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \param pSource [in] address of source memory 9417299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \param uSize [in] the size to be moved 9517299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong * \return value 0, if succeeded. 9617299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong */ 9717299ab50ceb70d904e610e3b2d7fb2361a11e03James DongVO_U32 cmnMemMove (VO_S32 uID, VO_PTR pDest, VO_PTR pSource, VO_U32 uSize); 9817299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong 9917299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong 10017299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong#ifdef __cplusplus 10117299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong} 10217299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong#endif /* __cplusplus */ 10317299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong 10417299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong#endif // __cmnMemory_H__ 10517299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong 10617299ab50ceb70d904e610e3b2d7fb2361a11e03James Dong 107