1 /*
2  * This file is auto-generated. Modifications will be lost.
3  *
4  * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5  * for more information.
6  */
7 #ifndef _LINUX_ION_H
8 #define _LINUX_ION_H
9 #include <linux/ioctl.h>
10 #include <linux/types.h>
11 enum ion_heap_type {
12   ION_HEAP_TYPE_SYSTEM,
13   ION_HEAP_TYPE_SYSTEM_CONTIG,
14   ION_HEAP_TYPE_CARVEOUT,
15   ION_HEAP_TYPE_CHUNK,
16   ION_HEAP_TYPE_DMA,
17   ION_HEAP_TYPE_CUSTOM,
18 };
19 #define ION_NUM_HEAP_IDS (sizeof(unsigned int) * 8)
20 #define ION_FLAG_CACHED 1
21 struct ion_allocation_data {
22   __u64 len;
23   __u32 heap_id_mask;
24   __u32 flags;
25   __u32 fd;
26   __u32 unused;
27 };
28 #define MAX_HEAP_NAME 32
29 struct ion_heap_data {
30   char name[MAX_HEAP_NAME];
31   __u32 type;
32   __u32 heap_id;
33   __u32 reserved0;
34   __u32 reserved1;
35   __u32 reserved2;
36 };
37 struct ion_heap_query {
38   __u32 cnt;
39   __u32 reserved0;
40   __u64 heaps;
41   __u32 reserved1;
42   __u32 reserved2;
43 };
44 #define ION_IOC_MAGIC 'I'
45 #define ION_IOC_ALLOC _IOWR(ION_IOC_MAGIC, 0, struct ion_allocation_data)
46 #define ION_IOC_HEAP_QUERY _IOWR(ION_IOC_MAGIC, 8, struct ion_heap_query)
47 #endif
48