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