1 /****************************************************************************
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>
22 #define B_PACK_CHARS(c1,c2,c3,c4) ((((c1) << 24)) | (((c2) << 16)) | (((c3) << 8)) | (c4))
23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24 #define B_TYPE_LARGE 0x85
25 enum {
26   BINDER_TYPE_BINDER = B_PACK_CHARS('s', 'b', '*', B_TYPE_LARGE),
27   BINDER_TYPE_WEAK_BINDER = B_PACK_CHARS('w', 'b', '*', B_TYPE_LARGE),
28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29   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),
32 };
33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34 enum {
35   FLAT_BINDER_FLAG_PRIORITY_MASK = 0xff,
36   FLAT_BINDER_FLAG_ACCEPTS_FDS = 0x100,
37 };
38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39 #ifdef BINDER_IPC_32BIT
40 typedef __u32 binder_size_t;
41 typedef __u32 binder_uintptr_t;
42 #else
43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44 typedef __u64 binder_size_t;
45 typedef __u64 binder_uintptr_t;
46 #endif
47 struct flat_binder_object {
48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49   __u32 type;
50   __u32 flags;
51   union {
52     binder_uintptr_t binder;
53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54     __u32 handle;
55   };
56   binder_uintptr_t cookie;
57 };
58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59 struct binder_write_read {
60   binder_size_t write_size;
61   binder_size_t write_consumed;
62   binder_uintptr_t write_buffer;
63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64   binder_size_t read_size;
65   binder_size_t read_consumed;
66   binder_uintptr_t read_buffer;
67 };
68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69 struct binder_version {
70   __s32 protocol_version;
71 };
72 #ifdef BINDER_IPC_32BIT
73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74 #define BINDER_CURRENT_PROTOCOL_VERSION 7
75 #else
76 #define BINDER_CURRENT_PROTOCOL_VERSION 8
77 #endif
78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79 #define BINDER_WRITE_READ _IOWR('b', 1, struct binder_write_read)
80 #define BINDER_SET_IDLE_TIMEOUT _IOW('b', 3, __s64)
81 #define BINDER_SET_MAX_THREADS _IOW('b', 5, __u32)
82 #define BINDER_SET_IDLE_PRIORITY _IOW('b', 6, __s32)
83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84 #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)
87 enum transaction_flags {
88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89   TF_ONE_WAY = 0x01,
90   TF_ROOT_OBJECT = 0x04,
91   TF_STATUS_CODE = 0x08,
92   TF_ACCEPT_FDS = 0x10,
93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94 };
95 struct binder_transaction_data {
96   union {
97     __u32 handle;
98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99     binder_uintptr_t ptr;
100   } target;
101   binder_uintptr_t cookie;
102   __u32 code;
103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104   __u32 flags;
105   pid_t sender_pid;
106   uid_t sender_euid;
107   binder_size_t data_size;
108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109   binder_size_t offsets_size;
110   union {
111     struct {
112       binder_uintptr_t buffer;
113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114       binder_uintptr_t offsets;
115     } ptr;
116     __u8 buf[8];
117   } data;
118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119 };
120 struct binder_ptr_cookie {
121   binder_uintptr_t ptr;
122   binder_uintptr_t cookie;
123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124 };
125 struct binder_handle_cookie {
126   __u32 handle;
127   binder_uintptr_t cookie;
128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129 } __packed;
130 struct binder_pri_desc {
131   __s32 priority;
132   __u32 desc;
133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134 };
135 struct binder_pri_ptr_cookie {
136   __s32 priority;
137   binder_uintptr_t ptr;
138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139   binder_uintptr_t cookie;
140 };
141 enum binder_driver_return_protocol {
142   BR_ERROR = _IOR('r', 0, __s32),
143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144   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),
148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149   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),
153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154   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),
158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159   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),
163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164   BR_FAILED_REPLY = _IO('r', 17),
165 };
166 enum binder_driver_command_protocol {
167   BC_TRANSACTION = _IOW('c', 0, struct binder_transaction_data),
168 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169   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),
173 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
174   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),
178 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
179   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),
183 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
184   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),
188 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
189 };
190 #endif
191