blob: 7c9e6d74ff53d5b870b814a8c074b8a8bd7b8d18 [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 Hughes8cb52b02013-11-21 13:43:23 -080023enum ion_heap_type {
Tao Baod7db5942015-01-28 10:07:51 -080024 ION_HEAP_TYPE_SYSTEM,
25 ION_HEAP_TYPE_SYSTEM_CONTIG,
Tao Baod7db5942015-01-28 10:07:51 -080026 ION_HEAP_TYPE_CARVEOUT,
27 ION_HEAP_TYPE_CHUNK,
28 ION_HEAP_TYPE_DMA,
29 ION_HEAP_TYPE_CUSTOM,
Elliott Hughes8cb52b02013-11-21 13:43:23 -080030};
Christopher Ferris82d75042015-01-26 10:57:07 -080031#define ION_NUM_HEAP_IDS (sizeof(unsigned int) * 8)
Elliott Hughes356a4e42013-11-25 14:08:33 -080032#define ION_FLAG_CACHED 1
Elliott Hughes8cb52b02013-11-21 13:43:23 -080033struct ion_allocation_data {
Christopher Ferris038ef232018-02-16 15:00:59 -080034 __u64 len;
35 __u32 heap_id_mask;
36 __u32 flags;
37 __u32 fd;
38 __u32 unused;
Elliott Hughes8cb52b02013-11-21 13:43:23 -080039};
Christopher Ferris6a9755d2017-01-13 14:09:31 -080040#define MAX_HEAP_NAME 32
41struct ion_heap_data {
Christopher Ferris6a9755d2017-01-13 14:09:31 -080042 char name[MAX_HEAP_NAME];
43 __u32 type;
44 __u32 heap_id;
45 __u32 reserved0;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080046 __u32 reserved1;
47 __u32 reserved2;
48};
49struct ion_heap_query {
Christopher Ferris6a9755d2017-01-13 14:09:31 -080050 __u32 cnt;
51 __u32 reserved0;
52 __u64 heaps;
53 __u32 reserved1;
Christopher Ferris6a9755d2017-01-13 14:09:31 -080054 __u32 reserved2;
55};
56#define ION_IOC_MAGIC 'I'
Tao Baod7db5942015-01-28 10:07:51 -080057#define ION_IOC_ALLOC _IOWR(ION_IOC_MAGIC, 0, struct ion_allocation_data)
Christopher Ferris6a9755d2017-01-13 14:09:31 -080058#define ION_IOC_HEAP_QUERY _IOWR(ION_IOC_MAGIC, 8, struct ion_heap_query)
Elliott Hughes8cb52b02013-11-21 13:43:23 -080059#endif