blob: 7b5b031f57fa0ea595aa902ad7fa95540081322c [file] [log] [blame]
Elliott Hughes8cb52b02013-11-21 13:43:23 -08001/****************************************************************************
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 ****************************************************************************/
Elliott Hughes356a4e42013-11-25 14:08:33 -080019#ifndef _UAPI_LINUX_ION_H
20#define _UAPI_LINUX_ION_H
21#include <linux/ioctl.h>
Elliott Hughes8cb52b02013-11-21 13:43:23 -080022#include <linux/types.h>
Elliott Hughes356a4e42013-11-25 14:08:33 -080023typedef int ion_user_handle_t;
Elliott Hughes8cb52b02013-11-21 13:43:23 -080024enum ion_heap_type {
Tao Baod7db5942015-01-28 10:07:51 -080025 ION_HEAP_TYPE_SYSTEM,
26 ION_HEAP_TYPE_SYSTEM_CONTIG,
Tao Baod7db5942015-01-28 10:07:51 -080027 ION_HEAP_TYPE_CARVEOUT,
28 ION_HEAP_TYPE_CHUNK,
29 ION_HEAP_TYPE_DMA,
30 ION_HEAP_TYPE_CUSTOM,
Elliott Hughes8cb52b02013-11-21 13:43:23 -080031};
Christopher Ferris82d75042015-01-26 10:57:07 -080032#define ION_NUM_HEAP_IDS (sizeof(unsigned int) * 8)
Elliott Hughes356a4e42013-11-25 14:08:33 -080033#define ION_FLAG_CACHED 1
Elliott Hughes356a4e42013-11-25 14:08:33 -080034#define ION_FLAG_CACHED_NEEDS_SYNC 2
Elliott Hughes8cb52b02013-11-21 13:43:23 -080035struct ion_allocation_data {
Tao Baod7db5942015-01-28 10:07:51 -080036 size_t len;
37 size_t align;
Tao Baod7db5942015-01-28 10:07:51 -080038 unsigned int heap_id_mask;
39 unsigned int flags;
40 ion_user_handle_t handle;
Elliott Hughes8cb52b02013-11-21 13:43:23 -080041};
Elliott Hughes356a4e42013-11-25 14:08:33 -080042struct ion_fd_data {
Tao Baod7db5942015-01-28 10:07:51 -080043 ion_user_handle_t handle;
44 int fd;
Elliott Hughes8cb52b02013-11-21 13:43:23 -080045};
Elliott Hughes356a4e42013-11-25 14:08:33 -080046struct ion_handle_data {
Tao Baod7db5942015-01-28 10:07:51 -080047 ion_user_handle_t handle;
Elliott Hughes8cb52b02013-11-21 13:43:23 -080048};
49struct ion_custom_data {
Tao Baod7db5942015-01-28 10:07:51 -080050 unsigned int cmd;
51 unsigned long arg;
Elliott Hughes8cb52b02013-11-21 13:43:23 -080052};
Christopher Ferris6a9755d2017-01-13 14:09:31 -080053#define MAX_HEAP_NAME 32
54struct ion_heap_data {
Christopher Ferris6a9755d2017-01-13 14:09:31 -080055 char name[MAX_HEAP_NAME];
56 __u32 type;
57 __u32 heap_id;
58 __u32 reserved0;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080059 __u32 reserved1;
60 __u32 reserved2;
61};
62struct ion_heap_query {
Christopher Ferris6a9755d2017-01-13 14:09:31 -080063 __u32 cnt;
64 __u32 reserved0;
65 __u64 heaps;
66 __u32 reserved1;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080067 __u32 reserved2;
68};
69#define ION_IOC_MAGIC 'I'
Tao Baod7db5942015-01-28 10:07:51 -080070#define ION_IOC_ALLOC _IOWR(ION_IOC_MAGIC, 0, struct ion_allocation_data)
Elliott Hughes8cb52b02013-11-21 13:43:23 -080071#define ION_IOC_FREE _IOWR(ION_IOC_MAGIC, 1, struct ion_handle_data)
72#define ION_IOC_MAP _IOWR(ION_IOC_MAGIC, 2, struct ion_fd_data)
73#define ION_IOC_SHARE _IOWR(ION_IOC_MAGIC, 4, struct ion_fd_data)
Elliott Hughes356a4e42013-11-25 14:08:33 -080074#define ION_IOC_IMPORT _IOWR(ION_IOC_MAGIC, 5, struct ion_fd_data)
Elliott Hughes8cb52b02013-11-21 13:43:23 -080075#define ION_IOC_SYNC _IOWR(ION_IOC_MAGIC, 7, struct ion_fd_data)
76#define ION_IOC_CUSTOM _IOWR(ION_IOC_MAGIC, 6, struct ion_custom_data)
Christopher Ferris6a9755d2017-01-13 14:09:31 -080077#define ION_IOC_HEAP_QUERY _IOWR(ION_IOC_MAGIC, 8, struct ion_heap_query)
Elliott Hughes8cb52b02013-11-21 13:43:23 -080078#endif