ump_kernel_memory_backend.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (C) 2010-2011 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. * @file ump_kernel_memory_mapping.h
  12. */
  13. #ifndef __UMP_KERNEL_MEMORY_BACKEND_H__
  14. #define __UMP_KERNEL_MEMORY_BACKEND_H__
  15. #include "ump_kernel_interface.h"
  16. #include "ump_kernel_types.h"
  17. typedef struct ump_memory_allocation
  18. {
  19. void * phys_addr;
  20. void * mapping;
  21. unsigned long size;
  22. ump_dd_handle handle;
  23. void * process_mapping_info;
  24. u32 cookie; /**< necessary on some U/K interface implementations */
  25. struct ump_session_data * ump_session; /**< Session that this allocation belongs to */
  26. _mali_osk_list_t list; /**< List for linking together memory allocations into the session's memory head */
  27. u32 is_cached;
  28. } ump_memory_allocation;
  29. typedef struct ump_memory_backend
  30. {
  31. int (*allocate)(void* ctx, ump_dd_mem * descriptor);
  32. void (*release)(void* ctx, ump_dd_mem * descriptor);
  33. void (*shutdown)(struct ump_memory_backend * backend);
  34. u32 (*stat)(struct ump_memory_backend *backend);
  35. int (*pre_allocate_physical_check)(void *ctx, u32 size);
  36. u32 (*adjust_to_mali_phys)(void *ctx, u32 cpu_phys);
  37. void * ctx;
  38. } ump_memory_backend;
  39. ump_memory_backend * ump_memory_backend_create ( void );
  40. void ump_memory_backend_destroy( void );
  41. #endif /*__UMP_KERNEL_MEMORY_BACKEND_H__ */