• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_SPSS_HEAP_ID = 13,
37   ION_ADSP_HEAP_ID = 22,
38   ION_SYSTEM_HEAP_ID = 25,
39   ION_QSECOM_HEAP_ID = 27,
40   ION_HEAP_ID_RESERVED = 31
41 };
42 #define ION_SECURE_CARVEOUT_HEAP_ID 14
43 #define ION_QSECOM_TA_HEAP_ID 19
44 #define ION_AUDIO_HEAP_ID 28
45 #define ION_CAMERA_HEAP_ID 20
46 #define ION_USER_CONTIG_HEAP_ID 26
47 #define ION_FLAG_CP_TOUCH ION_BIT(17)
48 #define ION_FLAG_CP_BITSTREAM ION_BIT(18)
49 #define ION_FLAG_CP_PIXEL ION_BIT(19)
50 #define ION_FLAG_CP_NON_PIXEL ION_BIT(20)
51 #define ION_FLAG_CP_CAMERA ION_BIT(21)
52 #define ION_FLAG_CP_HLOS ION_BIT(22)
53 #define ION_FLAG_CP_SPSS_SP ION_BIT(23)
54 #define ION_FLAG_CP_SPSS_SP_SHARED ION_BIT(24)
55 #define ION_FLAG_CP_SEC_DISPLAY ION_BIT(25)
56 #define ION_FLAG_CP_APP ION_BIT(26)
57 #define ION_FLAG_CP_CAMERA_PREVIEW ION_BIT(27)
58 #define ION_FLAG_CP_CDSP ION_BIT(29)
59 #define ION_FLAG_CP_SPSS_HLOS_SHARED ION_BIT(30)
60 #define ION_FLAGS_CP_MASK 0x6FFE0000
61 #define ION_FLAG_ALLOW_NON_CONTIG ION_BIT(28)
62 #define ION_FLAG_SECURE ION_BIT(ION_HEAP_ID_RESERVED)
63 #define ION_FLAG_POOL_FORCE_ALLOC ION_BIT(16)
64 #define ION_HEAP(bit) ION_BIT(bit)
65 #define ION_IOC_MSM_MAGIC 'M'
66 struct ion_prefetch_regions {
67   __u64 sizes;
68   __u32 vmid;
69   __u32 nr_sizes;
70 };
71 struct ion_prefetch_data {
72   __u64 len;
73   __u64 regions;
74   __u32 heap_id;
75   __u32 nr_regions;
76 };
77 #define ION_IOC_PREFETCH _IOWR(ION_IOC_MSM_MAGIC, 3, struct ion_prefetch_data)
78 #define ION_IOC_DRAIN _IOWR(ION_IOC_MSM_MAGIC, 4, struct ion_prefetch_data)
79 #endif
80