18cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes/****************************************************************************
28cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes ****************************************************************************
38cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes ***
48cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes ***   This header was automatically generated from a Linux kernel header
58cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes ***   of the same name, to make information necessary for userspace to
68cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes ***   call into the kernel available to libc.  It contains only constants,
78cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes ***   structures, and macros generated from the original header, and thus,
88cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes ***   contains no copyrightable information.
98cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes ***
108cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes ***   To edit the content of this header, modify the corresponding
118cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes ***   source file (e.g. under external/kernel-headers/original/) then
128cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes ***   run bionic/libc/kernel/tools/update_all.py
138cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes ***
148cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes ***   Any manual change here will be lost the next time this script will
158cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes ***   be run. You've been warned!
168cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes ***
178cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes ****************************************************************************
188cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes ****************************************************************************/
19356a4e4a3243ddb40c41a9bbaf7e86f821aaa912Elliott Hughes#ifndef _UAPI_LINUX_ION_H
20356a4e4a3243ddb40c41a9bbaf7e86f821aaa912Elliott Hughes#define _UAPI_LINUX_ION_H
21356a4e4a3243ddb40c41a9bbaf7e86f821aaa912Elliott Hughes#include <linux/ioctl.h>
228cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes#include <linux/types.h>
238cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24356a4e4a3243ddb40c41a9bbaf7e86f821aaa912Elliott Hughestypedef int ion_user_handle_t;
258cb52b056cfc302e05304d847c4228dff15715cfElliott Hughesenum ion_heap_type {
26d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  ION_HEAP_TYPE_SYSTEM,
27d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  ION_HEAP_TYPE_SYSTEM_CONTIG,
288cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  ION_HEAP_TYPE_CARVEOUT,
30d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  ION_HEAP_TYPE_CHUNK,
31d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  ION_HEAP_TYPE_DMA,
32d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  ION_HEAP_TYPE_CUSTOM,
33356a4e4a3243ddb40c41a9bbaf7e86f821aaa912Elliott Hughes/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
348cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes};
3582d7504cd7d5c8d2175fb3b1a4ee3518cad6aa0fChristopher Ferris#define ION_NUM_HEAP_IDS (sizeof(unsigned int) * 8)
368cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes#define ION_FLAG_CACHED 1
37356a4e4a3243ddb40c41a9bbaf7e86f821aaa912Elliott Hughes#define ION_FLAG_CACHED_NEEDS_SYNC 2
386a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
398cb52b056cfc302e05304d847c4228dff15715cfElliott Hughesstruct ion_allocation_data {
40d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  size_t len;
41d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  size_t align;
42d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  unsigned int heap_id_mask;
436a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  unsigned int flags;
45d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  ion_user_handle_t handle;
468cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes};
47356a4e4a3243ddb40c41a9bbaf7e86f821aaa912Elliott Hughesstruct ion_fd_data {
486a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  ion_user_handle_t handle;
50d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  int fd;
518cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes};
52356a4e4a3243ddb40c41a9bbaf7e86f821aaa912Elliott Hughesstruct ion_handle_data {
536a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  ion_user_handle_t handle;
558cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes};
568cb52b056cfc302e05304d847c4228dff15715cfElliott Hughesstruct ion_custom_data {
57d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  unsigned int cmd;
586a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao  unsigned long arg;
608cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes};
616a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris#define MAX_HEAP_NAME 32
626a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferrisstruct ion_heap_data {
636a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
646a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris  char name[MAX_HEAP_NAME];
656a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris  __u32 type;
666a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris  __u32 heap_id;
676a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris  __u32 reserved0;
686a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
696a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris  __u32 reserved1;
706a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris  __u32 reserved2;
716a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris};
726a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferrisstruct ion_heap_query {
736a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
746a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris  __u32 cnt;
756a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris  __u32 reserved0;
766a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris  __u64 heaps;
776a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris  __u32 reserved1;
78c43d16a4581038422425b9b36bf95612d0383941Elliott Hughes/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
796a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris  __u32 reserved2;
806a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris};
816a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris#define ION_IOC_MAGIC 'I'
82d7db594b8d1dab36b711bd887a9dd21675c87243Tao Bao#define ION_IOC_ALLOC _IOWR(ION_IOC_MAGIC, 0, struct ion_allocation_data)
836a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
848cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes#define ION_IOC_FREE _IOWR(ION_IOC_MAGIC, 1, struct ion_handle_data)
858cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes#define ION_IOC_MAP _IOWR(ION_IOC_MAGIC, 2, struct ion_fd_data)
868cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes#define ION_IOC_SHARE _IOWR(ION_IOC_MAGIC, 4, struct ion_fd_data)
87356a4e4a3243ddb40c41a9bbaf7e86f821aaa912Elliott Hughes#define ION_IOC_IMPORT _IOWR(ION_IOC_MAGIC, 5, struct ion_fd_data)
886a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
898cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes#define ION_IOC_SYNC _IOWR(ION_IOC_MAGIC, 7, struct ion_fd_data)
908cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes#define ION_IOC_CUSTOM _IOWR(ION_IOC_MAGIC, 6, struct ion_custom_data)
916a9755d20a995756487bb1aafb7e954f4fd868a7Christopher Ferris#define ION_IOC_HEAP_QUERY _IOWR(ION_IOC_MAGIC, 8, struct ion_heap_query)
928cb52b056cfc302e05304d847c4228dff15715cfElliott Hughes#endif
93356a4e4a3243ddb40c41a9bbaf7e86f821aaa912Elliott Hughes/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94