#include <linux/cma.h>
#include <linux/dma-buf.h>
#include <linux/dma-heap.h>
#include <linux/dma-map-ops.h>
#include <linux/err.h>
#include <linux/highmem.h>
#include <linux/io.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/scatterlist.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
struct cma_heap { … };
struct cma_heap_buffer { … };
struct dma_heap_attachment { … };
static int cma_heap_attach(struct dma_buf *dmabuf,
struct dma_buf_attachment *attachment)
{ … }
static void cma_heap_detach(struct dma_buf *dmabuf,
struct dma_buf_attachment *attachment)
{ … }
static struct sg_table *cma_heap_map_dma_buf(struct dma_buf_attachment *attachment,
enum dma_data_direction direction)
{ … }
static void cma_heap_unmap_dma_buf(struct dma_buf_attachment *attachment,
struct sg_table *table,
enum dma_data_direction direction)
{ … }
static int cma_heap_dma_buf_begin_cpu_access(struct dma_buf *dmabuf,
enum dma_data_direction direction)
{ … }
static int cma_heap_dma_buf_end_cpu_access(struct dma_buf *dmabuf,
enum dma_data_direction direction)
{ … }
static vm_fault_t cma_heap_vm_fault(struct vm_fault *vmf)
{ … }
static const struct vm_operations_struct dma_heap_vm_ops = …;
static int cma_heap_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma)
{ … }
static void *cma_heap_do_vmap(struct cma_heap_buffer *buffer)
{ … }
static int cma_heap_vmap(struct dma_buf *dmabuf, struct iosys_map *map)
{ … }
static void cma_heap_vunmap(struct dma_buf *dmabuf, struct iosys_map *map)
{ … }
static void cma_heap_dma_buf_release(struct dma_buf *dmabuf)
{ … }
static const struct dma_buf_ops cma_heap_buf_ops = …;
static struct dma_buf *cma_heap_allocate(struct dma_heap *heap,
unsigned long len,
u32 fd_flags,
u64 heap_flags)
{ … }
static const struct dma_heap_ops cma_heap_ops = …;
static int __add_cma_heap(struct cma *cma, void *data)
{ … }
static int add_default_cma_heap(void)
{ … }
module_init(…) …;
MODULE_DESCRIPTION(…) …;