1 /* 2 * 3 * Copyright 2013 Rockchip Electronics Co., LTD. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 */ 17 18 /* 19 * @file Rockchip_OSAL_Memory.h 20 * @brief 21 * @author csy(csy@rock-chips.com) 22 * @version 1.0.0 23 * @history 24 * 2013.11.26 : Create 25 */ 26 27 28 #ifndef Rockchip_OSAL_MEMORY 29 #define Rockchip_OSAL_MEMORY 30 31 #include "OMX_Types.h" 32 #include "Rockchip_OSAL_Log.h" 33 34 typedef enum _MEMORY_TYPE { 35 NORMAL_MEMORY = 0x00, 36 SECURE_MEMORY = 0x01, 37 SYSTEM_MEMORY = 0x02 38 } MEMORY_TYPE; 39 40 #define Rockchip_OSAL_Malloc(size) \ 41 Rockchip_OSAL_Malloc_With_Caller(size, ROCKCHIP_LOG_TAG, __FUNCTION__, __LINE__) 42 43 #define Rockchip_OSAL_Free(addr) \ 44 Rockchip_OSAL_Free_With_Caller(addr, ROCKCHIP_LOG_TAG, __FUNCTION__, __LINE__) 45 46 #ifdef __cplusplus 47 extern "C" { 48 #endif 49 50 OMX_PTR Rockchip_OSAL_Malloc_With_Caller( 51 OMX_U32 size, 52 const char *tag, 53 const char *caller, 54 const OMX_U32 line); 55 void Rockchip_OSAL_Free_With_Caller( 56 OMX_PTR addr, 57 const char *tag, 58 const char *caller, 59 const OMX_U32 line); 60 OMX_S32 Rockchip_OSAL_Memset(OMX_PTR dest, OMX_S32 c, OMX_S32 n); 61 OMX_S32 Rockchip_OSAL_Memcpy(OMX_PTR dest, OMX_PTR src, OMX_S32 n); 62 OMX_S32 Rockchip_OSAL_Memmove(OMX_PTR dest, OMX_PTR src, OMX_S32 n); 63 64 #ifdef __cplusplus 65 } 66 #endif 67 68 #endif