upload tizen1.0 source
[kernel/linux-2.6.36.git] / drivers / media / video / samsung / ump / common / ump_kernel_memory_backend.h
1 /*
2  * Copyright (C) 2010 ARM Limited. All rights reserved.
3  * 
4  * This program is free software and is provided to you under the terms of the GNU General Public License version 2
5  * as published by the Free Software Foundation, and any use by you of this program is subject to the terms of such GNU licence.
6  * 
7  * A copy of the licence is included with the program, and can also be obtained from Free Software
8  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
9  */
10
11 /**
12  * @file ump_kernel_memory_mapping.h
13  */
14
15 #ifndef __UMP_KERNEL_MEMORY_BACKEND_H__
16 #define __UMP_KERNEL_MEMORY_BACKEND_H__
17
18 #include "ump_kernel_interface.h"
19 #include "ump_kernel_types.h"
20
21
22 typedef struct ump_memory_allocation
23 {
24         void                    * phys_addr;
25         void                    * mapping;
26         unsigned long             size;
27         ump_dd_handle             handle;
28         void                    * process_mapping_info;
29         u32                       cookie;               /**< necessary on some U/K interface implementations */
30         struct ump_session_data * ump_session;          /**< Session that this allocation belongs to */
31         _mali_osk_list_t          list;                 /**< List for linking together memory allocations into the session's memory head */
32         u32 is_cached;
33 } ump_memory_allocation;
34
35 typedef struct ump_memory_backend
36 {
37         int  (*allocate)(void* ctx, ump_dd_mem * descriptor);
38         void (*release)(void* ctx, ump_dd_mem * descriptor);
39         void (*shutdown)(struct ump_memory_backend * backend);
40         u32  (*stat)(struct ump_memory_backend *backend);
41         int  (*pre_allocate_physical_check)(void *ctx, u32 size);
42         u32  (*adjust_to_mali_phys)(void *ctx, u32 cpu_phys);
43         void *(*get)(ump_dd_mem *mem, void *args);
44         void (*set)(ump_dd_mem *mem, void *args);
45         void * ctx;
46 } ump_memory_backend;
47
48 ump_memory_backend * ump_memory_backend_create ( void );
49 void ump_memory_backend_destroy( void );
50
51 #endif /*__UMP_KERNEL_MEMORY_BACKEND_H__ */
52