diff options
Diffstat (limited to 'drivers/misc/bmm_dmabuf.h')
-rw-r--r-- | drivers/misc/bmm_dmabuf.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/drivers/misc/bmm_dmabuf.h b/drivers/misc/bmm_dmabuf.h new file mode 100644 index 000000000000..632982b0c9ba --- /dev/null +++ b/drivers/misc/bmm_dmabuf.h @@ -0,0 +1,52 @@ +/* + * bmm_dmabuf.h + * + * CMA backed dma_buf management + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Portions (C) Copyright 2007 Marvell International Ltd. + * All Rights Reserved + */ + +#ifndef _BMM_DMABUF_H +#define _BMM_DMABUF_H + +#include <linux/dma-mapping.h> +#include <linux/ioctl.h> +#include <linux/types.h> + +/* ioctl commands */ +struct bmm_fd_alloc { + __u64 size; + __u64 align; + __u32 attr; + __s32 fd; +}; + +struct bmm_fd_flush { + __u64 size; + __u64 offset; + __u64 ptr; + __s32 fd; + __u32 direction; +}; + +#define BMEM_IOCTL_MAGIC 'G' +#define BMM_FD_ALLOC _IOWR(BMEM_IOCTL_MAGIC, 64, struct bmm_fd_alloc) +#define BMM_FD_FLUSH _IOW(BMEM_IOCTL_MAGIC, 65, struct bmm_fd_flush) + +/* ioctl arguments: memory attributes */ +#define BMM_ATTR_DEFAULT (0) /* cacheable bufferable */ +#define BMM_ATTR_WRITECOMBINE (1 << 0) /* non-cacheable & bufferable */ +#define BMM_ATTR_NONCACHED (1 << 1) /* non-cacheable & non-bufferable */ + +/* ioctl arguments: cache flush direction */ +#define BMM_DMA_BIDIRECTIONAL 0 +#define BMM_DMA_TO_DEVICE 1 +#define BMM_DMA_FROM_DEVICE 2 +#define BMM_DMA_NONE 3 + +#endif |