1 /* 2 * Copyright (C) 2014 Amlogic Corporation. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 /**************************************************************************** 18 **************************************************************************** 19 *** 20 *** This header was automatically generated from a Linux kernel header 21 *** of the same name, to make information necessary for userspace to 22 *** call into the kernel available to libc. It contains only constants, 23 *** structures, and macros generated from the original header, and thus, 24 *** contains no copyrightable information. 25 *** 26 *** To edit the content of this header, modify the corresponding 27 *** source file (e.g. under external/kernel-headers/original/) then 28 *** run bionic/libc/kernel/tools/update_all.py 29 *** 30 *** Any manual change here will be lost the next time this script will 31 *** be run. You've been warned! 32 *** 33 **************************************************************************** 34 ****************************************************************************/ 35 #ifndef _LINUX_ION_H 36 #define _LINUX_ION_H 37 #include <linux/types.h> 38 struct ion_handle; 39 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 40 enum ion_heap_type { 41 ION_HEAP_TYPE_SYSTEM, 42 ION_HEAP_TYPE_SYSTEM_CONTIG, 43 ION_HEAP_TYPE_CARVEOUT, 44 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 45 ION_HEAP_TYPE_CUSTOM, 46 ION_NUM_HEAPS = 16, 47 }; 48 #define ION_HEAP_SYSTEM_MASK (1 << ION_HEAP_TYPE_SYSTEM) 49 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 50 #define ION_HEAP_SYSTEM_CONTIG_MASK (1 << ION_HEAP_TYPE_SYSTEM_CONTIG) 51 #define ION_HEAP_CARVEOUT_MASK (1 << ION_HEAP_TYPE_CARVEOUT) 52 #define ION_FLAG_CACHED 1 53 #define ION_FLAG_CACHED_NEEDS_SYNC 2 54 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 55 struct ion_allocation_data { 56 size_t len; 57 size_t align; 58 unsigned int heap_mask; 59 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 60 unsigned int flags; 61 struct ion_handle *handle; 62 }; 63 struct ion_fd_data { 64 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 65 struct ion_handle *handle; 66 int fd; 67 }; 68 struct ion_handle_data { 69 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 70 struct ion_handle *handle; 71 }; 72 struct ion_custom_data { 73 unsigned int cmd; 74 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 75 unsigned long arg; 76 }; 77 #define ION_IOC_MAGIC 'I' 78 #define ION_IOC_ALLOC _IOWR(ION_IOC_MAGIC, 0, struct ion_allocation_data) 79 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 80 #define ION_IOC_FREE _IOWR(ION_IOC_MAGIC, 1, struct ion_handle_data) 81 #define ION_IOC_MAP _IOWR(ION_IOC_MAGIC, 2, struct ion_fd_data) 82 #define ION_IOC_SHARE _IOWR(ION_IOC_MAGIC, 4, struct ion_fd_data) 83 #define ION_IOC_IMPORT _IOWR(ION_IOC_MAGIC, 5, struct ion_fd_data) 84 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */ 85 #define ION_IOC_SYNC _IOWR(ION_IOC_MAGIC, 7, struct ion_fd_data) 86 #define ION_IOC_CUSTOM _IOWR(ION_IOC_MAGIC, 6, struct ion_custom_data) 87 #endif 88