Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 1 | /**************************************************************************** |
| 2 | **************************************************************************** |
| 3 | *** |
| 4 | *** This header was automatically generated from a Linux kernel header |
| 5 | *** of the same name, to make information necessary for userspace to |
| 6 | *** call into the kernel available to libc. It contains only constants, |
| 7 | *** structures, and macros generated from the original header, and thus, |
| 8 | *** contains no copyrightable information. |
| 9 | *** |
| 10 | *** To edit the content of this header, modify the corresponding |
| 11 | *** source file (e.g. under external/kernel-headers/original/) then |
| 12 | *** run bionic/libc/kernel/tools/update_all.py |
| 13 | *** |
| 14 | *** Any manual change here will be lost the next time this script will |
| 15 | *** be run. You've been warned! |
| 16 | *** |
| 17 | **************************************************************************** |
| 18 | ****************************************************************************/ |
Elliott Hughes | 356a4e4 | 2013-11-25 14:08:33 -0800 | [diff] [blame] | 19 | #ifndef _UAPI_LINUX_ION_H |
| 20 | #define _UAPI_LINUX_ION_H |
| 21 | #include <linux/ioctl.h> |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 22 | #include <linux/types.h> |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 23 | enum ion_heap_type { |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 24 | ION_HEAP_TYPE_SYSTEM, |
| 25 | ION_HEAP_TYPE_SYSTEM_CONTIG, |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 26 | ION_HEAP_TYPE_CARVEOUT, |
| 27 | ION_HEAP_TYPE_CHUNK, |
| 28 | ION_HEAP_TYPE_DMA, |
| 29 | ION_HEAP_TYPE_CUSTOM, |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 30 | }; |
Christopher Ferris | 82d7504 | 2015-01-26 10:57:07 -0800 | [diff] [blame] | 31 | #define ION_NUM_HEAP_IDS (sizeof(unsigned int) * 8) |
Elliott Hughes | 356a4e4 | 2013-11-25 14:08:33 -0800 | [diff] [blame] | 32 | #define ION_FLAG_CACHED 1 |
Elliott Hughes | 356a4e4 | 2013-11-25 14:08:33 -0800 | [diff] [blame] | 33 | #define ION_FLAG_CACHED_NEEDS_SYNC 2 |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 34 | struct ion_allocation_data { |
Christopher Ferris | 89d6c32 | 2017-08-01 19:32:14 +0000 | [diff] [blame^] | 35 | __u64 len; |
| 36 | __u32 heap_id_mask; |
| 37 | __u32 flags; |
| 38 | __u32 fd; |
| 39 | __u32 unused; |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 40 | }; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 41 | #define MAX_HEAP_NAME 32 |
| 42 | struct ion_heap_data { |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 43 | char name[MAX_HEAP_NAME]; |
| 44 | __u32 type; |
| 45 | __u32 heap_id; |
| 46 | __u32 reserved0; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 47 | __u32 reserved1; |
| 48 | __u32 reserved2; |
| 49 | }; |
| 50 | struct ion_heap_query { |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 51 | __u32 cnt; |
| 52 | __u32 reserved0; |
| 53 | __u64 heaps; |
| 54 | __u32 reserved1; |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 55 | __u32 reserved2; |
| 56 | }; |
| 57 | #define ION_IOC_MAGIC 'I' |
Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 58 | #define ION_IOC_ALLOC _IOWR(ION_IOC_MAGIC, 0, struct ion_allocation_data) |
Christopher Ferris | 6a9755d | 2017-01-13 14:09:31 -0800 | [diff] [blame] | 59 | #define ION_IOC_HEAP_QUERY _IOWR(ION_IOC_MAGIC, 8, struct ion_heap_query) |
Elliott Hughes | 8cb52b0 | 2013-11-21 13:43:23 -0800 | [diff] [blame] | 60 | #endif |