#include "mali_memory_cow.h"
#include "mali_memory_swap_alloc.h"
#include "mali_memory_defer_bind.h"
+#if defined(CONFIG_DMA_SHARED_BUFFER)
+#include "mali_memory_secure.h"
+#endif
extern unsigned int mali_dedicated_mem_size;
extern unsigned int mali_shared_mem_size;
}
} else {
MALI_PRINT_ERROR(("Mali vma fault! It never happen, indicating some logic errors in caller.\n"));
+ /*NOT support yet or OOM*/
+ return VM_FAULT_OOM;
}
return VM_FAULT_NOPAGE;
}
(MALI_MEM_BACKEND_FLAG_SWAP_COWED == (mem_bkend->flags & MALI_MEM_BACKEND_FLAG_SWAP_COWED)))) {
/*For swappable memory, CPU page table will be created by page fault handler. */
ret = 0;
+ } else if (mem_bkend->type == MALI_MEM_SECURE) {
+#if defined(CONFIG_DMA_SHARED_BUFFER)
+ ret = mali_mem_secure_cpu_map(mem_bkend, vma);
+#else
+ MALI_DEBUG_PRINT(1, ("DMA not supported for mali secure memory\n"));
+ return -EFAULT;
+#endif
} else {
/* Not support yet*/
MALI_DEBUG_PRINT_ERROR(("Invalid type of backend memory! \n"));