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 _MSM_ION_H 20 #define _MSM_ION_H 21 #include "ion.h" 22 #define ION_BIT(nr) (1UL << (nr)) 23 enum msm_ion_heap_types { 24 ION_HEAP_TYPE_MSM_START = ION_HEAP_TYPE_CUSTOM + 1, 25 ION_HEAP_TYPE_SECURE_DMA = ION_HEAP_TYPE_MSM_START, 26 ION_HEAP_TYPE_SYSTEM_SECURE, 27 ION_HEAP_TYPE_HYP_CMA, 28 ION_HEAP_TYPE_SECURE_CARVEOUT, 29 }; 30 enum ion_heap_ids { 31 INVALID_HEAP_ID = - 1, 32 ION_CP_MM_HEAP_ID = 8, 33 ION_SECURE_HEAP_ID = 9, 34 ION_SECURE_DISPLAY_HEAP_ID = 10, 35 ION_CP_MFC_HEAP_ID = 12, 36 ION_SPSS_HEAP_ID = 13, 37 ION_SECURE_CARVEOUT_HEAP_ID = 14, 38 ION_CP_WB_HEAP_ID = 16, 39 ION_QSECOM_TA_HEAP_ID = 19, 40 ION_CAMERA_HEAP_ID = 20, 41 ION_SYSTEM_CONTIG_HEAP_ID = 21, 42 ION_ADSP_HEAP_ID = 22, 43 ION_PIL1_HEAP_ID = 23, 44 ION_SF_HEAP_ID = 24, 45 ION_SYSTEM_HEAP_ID = 25, 46 ION_PIL2_HEAP_ID = 26, 47 ION_QSECOM_HEAP_ID = 27, 48 ION_AUDIO_HEAP_ID = 28, 49 ION_MM_FIRMWARE_HEAP_ID = 29, 50 ION_GOOGLE_HEAP_ID = 30, 51 ION_HEAP_ID_RESERVED = 31 52 }; 53 #define ION_IOMMU_HEAP_ID ION_SYSTEM_HEAP_ID 54 #define ION_HEAP_TYPE_IOMMU ION_HEAP_TYPE_SYSTEM 55 #define ION_SPSS_HEAP_ID ION_SPSS_HEAP_ID 56 enum ion_fixed_position { 57 NOT_FIXED, 58 FIXED_LOW, 59 FIXED_MIDDLE, 60 FIXED_HIGH, 61 }; 62 enum cp_mem_usage { 63 VIDEO_BITSTREAM = 0x1, 64 VIDEO_PIXEL = 0x2, 65 VIDEO_NONPIXEL = 0x3, 66 DISPLAY_SECURE_CP_USAGE = 0x4, 67 CAMERA_SECURE_CP_USAGE = 0x5, 68 MAX_USAGE = 0x6, 69 UNKNOWN = 0x7FFFFFFF, 70 }; 71 #define ION_FLAG_CP_TOUCH ION_BIT(17) 72 #define ION_FLAG_CP_BITSTREAM ION_BIT(18) 73 #define ION_FLAG_CP_PIXEL ION_BIT(19) 74 #define ION_FLAG_CP_NON_PIXEL ION_BIT(20) 75 #define ION_FLAG_CP_CAMERA ION_BIT(21) 76 #define ION_FLAG_CP_HLOS ION_BIT(22) 77 #define ION_FLAG_CP_SPSS_SP ION_BIT(23) 78 #define ION_FLAG_CP_SPSS_SP_SHARED ION_BIT(24) 79 #define ION_FLAG_CP_SEC_DISPLAY ION_BIT(25) 80 #define ION_FLAG_CP_APP ION_BIT(26) 81 #define ION_FLAG_CP_CAMERA_PREVIEW ION_BIT(27) 82 #define ION_FLAG_CP_CDSP ION_BIT(29) 83 #define ION_FLAG_CP_SPSS_HLOS_SHARED ION_BIT(30) 84 #define ION_FLAG_ALLOW_NON_CONTIG ION_BIT(28) 85 #define ION_FLAG_SECURE ION_BIT(ION_HEAP_ID_RESERVED) 86 #define ION_FLAG_POOL_FORCE_ALLOC ION_BIT(16) 87 #define ION_SECURE ION_FLAG_SECURE 88 #define ION_HEAP(bit) ION_BIT(bit) 89 #define ION_ADSP_HEAP_NAME "adsp" 90 #define ION_SYSTEM_HEAP_NAME "system" 91 #define ION_VMALLOC_HEAP_NAME ION_SYSTEM_HEAP_NAME 92 #define ION_KMALLOC_HEAP_NAME "kmalloc" 93 #define ION_AUDIO_HEAP_NAME "audio" 94 #define ION_SF_HEAP_NAME "sf" 95 #define ION_MM_HEAP_NAME "mm" 96 #define ION_CAMERA_HEAP_NAME "camera_preview" 97 #define ION_IOMMU_HEAP_NAME "iommu" 98 #define ION_MFC_HEAP_NAME "mfc" 99 #define ION_SPSS_HEAP_NAME "spss" 100 #define ION_SECURE_CARVEOUT_HEAP_NAME "secure_carveout" 101 #define ION_WB_HEAP_NAME "wb" 102 #define ION_MM_FIRMWARE_HEAP_NAME "mm_fw" 103 #define ION_GOOGLE_HEAP_NAME "easel_mem" 104 #define ION_PIL1_HEAP_NAME "pil_1" 105 #define ION_PIL2_HEAP_NAME "pil_2" 106 #define ION_QSECOM_HEAP_NAME "qsecom" 107 #define ION_QSECOM_TA_HEAP_NAME "qsecom_ta" 108 #define ION_SECURE_HEAP_NAME "secure_heap" 109 #define ION_SECURE_DISPLAY_HEAP_NAME "secure_display" 110 #define ION_SET_CACHED(__cache) ((__cache) | ION_FLAG_CACHED) 111 #define ION_SET_UNCACHED(__cache) ((__cache) & ~ION_FLAG_CACHED) 112 #define ION_IS_CACHED(__flags) ((__flags) & ION_FLAG_CACHED) 113 struct ion_flush_data { 114 ion_user_handle_t handle; 115 int fd; 116 void * vaddr; 117 unsigned int offset; 118 unsigned int length; 119 }; 120 struct ion_prefetch_regions { 121 unsigned int vmid; 122 size_t * sizes; 123 unsigned int nr_sizes; 124 }; 125 struct ion_prefetch_data { 126 int heap_id; 127 unsigned long len; 128 struct ion_prefetch_regions * regions; 129 unsigned int nr_regions; 130 }; 131 #define ION_IOC_MSM_MAGIC 'M' 132 #define ION_IOC_CLEAN_CACHES _IOWR(ION_IOC_MSM_MAGIC, 0, struct ion_flush_data) 133 #define ION_IOC_INV_CACHES _IOWR(ION_IOC_MSM_MAGIC, 1, struct ion_flush_data) 134 #define ION_IOC_CLEAN_INV_CACHES _IOWR(ION_IOC_MSM_MAGIC, 2, struct ion_flush_data) 135 #define ION_IOC_PREFETCH _IOWR(ION_IOC_MSM_MAGIC, 3, struct ion_prefetch_data) 136 #define ION_IOC_DRAIN _IOWR(ION_IOC_MSM_MAGIC, 4, struct ion_prefetch_data) 137 #endif 138 139