Commit | Line | Data |
---|---|---|
a9bdc01e T |
1 | /* |
2 | * | |
3 | * Copyright 2012 Samsung Electronics S.LSI 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 Exynos_OSAL_SharedMemory.h | |
20 | * @brief | |
21 | * @author SeungBeom Kim (sbcrux.kim@samsung.com) | |
22 | * Taehwan Kim (t_h.kim@samsung.com) | |
23 | * @version 2.0.0 | |
24 | * @history | |
25 | * 2012.02.20 : Create | |
26 | */ | |
27 | ||
28 | #ifndef EXYNOS_OSAL_SHAREDMEMORY | |
29 | #define EXYNOS_OSAL_SHAREDMEMORY | |
30 | ||
31 | #include "OMX_Types.h" | |
32 | ||
33 | typedef enum _MEMORY_TYPE | |
34 | { | |
35 | NORMAL_MEMORY = 0x00, | |
36 | CACHED_MEMORY = 0x01, /* cached */ | |
37 | CONTIG_MEMORY = 0x02, /* continuos */ | |
38 | SECURE_MEMORY = 0x04, /* secure */ | |
39 | EXT_MEMORY = 0x08, /* ext area */ | |
40 | } MEMORY_TYPE; | |
41 | ||
42 | #ifdef __cplusplus | |
43 | extern "C" { | |
44 | #endif | |
45 | ||
46 | OMX_HANDLETYPE Exynos_OSAL_SharedMemory_Open(); | |
47 | void Exynos_OSAL_SharedMemory_Close(OMX_HANDLETYPE handle); | |
48 | OMX_PTR Exynos_OSAL_SharedMemory_Alloc(OMX_HANDLETYPE handle, OMX_U32 size, MEMORY_TYPE memoryType); | |
49 | void Exynos_OSAL_SharedMemory_Free(OMX_HANDLETYPE handle, OMX_PTR pBuffer); | |
50 | int Exynos_OSAL_SharedMemory_VirtToION(OMX_HANDLETYPE handle, OMX_PTR pBuffer); | |
51 | OMX_PTR Exynos_OSAL_SharedMemory_IONToVirt(OMX_HANDLETYPE handle, int ion_addr); | |
52 | ||
53 | #ifdef USE_DMA_BUF | |
54 | OMX_PTR Exynos_OSAL_SharedMemory_Map(OMX_HANDLETYPE handle, OMX_U32 size, unsigned int ionfd); | |
55 | void Exynos_OSAL_SharedMemory_Unmap(OMX_HANDLETYPE handle, unsigned int ionfd); | |
56 | #endif | |
57 | ||
58 | #ifdef __cplusplus | |
59 | } | |
60 | #endif | |
61 | ||
62 | #endif | |
63 |