Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2008 Google, Inc. |
| 3 | * |
| 4 | * Based on, but no longer compatible with, the original |
| 5 | * OpenBinder.org binder driver interface, which is: |
| 6 | * |
| 7 | * Copyright (c) 2005 Palmsource, Inc. |
| 8 | * |
| 9 | * This software is licensed under the terms of the GNU General Public |
| 10 | * License version 2, as published by the Free Software Foundation, and |
| 11 | * may be copied, distributed, and modified under those terms. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | */ |
| 19 | |
| 20 | #ifndef _UAPI_LINUX_BINDER_H |
| 21 | #define _UAPI_LINUX_BINDER_H |
| 22 | |
Greg Kroah-Hartman | bc2d62a | 2014-10-16 15:22:30 +0200 | [diff] [blame] | 23 | #include <linux/types.h> |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 24 | #include <linux/ioctl.h> |
| 25 | |
| 26 | #define B_PACK_CHARS(c1, c2, c3, c4) \ |
| 27 | ((((c1)<<24)) | (((c2)<<16)) | (((c3)<<8)) | (c4)) |
| 28 | #define B_TYPE_LARGE 0x85 |
| 29 | |
| 30 | enum { |
| 31 | BINDER_TYPE_BINDER = B_PACK_CHARS('s', 'b', '*', B_TYPE_LARGE), |
| 32 | BINDER_TYPE_WEAK_BINDER = B_PACK_CHARS('w', 'b', '*', B_TYPE_LARGE), |
| 33 | BINDER_TYPE_HANDLE = B_PACK_CHARS('s', 'h', '*', B_TYPE_LARGE), |
| 34 | BINDER_TYPE_WEAK_HANDLE = B_PACK_CHARS('w', 'h', '*', B_TYPE_LARGE), |
| 35 | BINDER_TYPE_FD = B_PACK_CHARS('f', 'd', '*', B_TYPE_LARGE), |
Martijn Coenen | e3e0f480 | 2016-10-18 13:58:55 +0200 | [diff] [blame] | 36 | BINDER_TYPE_FDA = B_PACK_CHARS('f', 'd', 'a', B_TYPE_LARGE), |
Martijn Coenen | 5a6da53 | 2016-09-30 14:10:07 +0200 | [diff] [blame] | 37 | BINDER_TYPE_PTR = B_PACK_CHARS('p', 't', '*', B_TYPE_LARGE), |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 38 | }; |
| 39 | |
Martijn Coenen | 6aac979 | 2017-06-07 09:29:14 -0700 | [diff] [blame^] | 40 | /** |
| 41 | * enum flat_binder_object_shifts: shift values for flat_binder_object_flags |
| 42 | * @FLAT_BINDER_FLAG_SCHED_POLICY_SHIFT: shift for getting scheduler policy. |
| 43 | * |
| 44 | */ |
| 45 | enum flat_binder_object_shifts { |
| 46 | FLAT_BINDER_FLAG_SCHED_POLICY_SHIFT = 9, |
| 47 | }; |
| 48 | |
| 49 | /** |
| 50 | * enum flat_binder_object_flags - flags for use in flat_binder_object.flags |
| 51 | */ |
| 52 | enum flat_binder_object_flags { |
| 53 | /** |
| 54 | * @FLAT_BINDER_FLAG_PRIORITY_MASK: bit-mask for min scheduler priority |
| 55 | * |
| 56 | * These bits can be used to set the minimum scheduler priority |
| 57 | * at which transactions into this node should run. Valid values |
| 58 | * in these bits depend on the scheduler policy encoded in |
| 59 | * @FLAT_BINDER_FLAG_SCHED_POLICY_MASK. |
| 60 | * |
| 61 | * For SCHED_NORMAL/SCHED_BATCH, the valid range is between [-20..19] |
| 62 | * For SCHED_FIFO/SCHED_RR, the value can run between [1..99] |
| 63 | */ |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 64 | FLAT_BINDER_FLAG_PRIORITY_MASK = 0xff, |
Martijn Coenen | 6aac979 | 2017-06-07 09:29:14 -0700 | [diff] [blame^] | 65 | /** |
| 66 | * @FLAT_BINDER_FLAG_ACCEPTS_FDS: whether the node accepts fds. |
| 67 | */ |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 68 | FLAT_BINDER_FLAG_ACCEPTS_FDS = 0x100, |
Martijn Coenen | 6aac979 | 2017-06-07 09:29:14 -0700 | [diff] [blame^] | 69 | /** |
| 70 | * @FLAT_BINDER_FLAG_SCHED_POLICY_MASK: bit-mask for scheduling policy |
| 71 | * |
| 72 | * These two bits can be used to set the min scheduling policy at which |
| 73 | * transactions on this node should run. These match the UAPI |
| 74 | * scheduler policy values, eg: |
| 75 | * 00b: SCHED_NORMAL |
| 76 | * 01b: SCHED_FIFO |
| 77 | * 10b: SCHED_RR |
| 78 | * 11b: SCHED_BATCH |
| 79 | */ |
| 80 | FLAT_BINDER_FLAG_SCHED_POLICY_MASK = |
| 81 | 3U << FLAT_BINDER_FLAG_SCHED_POLICY_SHIFT, |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 82 | }; |
| 83 | |
Arve Hjønnevåg | da49889 | 2014-02-21 14:40:26 -0800 | [diff] [blame] | 84 | #ifdef BINDER_IPC_32BIT |
| 85 | typedef __u32 binder_size_t; |
| 86 | typedef __u32 binder_uintptr_t; |
| 87 | #else |
| 88 | typedef __u64 binder_size_t; |
| 89 | typedef __u64 binder_uintptr_t; |
| 90 | #endif |
| 91 | |
Martijn Coenen | 00c8037 | 2016-07-13 12:06:49 +0200 | [diff] [blame] | 92 | /** |
| 93 | * struct binder_object_header - header shared by all binder metadata objects. |
| 94 | * @type: type of the object |
| 95 | */ |
| 96 | struct binder_object_header { |
| 97 | __u32 type; |
| 98 | }; |
| 99 | |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 100 | /* |
| 101 | * This is the flattened representation of a Binder object for transfer |
| 102 | * between processes. The 'offsets' supplied as part of a binder transaction |
| 103 | * contains offsets into the data where these structures occur. The Binder |
| 104 | * driver takes care of re-writing the structure type and data as it moves |
| 105 | * between processes. |
| 106 | */ |
| 107 | struct flat_binder_object { |
Martijn Coenen | 00c8037 | 2016-07-13 12:06:49 +0200 | [diff] [blame] | 108 | struct binder_object_header hdr; |
| 109 | __u32 flags; |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 110 | |
| 111 | /* 8 bytes of data. */ |
| 112 | union { |
Arve Hjønnevåg | da49889 | 2014-02-21 14:40:26 -0800 | [diff] [blame] | 113 | binder_uintptr_t binder; /* local object */ |
| 114 | __u32 handle; /* remote object */ |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 115 | }; |
| 116 | |
| 117 | /* extra data associated with local object */ |
Arve Hjønnevåg | da49889 | 2014-02-21 14:40:26 -0800 | [diff] [blame] | 118 | binder_uintptr_t cookie; |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 119 | }; |
| 120 | |
Martijn Coenen | 00c8037 | 2016-07-13 12:06:49 +0200 | [diff] [blame] | 121 | /** |
| 122 | * struct binder_fd_object - describes a filedescriptor to be fixed up. |
| 123 | * @hdr: common header structure |
| 124 | * @pad_flags: padding to remain compatible with old userspace code |
| 125 | * @pad_binder: padding to remain compatible with old userspace code |
| 126 | * @fd: file descriptor |
| 127 | * @cookie: opaque data, used by user-space |
| 128 | */ |
| 129 | struct binder_fd_object { |
| 130 | struct binder_object_header hdr; |
| 131 | __u32 pad_flags; |
| 132 | union { |
| 133 | binder_uintptr_t pad_binder; |
| 134 | __u32 fd; |
| 135 | }; |
| 136 | |
| 137 | binder_uintptr_t cookie; |
| 138 | }; |
Martijn Coenen | 5a6da53 | 2016-09-30 14:10:07 +0200 | [diff] [blame] | 139 | |
| 140 | /* struct binder_buffer_object - object describing a userspace buffer |
| 141 | * @hdr: common header structure |
| 142 | * @flags: one or more BINDER_BUFFER_* flags |
| 143 | * @buffer: address of the buffer |
| 144 | * @length: length of the buffer |
| 145 | * @parent: index in offset array pointing to parent buffer |
| 146 | * @parent_offset: offset in @parent pointing to this buffer |
| 147 | * |
| 148 | * A binder_buffer object represents an object that the |
| 149 | * binder kernel driver can copy verbatim to the target |
| 150 | * address space. A buffer itself may be pointed to from |
| 151 | * within another buffer, meaning that the pointer inside |
| 152 | * that other buffer needs to be fixed up as well. This |
| 153 | * can be done by setting the BINDER_BUFFER_FLAG_HAS_PARENT |
| 154 | * flag in @flags, by setting @parent buffer to the index |
| 155 | * in the offset array pointing to the parent binder_buffer_object, |
| 156 | * and by setting @parent_offset to the offset in the parent buffer |
| 157 | * at which the pointer to this buffer is located. |
| 158 | */ |
| 159 | struct binder_buffer_object { |
| 160 | struct binder_object_header hdr; |
| 161 | __u32 flags; |
| 162 | binder_uintptr_t buffer; |
| 163 | binder_size_t length; |
| 164 | binder_size_t parent; |
| 165 | binder_size_t parent_offset; |
| 166 | }; |
| 167 | |
| 168 | enum { |
| 169 | BINDER_BUFFER_FLAG_HAS_PARENT = 0x01, |
| 170 | }; |
| 171 | |
Martijn Coenen | e3e0f480 | 2016-10-18 13:58:55 +0200 | [diff] [blame] | 172 | /* struct binder_fd_array_object - object describing an array of fds in a buffer |
| 173 | * @hdr: common header structure |
Martijn Coenen | 8b451dc | 2017-03-07 15:54:56 +0100 | [diff] [blame] | 174 | * @pad: padding to ensure correct alignment |
Martijn Coenen | e3e0f480 | 2016-10-18 13:58:55 +0200 | [diff] [blame] | 175 | * @num_fds: number of file descriptors in the buffer |
| 176 | * @parent: index in offset array to buffer holding the fd array |
| 177 | * @parent_offset: start offset of fd array in the buffer |
| 178 | * |
| 179 | * A binder_fd_array object represents an array of file |
| 180 | * descriptors embedded in a binder_buffer_object. It is |
| 181 | * different from a regular binder_buffer_object because it |
| 182 | * describes a list of file descriptors to fix up, not an opaque |
| 183 | * blob of memory, and hence the kernel needs to treat it differently. |
| 184 | * |
| 185 | * An example of how this would be used is with Android's |
| 186 | * native_handle_t object, which is a struct with a list of integers |
| 187 | * and a list of file descriptors. The native_handle_t struct itself |
| 188 | * will be represented by a struct binder_buffer_objct, whereas the |
| 189 | * embedded list of file descriptors is represented by a |
| 190 | * struct binder_fd_array_object with that binder_buffer_object as |
| 191 | * a parent. |
| 192 | */ |
| 193 | struct binder_fd_array_object { |
| 194 | struct binder_object_header hdr; |
Martijn Coenen | 8b451dc | 2017-03-07 15:54:56 +0100 | [diff] [blame] | 195 | __u32 pad; |
Martijn Coenen | e3e0f480 | 2016-10-18 13:58:55 +0200 | [diff] [blame] | 196 | binder_size_t num_fds; |
| 197 | binder_size_t parent; |
| 198 | binder_size_t parent_offset; |
| 199 | }; |
| 200 | |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 201 | /* |
| 202 | * On 64-bit platforms where user code may run in 32-bits the driver must |
| 203 | * translate the buffer (and local binder) addresses appropriately. |
| 204 | */ |
| 205 | |
| 206 | struct binder_write_read { |
Arve Hjønnevåg | da49889 | 2014-02-21 14:40:26 -0800 | [diff] [blame] | 207 | binder_size_t write_size; /* bytes to write */ |
| 208 | binder_size_t write_consumed; /* bytes consumed by driver */ |
| 209 | binder_uintptr_t write_buffer; |
| 210 | binder_size_t read_size; /* bytes to read */ |
| 211 | binder_size_t read_consumed; /* bytes consumed by driver */ |
| 212 | binder_uintptr_t read_buffer; |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 213 | }; |
| 214 | |
| 215 | /* Use with BINDER_VERSION, driver fills in fields. */ |
| 216 | struct binder_version { |
| 217 | /* driver protocol version -- increment with incompatible change */ |
| 218 | __s32 protocol_version; |
| 219 | }; |
| 220 | |
| 221 | /* This is the current protocol version. */ |
Arve Hjønnevåg | da49889 | 2014-02-21 14:40:26 -0800 | [diff] [blame] | 222 | #ifdef BINDER_IPC_32BIT |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 223 | #define BINDER_CURRENT_PROTOCOL_VERSION 7 |
Arve Hjønnevåg | da49889 | 2014-02-21 14:40:26 -0800 | [diff] [blame] | 224 | #else |
| 225 | #define BINDER_CURRENT_PROTOCOL_VERSION 8 |
| 226 | #endif |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 227 | |
| 228 | #define BINDER_WRITE_READ _IOWR('b', 1, struct binder_write_read) |
| 229 | #define BINDER_SET_IDLE_TIMEOUT _IOW('b', 3, __s64) |
| 230 | #define BINDER_SET_MAX_THREADS _IOW('b', 5, __u32) |
| 231 | #define BINDER_SET_IDLE_PRIORITY _IOW('b', 6, __s32) |
| 232 | #define BINDER_SET_CONTEXT_MGR _IOW('b', 7, __s32) |
| 233 | #define BINDER_THREAD_EXIT _IOW('b', 8, __s32) |
| 234 | #define BINDER_VERSION _IOWR('b', 9, struct binder_version) |
| 235 | |
| 236 | /* |
| 237 | * NOTE: Two special error codes you should check for when calling |
| 238 | * in to the driver are: |
| 239 | * |
| 240 | * EINTR -- The operation has been interupted. This should be |
| 241 | * handled by retrying the ioctl() until a different error code |
| 242 | * is returned. |
| 243 | * |
| 244 | * ECONNREFUSED -- The driver is no longer accepting operations |
| 245 | * from your process. That is, the process is being destroyed. |
| 246 | * You should handle this by exiting from your process. Note |
| 247 | * that once this error code is returned, all further calls to |
| 248 | * the driver from any thread will return this same code. |
| 249 | */ |
| 250 | |
| 251 | enum transaction_flags { |
| 252 | TF_ONE_WAY = 0x01, /* this is a one-way call: async, no return */ |
| 253 | TF_ROOT_OBJECT = 0x04, /* contents are the component's root object */ |
| 254 | TF_STATUS_CODE = 0x08, /* contents are a 32-bit status code */ |
| 255 | TF_ACCEPT_FDS = 0x10, /* allow replies with file descriptors */ |
| 256 | }; |
| 257 | |
| 258 | struct binder_transaction_data { |
| 259 | /* The first two are only used for bcTRANSACTION and brTRANSACTION, |
| 260 | * identifying the target and contents of the transaction. |
| 261 | */ |
| 262 | union { |
Arve Hjønnevåg | da49889 | 2014-02-21 14:40:26 -0800 | [diff] [blame] | 263 | /* target descriptor of command transaction */ |
| 264 | __u32 handle; |
| 265 | /* target descriptor of return transaction */ |
| 266 | binder_uintptr_t ptr; |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 267 | } target; |
Arve Hjønnevåg | da49889 | 2014-02-21 14:40:26 -0800 | [diff] [blame] | 268 | binder_uintptr_t cookie; /* target object cookie */ |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 269 | __u32 code; /* transaction command */ |
| 270 | |
| 271 | /* General information about the transaction. */ |
| 272 | __u32 flags; |
| 273 | pid_t sender_pid; |
| 274 | uid_t sender_euid; |
Arve Hjønnevåg | da49889 | 2014-02-21 14:40:26 -0800 | [diff] [blame] | 275 | binder_size_t data_size; /* number of bytes of data */ |
| 276 | binder_size_t offsets_size; /* number of bytes of offsets */ |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 277 | |
| 278 | /* If this transaction is inline, the data immediately |
| 279 | * follows here; otherwise, it ends with a pointer to |
| 280 | * the data buffer. |
| 281 | */ |
| 282 | union { |
| 283 | struct { |
| 284 | /* transaction data */ |
Arve Hjønnevåg | da49889 | 2014-02-21 14:40:26 -0800 | [diff] [blame] | 285 | binder_uintptr_t buffer; |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 286 | /* offsets from buffer to flat_binder_object structs */ |
Arve Hjønnevåg | da49889 | 2014-02-21 14:40:26 -0800 | [diff] [blame] | 287 | binder_uintptr_t offsets; |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 288 | } ptr; |
| 289 | __u8 buf[8]; |
| 290 | } data; |
| 291 | }; |
| 292 | |
Martijn Coenen | 5a6da53 | 2016-09-30 14:10:07 +0200 | [diff] [blame] | 293 | struct binder_transaction_data_sg { |
| 294 | struct binder_transaction_data transaction_data; |
| 295 | binder_size_t buffers_size; |
| 296 | }; |
| 297 | |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 298 | struct binder_ptr_cookie { |
Arve Hjønnevåg | da49889 | 2014-02-21 14:40:26 -0800 | [diff] [blame] | 299 | binder_uintptr_t ptr; |
| 300 | binder_uintptr_t cookie; |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 301 | }; |
| 302 | |
Serban Constantinescu | df24a2e | 2014-02-21 14:40:25 -0800 | [diff] [blame] | 303 | struct binder_handle_cookie { |
| 304 | __u32 handle; |
Arve Hjønnevåg | da49889 | 2014-02-21 14:40:26 -0800 | [diff] [blame] | 305 | binder_uintptr_t cookie; |
Purnendu Kapadia | 2fd2914 | 2014-08-15 18:20:30 +0100 | [diff] [blame] | 306 | } __packed; |
Serban Constantinescu | df24a2e | 2014-02-21 14:40:25 -0800 | [diff] [blame] | 307 | |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 308 | struct binder_pri_desc { |
| 309 | __s32 priority; |
| 310 | __u32 desc; |
| 311 | }; |
| 312 | |
| 313 | struct binder_pri_ptr_cookie { |
| 314 | __s32 priority; |
Arve Hjønnevåg | da49889 | 2014-02-21 14:40:26 -0800 | [diff] [blame] | 315 | binder_uintptr_t ptr; |
| 316 | binder_uintptr_t cookie; |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 317 | }; |
| 318 | |
| 319 | enum binder_driver_return_protocol { |
| 320 | BR_ERROR = _IOR('r', 0, __s32), |
| 321 | /* |
| 322 | * int: error code |
| 323 | */ |
| 324 | |
| 325 | BR_OK = _IO('r', 1), |
| 326 | /* No parameters! */ |
| 327 | |
| 328 | BR_TRANSACTION = _IOR('r', 2, struct binder_transaction_data), |
| 329 | BR_REPLY = _IOR('r', 3, struct binder_transaction_data), |
| 330 | /* |
| 331 | * binder_transaction_data: the received command. |
| 332 | */ |
| 333 | |
| 334 | BR_ACQUIRE_RESULT = _IOR('r', 4, __s32), |
| 335 | /* |
| 336 | * not currently supported |
| 337 | * int: 0 if the last bcATTEMPT_ACQUIRE was not successful. |
| 338 | * Else the remote object has acquired a primary reference. |
| 339 | */ |
| 340 | |
| 341 | BR_DEAD_REPLY = _IO('r', 5), |
| 342 | /* |
| 343 | * The target of the last transaction (either a bcTRANSACTION or |
| 344 | * a bcATTEMPT_ACQUIRE) is no longer with us. No parameters. |
| 345 | */ |
| 346 | |
| 347 | BR_TRANSACTION_COMPLETE = _IO('r', 6), |
| 348 | /* |
| 349 | * No parameters... always refers to the last transaction requested |
| 350 | * (including replies). Note that this will be sent even for |
| 351 | * asynchronous transactions. |
| 352 | */ |
| 353 | |
| 354 | BR_INCREFS = _IOR('r', 7, struct binder_ptr_cookie), |
| 355 | BR_ACQUIRE = _IOR('r', 8, struct binder_ptr_cookie), |
| 356 | BR_RELEASE = _IOR('r', 9, struct binder_ptr_cookie), |
| 357 | BR_DECREFS = _IOR('r', 10, struct binder_ptr_cookie), |
| 358 | /* |
| 359 | * void *: ptr to binder |
| 360 | * void *: cookie for binder |
| 361 | */ |
| 362 | |
| 363 | BR_ATTEMPT_ACQUIRE = _IOR('r', 11, struct binder_pri_ptr_cookie), |
| 364 | /* |
| 365 | * not currently supported |
| 366 | * int: priority |
| 367 | * void *: ptr to binder |
| 368 | * void *: cookie for binder |
| 369 | */ |
| 370 | |
| 371 | BR_NOOP = _IO('r', 12), |
| 372 | /* |
| 373 | * No parameters. Do nothing and examine the next command. It exists |
| 374 | * primarily so that we can replace it with a BR_SPAWN_LOOPER command. |
| 375 | */ |
| 376 | |
| 377 | BR_SPAWN_LOOPER = _IO('r', 13), |
| 378 | /* |
| 379 | * No parameters. The driver has determined that a process has no |
| 380 | * threads waiting to service incoming transactions. When a process |
| 381 | * receives this command, it must spawn a new service thread and |
| 382 | * register it via bcENTER_LOOPER. |
| 383 | */ |
| 384 | |
| 385 | BR_FINISHED = _IO('r', 14), |
| 386 | /* |
| 387 | * not currently supported |
| 388 | * stop threadpool thread |
| 389 | */ |
| 390 | |
Arve Hjønnevåg | da49889 | 2014-02-21 14:40:26 -0800 | [diff] [blame] | 391 | BR_DEAD_BINDER = _IOR('r', 15, binder_uintptr_t), |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 392 | /* |
| 393 | * void *: cookie |
| 394 | */ |
Arve Hjønnevåg | da49889 | 2014-02-21 14:40:26 -0800 | [diff] [blame] | 395 | BR_CLEAR_DEATH_NOTIFICATION_DONE = _IOR('r', 16, binder_uintptr_t), |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 396 | /* |
| 397 | * void *: cookie |
| 398 | */ |
| 399 | |
| 400 | BR_FAILED_REPLY = _IO('r', 17), |
| 401 | /* |
| 402 | * The the last transaction (either a bcTRANSACTION or |
| 403 | * a bcATTEMPT_ACQUIRE) failed (e.g. out of memory). No parameters. |
| 404 | */ |
| 405 | }; |
| 406 | |
| 407 | enum binder_driver_command_protocol { |
| 408 | BC_TRANSACTION = _IOW('c', 0, struct binder_transaction_data), |
| 409 | BC_REPLY = _IOW('c', 1, struct binder_transaction_data), |
| 410 | /* |
| 411 | * binder_transaction_data: the sent command. |
| 412 | */ |
| 413 | |
| 414 | BC_ACQUIRE_RESULT = _IOW('c', 2, __s32), |
| 415 | /* |
| 416 | * not currently supported |
| 417 | * int: 0 if the last BR_ATTEMPT_ACQUIRE was not successful. |
| 418 | * Else you have acquired a primary reference on the object. |
| 419 | */ |
| 420 | |
Arve Hjønnevåg | da49889 | 2014-02-21 14:40:26 -0800 | [diff] [blame] | 421 | BC_FREE_BUFFER = _IOW('c', 3, binder_uintptr_t), |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 422 | /* |
| 423 | * void *: ptr to transaction data received on a read |
| 424 | */ |
| 425 | |
| 426 | BC_INCREFS = _IOW('c', 4, __u32), |
| 427 | BC_ACQUIRE = _IOW('c', 5, __u32), |
| 428 | BC_RELEASE = _IOW('c', 6, __u32), |
| 429 | BC_DECREFS = _IOW('c', 7, __u32), |
| 430 | /* |
| 431 | * int: descriptor |
| 432 | */ |
| 433 | |
| 434 | BC_INCREFS_DONE = _IOW('c', 8, struct binder_ptr_cookie), |
| 435 | BC_ACQUIRE_DONE = _IOW('c', 9, struct binder_ptr_cookie), |
| 436 | /* |
| 437 | * void *: ptr to binder |
| 438 | * void *: cookie for binder |
| 439 | */ |
| 440 | |
| 441 | BC_ATTEMPT_ACQUIRE = _IOW('c', 10, struct binder_pri_desc), |
| 442 | /* |
| 443 | * not currently supported |
| 444 | * int: priority |
| 445 | * int: descriptor |
| 446 | */ |
| 447 | |
| 448 | BC_REGISTER_LOOPER = _IO('c', 11), |
| 449 | /* |
| 450 | * No parameters. |
| 451 | * Register a spawned looper thread with the device. |
| 452 | */ |
| 453 | |
| 454 | BC_ENTER_LOOPER = _IO('c', 12), |
| 455 | BC_EXIT_LOOPER = _IO('c', 13), |
| 456 | /* |
| 457 | * No parameters. |
| 458 | * These two commands are sent as an application-level thread |
| 459 | * enters and exits the binder loop, respectively. They are |
| 460 | * used so the binder can have an accurate count of the number |
| 461 | * of looping threads it has available. |
| 462 | */ |
| 463 | |
Serban Constantinescu | df24a2e | 2014-02-21 14:40:25 -0800 | [diff] [blame] | 464 | BC_REQUEST_DEATH_NOTIFICATION = _IOW('c', 14, |
| 465 | struct binder_handle_cookie), |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 466 | /* |
Serban Constantinescu | df24a2e | 2014-02-21 14:40:25 -0800 | [diff] [blame] | 467 | * int: handle |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 468 | * void *: cookie |
| 469 | */ |
| 470 | |
Serban Constantinescu | df24a2e | 2014-02-21 14:40:25 -0800 | [diff] [blame] | 471 | BC_CLEAR_DEATH_NOTIFICATION = _IOW('c', 15, |
| 472 | struct binder_handle_cookie), |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 473 | /* |
Serban Constantinescu | df24a2e | 2014-02-21 14:40:25 -0800 | [diff] [blame] | 474 | * int: handle |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 475 | * void *: cookie |
| 476 | */ |
| 477 | |
Arve Hjønnevåg | da49889 | 2014-02-21 14:40:26 -0800 | [diff] [blame] | 478 | BC_DEAD_BINDER_DONE = _IOW('c', 16, binder_uintptr_t), |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 479 | /* |
| 480 | * void *: cookie |
| 481 | */ |
Martijn Coenen | 5a6da53 | 2016-09-30 14:10:07 +0200 | [diff] [blame] | 482 | |
| 483 | BC_TRANSACTION_SG = _IOW('c', 17, struct binder_transaction_data_sg), |
| 484 | BC_REPLY_SG = _IOW('c', 18, struct binder_transaction_data_sg), |
| 485 | /* |
| 486 | * binder_transaction_data_sg: the sent command. |
| 487 | */ |
Colin Cross | a3e9ddb | 2014-02-17 13:58:33 -0800 | [diff] [blame] | 488 | }; |
| 489 | |
| 490 | #endif /* _UAPI_LINUX_BINDER_H */ |
| 491 | |