2 * Copyright (C) 2010 ARM Limited. All rights reserved.
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.
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.
12 * @file ump_kernel_memory_mapping.h
15 #ifndef __UMP_KERNEL_MEMORY_BACKEND_H__
16 #define __UMP_KERNEL_MEMORY_BACKEND_H__
18 #include "ump_kernel_interface.h"
19 #include "ump_kernel_types.h"
22 typedef struct ump_memory_allocation
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 */
33 } ump_memory_allocation;
35 typedef struct ump_memory_backend
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);
48 ump_memory_backend * ump_memory_backend_create ( void );
49 void ump_memory_backend_destroy( void );
51 #endif /*__UMP_KERNEL_MEMORY_BACKEND_H__ */