logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

dma-heap.h (1397B)


  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * DMABUF Heaps Userspace API
  4. *
  5. * Copyright (C) 2011 Google, Inc.
  6. * Copyright (C) 2019 Linaro Ltd.
  7. */
  8. #ifndef _LINUX_DMABUF_POOL_H
  9. #define _LINUX_DMABUF_POOL_H
  10. #include <linux/ioctl.h>
  11. #include <linux/types.h>
  12. /**
  13. * DOC: DMABUF Heaps Userspace API
  14. */
  15. /* Valid FD_FLAGS are O_CLOEXEC, O_RDONLY, O_WRONLY, O_RDWR */
  16. #define DMA_HEAP_VALID_FD_FLAGS (O_CLOEXEC | O_ACCMODE)
  17. /* Currently no heap flags */
  18. #define DMA_HEAP_VALID_HEAP_FLAGS (0ULL)
  19. /**
  20. * struct dma_heap_allocation_data - metadata passed from userspace for
  21. * allocations
  22. * @len: size of the allocation
  23. * @fd: will be populated with a fd which provides the
  24. * handle to the allocated dma-buf
  25. * @fd_flags: file descriptor flags used when allocating
  26. * @heap_flags: flags passed to heap
  27. *
  28. * Provided by userspace as an argument to the ioctl
  29. */
  30. struct dma_heap_allocation_data {
  31. __u64 len;
  32. __u32 fd;
  33. __u32 fd_flags;
  34. __u64 heap_flags;
  35. };
  36. #define DMA_HEAP_IOC_MAGIC 'H'
  37. /**
  38. * DOC: DMA_HEAP_IOCTL_ALLOC - allocate memory from pool
  39. *
  40. * Takes a dma_heap_allocation_data struct and returns it with the fd field
  41. * populated with the dmabuf handle of the allocation.
  42. */
  43. #define DMA_HEAP_IOCTL_ALLOC _IOWR(DMA_HEAP_IOC_MAGIC, 0x0,\
  44. struct dma_heap_allocation_data)
  45. #endif /* _LINUX_DMABUF_POOL_H */