• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/types.h>
22 #include <linux/ioctl.h>
23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24 #define B_PACK_CHARS(c1,c2,c3,c4) ((((c1) << 24)) | (((c2) << 16)) | (((c3) << 8)) | (c4))
25 #define B_TYPE_LARGE 0x85
26 enum {
27   BINDER_TYPE_BINDER = B_PACK_CHARS('s', 'b', '*', B_TYPE_LARGE),
28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29   BINDER_TYPE_WEAK_BINDER = B_PACK_CHARS('w', 'b', '*', B_TYPE_LARGE),
30   BINDER_TYPE_HANDLE = B_PACK_CHARS('s', 'h', '*', B_TYPE_LARGE),
31   BINDER_TYPE_WEAK_HANDLE = B_PACK_CHARS('w', 'h', '*', B_TYPE_LARGE),
32   BINDER_TYPE_FD = B_PACK_CHARS('f', 'd', '*', B_TYPE_LARGE),
33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34 };
35 enum {
36   FLAT_BINDER_FLAG_PRIORITY_MASK = 0xff,
37   FLAT_BINDER_FLAG_ACCEPTS_FDS = 0x100,
38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39 };
40 #ifdef BINDER_IPC_32BIT
41 typedef __u32 binder_size_t;
42 typedef __u32 binder_uintptr_t;
43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44 #else
45 typedef __u64 binder_size_t;
46 typedef __u64 binder_uintptr_t;
47 #endif
48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49 struct flat_binder_object {
50   __u32 type;
51   __u32 flags;
52   union {
53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54     binder_uintptr_t binder;
55     __u32 handle;
56   };
57   binder_uintptr_t cookie;
58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59 };
60 struct binder_write_read {
61   binder_size_t write_size;
62   binder_size_t write_consumed;
63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64   binder_uintptr_t write_buffer;
65   binder_size_t read_size;
66   binder_size_t read_consumed;
67   binder_uintptr_t read_buffer;
68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69 };
70 struct binder_version {
71   __s32 protocol_version;
72 };
73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74 #ifdef BINDER_IPC_32BIT
75 #define BINDER_CURRENT_PROTOCOL_VERSION 7
76 #else
77 #define BINDER_CURRENT_PROTOCOL_VERSION 8
78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79 #endif
80 #define BINDER_WRITE_READ _IOWR('b', 1, struct binder_write_read)
81 #define BINDER_SET_IDLE_TIMEOUT _IOW('b', 3, __s64)
82 #define BINDER_SET_MAX_THREADS _IOW('b', 5, __u32)
83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84 #define BINDER_SET_IDLE_PRIORITY _IOW('b', 6, __s32)
85 #define BINDER_SET_CONTEXT_MGR _IOW('b', 7, __s32)
86 #define BINDER_THREAD_EXIT _IOW('b', 8, __s32)
87 #define BINDER_VERSION _IOWR('b', 9, struct binder_version)
88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89 enum transaction_flags {
90   TF_ONE_WAY = 0x01,
91   TF_ROOT_OBJECT = 0x04,
92   TF_STATUS_CODE = 0x08,
93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94   TF_ACCEPT_FDS = 0x10,
95 };
96 struct binder_transaction_data {
97   union {
98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99     __u32 handle;
100     binder_uintptr_t ptr;
101   } target;
102   binder_uintptr_t cookie;
103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104   __u32 code;
105   __u32 flags;
106   pid_t sender_pid;
107   uid_t sender_euid;
108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109   binder_size_t data_size;
110   binder_size_t offsets_size;
111   union {
112     struct {
113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114       binder_uintptr_t buffer;
115       binder_uintptr_t offsets;
116     } ptr;
117     __u8 buf[8];
118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119   } data;
120 };
121 struct binder_ptr_cookie {
122   binder_uintptr_t ptr;
123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124   binder_uintptr_t cookie;
125 };
126 struct binder_handle_cookie {
127   __u32 handle;
128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129   binder_uintptr_t cookie;
130 } __packed;
131 struct binder_pri_desc {
132   __s32 priority;
133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134   __u32 desc;
135 };
136 struct binder_pri_ptr_cookie {
137   __s32 priority;
138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139   binder_uintptr_t ptr;
140   binder_uintptr_t cookie;
141 };
142 enum binder_driver_return_protocol {
143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144   BR_ERROR = _IOR('r', 0, __s32),
145   BR_OK = _IO('r', 1),
146   BR_TRANSACTION = _IOR('r', 2, struct binder_transaction_data),
147   BR_REPLY = _IOR('r', 3, struct binder_transaction_data),
148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149   BR_ACQUIRE_RESULT = _IOR('r', 4, __s32),
150   BR_DEAD_REPLY = _IO('r', 5),
151   BR_TRANSACTION_COMPLETE = _IO('r', 6),
152   BR_INCREFS = _IOR('r', 7, struct binder_ptr_cookie),
153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154   BR_ACQUIRE = _IOR('r', 8, struct binder_ptr_cookie),
155   BR_RELEASE = _IOR('r', 9, struct binder_ptr_cookie),
156   BR_DECREFS = _IOR('r', 10, struct binder_ptr_cookie),
157   BR_ATTEMPT_ACQUIRE = _IOR('r', 11, struct binder_pri_ptr_cookie),
158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159   BR_NOOP = _IO('r', 12),
160   BR_SPAWN_LOOPER = _IO('r', 13),
161   BR_FINISHED = _IO('r', 14),
162   BR_DEAD_BINDER = _IOR('r', 15, binder_uintptr_t),
163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164   BR_CLEAR_DEATH_NOTIFICATION_DONE = _IOR('r', 16, binder_uintptr_t),
165   BR_FAILED_REPLY = _IO('r', 17),
166 };
167 enum binder_driver_command_protocol {
168 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169   BC_TRANSACTION = _IOW('c', 0, struct binder_transaction_data),
170   BC_REPLY = _IOW('c', 1, struct binder_transaction_data),
171   BC_ACQUIRE_RESULT = _IOW('c', 2, __s32),
172   BC_FREE_BUFFER = _IOW('c', 3, binder_uintptr_t),
173 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
174   BC_INCREFS = _IOW('c', 4, __u32),
175   BC_ACQUIRE = _IOW('c', 5, __u32),
176   BC_RELEASE = _IOW('c', 6, __u32),
177   BC_DECREFS = _IOW('c', 7, __u32),
178 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
179   BC_INCREFS_DONE = _IOW('c', 8, struct binder_ptr_cookie),
180   BC_ACQUIRE_DONE = _IOW('c', 9, struct binder_ptr_cookie),
181   BC_ATTEMPT_ACQUIRE = _IOW('c', 10, struct binder_pri_desc),
182   BC_REGISTER_LOOPER = _IO('c', 11),
183 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
184   BC_ENTER_LOOPER = _IO('c', 12),
185   BC_EXIT_LOOPER = _IO('c', 13),
186   BC_REQUEST_DEATH_NOTIFICATION = _IOW('c', 14, struct binder_handle_cookie),
187   BC_CLEAR_DEATH_NOTIFICATION = _IOW('c', 15, struct binder_handle_cookie),
188 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
189   BC_DEAD_BINDER_DONE = _IOW('c', 16, binder_uintptr_t),
190 };
191 #endif
192