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  ****************************************************************************/
19 #ifndef _LINUX_MSM_ION_H
20 #define _LINUX_MSM_ION_H
21 #include <linux/types.h>
22 #define ION_BIT(nr) (1U << (nr))
23 #define TARGET_ION_ABI_VERSION 2
24 enum msm_ion_heap_types {
25   ION_HEAP_TYPE_MSM_START = 6,
26   ION_HEAP_TYPE_SECURE_DMA = ION_HEAP_TYPE_MSM_START,
27   ION_HEAP_TYPE_SYSTEM_SECURE,
28   ION_HEAP_TYPE_HYP_CMA,
29   ION_HEAP_TYPE_SECURE_CARVEOUT,
30 };
31 enum ion_heap_ids {
32   INVALID_HEAP_ID = - 1,
33   ION_CP_MM_HEAP_ID = 8,
34   ION_SECURE_HEAP_ID = 9,
35   ION_SECURE_DISPLAY_HEAP_ID = 10,
36   ION_VIDEO_HEAP_ID = 12,
37   ION_SPSS_HEAP_ID = 13,
38   ION_ADSP_HEAP_ID = 22,
39   ION_SYSTEM_HEAP_ID = 25,
40   ION_QSECOM_HEAP_ID = 27,
41   ION_HEAP_ID_RESERVED = 31
42 };
43 #define ION_SECURE_CARVEOUT_HEAP_ID 14
44 #define ION_QSECOM_TA_HEAP_ID 19
45 #define ION_AUDIO_HEAP_ID 28
46 #define ION_CAMERA_HEAP_ID 20
47 #define ION_USER_CONTIG_HEAP_ID 26
48 #define ION_FLAG_CP_CAMERA_ENCODE ION_BIT(14)
49 #define ION_FLAG_CP_DSP_EXT ION_BIT(15)
50 #define ION_FLAG_CP_TOUCH ION_BIT(17)
51 #define ION_FLAG_CP_BITSTREAM ION_BIT(18)
52 #define ION_FLAG_CP_PIXEL ION_BIT(19)
53 #define ION_FLAG_CP_NON_PIXEL ION_BIT(20)
54 #define ION_FLAG_CP_CAMERA ION_BIT(21)
55 #define ION_FLAG_CP_HLOS ION_BIT(22)
56 #define ION_FLAG_CP_SPSS_SP ION_BIT(23)
57 #define ION_FLAG_CP_SPSS_SP_SHARED ION_BIT(24)
58 #define ION_FLAG_CP_SEC_DISPLAY ION_BIT(25)
59 #define ION_FLAG_CP_APP ION_BIT(26)
60 #define ION_FLAG_CP_CAMERA_PREVIEW ION_BIT(27)
61 #define ION_FLAG_CP_CDSP ION_BIT(29)
62 #define ION_FLAG_CP_SPSS_HLOS_SHARED ION_BIT(30)
63 #define ION_FLAGS_CP_MASK 0x6FFEC000
64 #define ION_FLAG_ALLOW_NON_CONTIG ION_BIT(28)
65 #define ION_FLAG_SECURE ION_BIT(ION_HEAP_ID_RESERVED)
66 #define ION_FLAG_POOL_FORCE_ALLOC ION_BIT(16)
67 #define ION_HEAP(bit) ION_BIT(bit)
68 #define ION_IOC_MSM_MAGIC 'M'
69 struct ion_prefetch_regions {
70   __u64 sizes;
71   __u32 vmid;
72   __u32 nr_sizes;
73 };
74 struct ion_prefetch_data {
75   __u64 len;
76   __u64 regions;
77   __u32 heap_id;
78   __u32 nr_regions;
79 };
80 #define ION_IOC_PREFETCH _IOWR(ION_IOC_MSM_MAGIC, 3, struct ion_prefetch_data)
81 #define ION_IOC_DRAIN _IOWR(ION_IOC_MSM_MAGIC, 4, struct ion_prefetch_data)
82 #endif
83