blob: af3cea9f0777621de9f864698b21416931c32007 [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 ****************************************************************************/
19#ifndef _UAPI_LINUX_BINDER_H
20#define _UAPI_LINUX_BINDER_H
21#include <linux/ioctl.h>
Tao Baod7db5942015-01-28 10:07:51 -080022#define B_PACK_CHARS(c1,c2,c3,c4) ((((c1) << 24)) | (((c2) << 16)) | (((c3) << 8)) | (c4))
Elliott Hughes8cb52b02013-11-21 13:43:23 -080023/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24#define B_TYPE_LARGE 0x85
25enum {
Tao Baod7db5942015-01-28 10:07:51 -080026 BINDER_TYPE_BINDER = B_PACK_CHARS('s', 'b', '*', B_TYPE_LARGE),
27 BINDER_TYPE_WEAK_BINDER = B_PACK_CHARS('w', 'b', '*', B_TYPE_LARGE),
Elliott Hughes8cb52b02013-11-21 13:43:23 -080028/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080029 BINDER_TYPE_HANDLE = B_PACK_CHARS('s', 'h', '*', B_TYPE_LARGE),
30 BINDER_TYPE_WEAK_HANDLE = B_PACK_CHARS('w', 'h', '*', B_TYPE_LARGE),
31 BINDER_TYPE_FD = B_PACK_CHARS('f', 'd', '*', B_TYPE_LARGE),
Elliott Hughes8cb52b02013-11-21 13:43:23 -080032};
33/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34enum {
Tao Baod7db5942015-01-28 10:07:51 -080035 FLAT_BINDER_FLAG_PRIORITY_MASK = 0xff,
36 FLAT_BINDER_FLAG_ACCEPTS_FDS = 0x100,
Elliott Hughes8cb52b02013-11-21 13:43:23 -080037};
38/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Arve Hjønnevågfbaa2542014-01-28 19:27:17 -080039#ifdef BINDER_IPC_32BIT
40typedef __u32 binder_size_t;
41typedef __u32 binder_uintptr_t;
42#else
43/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44typedef __u64 binder_size_t;
45typedef __u64 binder_uintptr_t;
46#endif
Elliott Hughes8cb52b02013-11-21 13:43:23 -080047struct flat_binder_object {
Arve Hjønnevågfbaa2542014-01-28 19:27:17 -080048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080049 __u32 type;
50 __u32 flags;
51 union {
52 binder_uintptr_t binder;
Elliott Hughes8cb52b02013-11-21 13:43:23 -080053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080054 __u32 handle;
55 };
56 binder_uintptr_t cookie;
Elliott Hughes8cb52b02013-11-21 13:43:23 -080057};
Arve Hjønnevågfbaa2542014-01-28 19:27:17 -080058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Elliott Hughes8cb52b02013-11-21 13:43:23 -080059struct binder_write_read {
Tao Baod7db5942015-01-28 10:07:51 -080060 binder_size_t write_size;
61 binder_size_t write_consumed;
62 binder_uintptr_t write_buffer;
Elliott Hughes8cb52b02013-11-21 13:43:23 -080063/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080064 binder_size_t read_size;
65 binder_size_t read_consumed;
66 binder_uintptr_t read_buffer;
Elliott Hughes8cb52b02013-11-21 13:43:23 -080067};
Arve Hjønnevågfbaa2542014-01-28 19:27:17 -080068/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Elliott Hughes8cb52b02013-11-21 13:43:23 -080069struct binder_version {
Tao Baod7db5942015-01-28 10:07:51 -080070 __s32 protocol_version;
Elliott Hughes8cb52b02013-11-21 13:43:23 -080071};
Arve Hjønnevågfbaa2542014-01-28 19:27:17 -080072#ifdef BINDER_IPC_32BIT
Elliott Hughes8cb52b02013-11-21 13:43:23 -080073/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74#define BINDER_CURRENT_PROTOCOL_VERSION 7
Arve Hjønnevågfbaa2542014-01-28 19:27:17 -080075#else
76#define BINDER_CURRENT_PROTOCOL_VERSION 8
77#endif
78/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Elliott Hughes8cb52b02013-11-21 13:43:23 -080079#define BINDER_WRITE_READ _IOWR('b', 1, struct binder_write_read)
80#define BINDER_SET_IDLE_TIMEOUT _IOW('b', 3, __s64)
Arve Hjønnevågfbaa2542014-01-28 19:27:17 -080081#define BINDER_SET_MAX_THREADS _IOW('b', 5, __u32)
Elliott Hughes8cb52b02013-11-21 13:43:23 -080082#define BINDER_SET_IDLE_PRIORITY _IOW('b', 6, __s32)
Arve Hjønnevågfbaa2542014-01-28 19:27:17 -080083/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Elliott Hughes8cb52b02013-11-21 13:43:23 -080084#define BINDER_SET_CONTEXT_MGR _IOW('b', 7, __s32)
85#define BINDER_THREAD_EXIT _IOW('b', 8, __s32)
86#define BINDER_VERSION _IOWR('b', 9, struct binder_version)
Elliott Hughes8cb52b02013-11-21 13:43:23 -080087enum transaction_flags {
Arve Hjønnevågfbaa2542014-01-28 19:27:17 -080088/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080089 TF_ONE_WAY = 0x01,
90 TF_ROOT_OBJECT = 0x04,
91 TF_STATUS_CODE = 0x08,
92 TF_ACCEPT_FDS = 0x10,
Arve Hjønnevågfbaa2542014-01-28 19:27:17 -080093/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Elliott Hughes8cb52b02013-11-21 13:43:23 -080094};
95struct binder_transaction_data {
Tao Baod7db5942015-01-28 10:07:51 -080096 union {
97 __u32 handle;
Elliott Hughes8cb52b02013-11-21 13:43:23 -080098/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080099 binder_uintptr_t ptr;
100 } target;
101 binder_uintptr_t cookie;
102 __u32 code;
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800103/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800104 __u32 flags;
105 pid_t sender_pid;
106 uid_t sender_euid;
107 binder_size_t data_size;
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800108/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800109 binder_size_t offsets_size;
110 union {
111 struct {
112 binder_uintptr_t buffer;
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800113/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800114 binder_uintptr_t offsets;
115 } ptr;
116 __u8 buf[8];
117 } data;
Arve Hjønnevågfbaa2542014-01-28 19:27:17 -0800118/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800119};
120struct binder_ptr_cookie {
Tao Baod7db5942015-01-28 10:07:51 -0800121 binder_uintptr_t ptr;
122 binder_uintptr_t cookie;
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800123/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800124};
Arve Hjønnevågfbaa2542014-01-28 19:27:17 -0800125struct binder_handle_cookie {
Tao Baod7db5942015-01-28 10:07:51 -0800126 __u32 handle;
127 binder_uintptr_t cookie;
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800128/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Christopher Ferris82d75042015-01-26 10:57:07 -0800129} __packed;
Arve Hjønnevågfbaa2542014-01-28 19:27:17 -0800130struct binder_pri_desc {
Tao Baod7db5942015-01-28 10:07:51 -0800131 __s32 priority;
132 __u32 desc;
Arve Hjønnevågfbaa2542014-01-28 19:27:17 -0800133/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800134};
135struct binder_pri_ptr_cookie {
Tao Baod7db5942015-01-28 10:07:51 -0800136 __s32 priority;
137 binder_uintptr_t ptr;
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800138/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800139 binder_uintptr_t cookie;
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800140};
141enum binder_driver_return_protocol {
Tao Baod7db5942015-01-28 10:07:51 -0800142 BR_ERROR = _IOR('r', 0, __s32),
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800143/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800144 BR_OK = _IO('r', 1),
145 BR_TRANSACTION = _IOR('r', 2, struct binder_transaction_data),
146 BR_REPLY = _IOR('r', 3, struct binder_transaction_data),
147 BR_ACQUIRE_RESULT = _IOR('r', 4, __s32),
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800148/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800149 BR_DEAD_REPLY = _IO('r', 5),
150 BR_TRANSACTION_COMPLETE = _IO('r', 6),
151 BR_INCREFS = _IOR('r', 7, struct binder_ptr_cookie),
152 BR_ACQUIRE = _IOR('r', 8, struct binder_ptr_cookie),
Arve Hjønnevågfbaa2542014-01-28 19:27:17 -0800153/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800154 BR_RELEASE = _IOR('r', 9, struct binder_ptr_cookie),
155 BR_DECREFS = _IOR('r', 10, struct binder_ptr_cookie),
156 BR_ATTEMPT_ACQUIRE = _IOR('r', 11, struct binder_pri_ptr_cookie),
157 BR_NOOP = _IO('r', 12),
Arve Hjønnevågfbaa2542014-01-28 19:27:17 -0800158/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800159 BR_SPAWN_LOOPER = _IO('r', 13),
160 BR_FINISHED = _IO('r', 14),
161 BR_DEAD_BINDER = _IOR('r', 15, binder_uintptr_t),
162 BR_CLEAR_DEATH_NOTIFICATION_DONE = _IOR('r', 16, binder_uintptr_t),
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800163/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800164 BR_FAILED_REPLY = _IO('r', 17),
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800165};
166enum binder_driver_command_protocol {
Tao Baod7db5942015-01-28 10:07:51 -0800167 BC_TRANSACTION = _IOW('c', 0, struct binder_transaction_data),
Arve Hjønnevågfbaa2542014-01-28 19:27:17 -0800168/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800169 BC_REPLY = _IOW('c', 1, struct binder_transaction_data),
170 BC_ACQUIRE_RESULT = _IOW('c', 2, __s32),
171 BC_FREE_BUFFER = _IOW('c', 3, binder_uintptr_t),
172 BC_INCREFS = _IOW('c', 4, __u32),
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800173/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800174 BC_ACQUIRE = _IOW('c', 5, __u32),
175 BC_RELEASE = _IOW('c', 6, __u32),
176 BC_DECREFS = _IOW('c', 7, __u32),
177 BC_INCREFS_DONE = _IOW('c', 8, struct binder_ptr_cookie),
Arve Hjønnevågfbaa2542014-01-28 19:27:17 -0800178/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800179 BC_ACQUIRE_DONE = _IOW('c', 9, struct binder_ptr_cookie),
180 BC_ATTEMPT_ACQUIRE = _IOW('c', 10, struct binder_pri_desc),
181 BC_REGISTER_LOOPER = _IO('c', 11),
182 BC_ENTER_LOOPER = _IO('c', 12),
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800183/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -0800184 BC_EXIT_LOOPER = _IO('c', 13),
185 BC_REQUEST_DEATH_NOTIFICATION = _IOW('c', 14, struct binder_handle_cookie),
186 BC_CLEAR_DEATH_NOTIFICATION = _IOW('c', 15, struct binder_handle_cookie),
187 BC_DEAD_BINDER_DONE = _IOW('c', 16, binder_uintptr_t),
Arve Hjønnevågfbaa2542014-01-28 19:27:17 -0800188/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Elliott Hughes8cb52b02013-11-21 13:43:23 -0800189};
190#endif