History

Merge tag 'char-misc-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc driver updates from Greg KH: "Here is the big char/misc driver patchset for 4.11-rc1. Lots of different driver subsystems updated here: rework for the hyperv subsystem to handle new platforms better, mei and w1 and extcon driver updates, as well as a number of other "minor" driver updates. All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (169 commits) goldfish: Sanitize the broken interrupt handler x86/platform/goldfish: Prevent unconditional loading vmbus: replace modulus operation with subtraction vmbus: constify parameters where possible vmbus: expose hv_begin/end_read vmbus: remove conditional locking of vmbus_write vmbus: add direct isr callback mode vmbus: change to per channel tasklet vmbus: put related per-cpu variable together vmbus: callback is in softirq not workqueue binder: Add support for file-descriptor arrays binder: Add support for scatter-gather binder: Add extra size to allocator binder: Refactor binder_transact() binder: Support multiple /dev instances binder: Deal with contexts in debugfs binder: Support multiple context managers binder: Split flat_binder_object auxdisplay: ht16k33: remove private workqueue auxdisplay: ht16k33: rework input device initialization ...

Linus Torvalds committed 9 years ago

Commit e30aee92 parents 8ff546b 6cf18e6134 files · +7034 −3859Browse files

Showing the changes to include/uapi/linux (1 of 134 files). Show all

Unified · Split

include/uapi/linux/android/binder.h+101−3
@@ -33,6 +33,8 @@ enum { · 32 unmodified lines
33 BINDER_TYPE_HANDLE = B_PACK_CHARS('s', 'h', '*', 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),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),35 BINDER_TYPE_FD = B_PACK_CHARS('f', 'd', '*', B_TYPE_LARGE),
36 BINDER_TYPE_FDA = B_PACK_CHARS('f', 'd', 'a', B_TYPE_LARGE),
37 BINDER_TYPE_PTR = B_PACK_CHARS('p', 't', '*', B_TYPE_LARGE),
36};38};
37 39
38enum {40enum {
@@ -48,6 +50,14 @@ typedef __u64 binder_size_t; · 9 unmodified lines
48typedef __u64 binder_uintptr_t;50typedef __u64 binder_uintptr_t;
49#endif51#endif
50 52
53/**
54 * struct binder_object_header - header shared by all binder metadata objects.
55 * @type: type of the object
56 */
57struct binder_object_header {
58 __u32 type;
59};
60
51/*61/*
52 * This is the flattened representation of a Binder object for transfer62 * This is the flattened representation of a Binder object for transfer
53 * between processes. The 'offsets' supplied as part of a binder transaction63 * between processes. The 'offsets' supplied as part of a binder transaction
@@ -56,9 +66,8 @@ typedef __u64 binder_uintptr_t; · 2 unmodified lines
56 * between processes.66 * between processes.
57 */67 */
58struct flat_binder_object {68struct flat_binder_object {
59 /* 8 bytes for large_flat_header. */69 struct binder_object_header hdr;
60 __u32 type;70 __u32 flags;
61 __u32 flags;
62 71
63 /* 8 bytes of data. */72 /* 8 bytes of data. */
64 union {73 union {
@@ -70,6 +79,84 @@ struct flat_binder_object { · 5 unmodified lines
70 binder_uintptr_t cookie;79 binder_uintptr_t cookie;
71};80};
72 81
82/**
83 * struct binder_fd_object - describes a filedescriptor to be fixed up.
84 * @hdr: common header structure
85 * @pad_flags: padding to remain compatible with old userspace code
86 * @pad_binder: padding to remain compatible with old userspace code
87 * @fd: file descriptor
88 * @cookie: opaque data, used by user-space
89 */
90struct binder_fd_object {
91 struct binder_object_header hdr;
92 __u32 pad_flags;
93 union {
94 binder_uintptr_t pad_binder;
95 __u32 fd;
96 };
97
98 binder_uintptr_t cookie;
99};
100
101/* struct binder_buffer_object - object describing a userspace buffer
102 * @hdr: common header structure
103 * @flags: one or more BINDER_BUFFER_* flags
104 * @buffer: address of the buffer
105 * @length: length of the buffer
106 * @parent: index in offset array pointing to parent buffer
107 * @parent_offset: offset in @parent pointing to this buffer
108 *
109 * A binder_buffer object represents an object that the
110 * binder kernel driver can copy verbatim to the target
111 * address space. A buffer itself may be pointed to from
112 * within another buffer, meaning that the pointer inside
113 * that other buffer needs to be fixed up as well. This
114 * can be done by setting the BINDER_BUFFER_FLAG_HAS_PARENT
115 * flag in @flags, by setting @parent buffer to the index
116 * in the offset array pointing to the parent binder_buffer_object,
117 * and by setting @parent_offset to the offset in the parent buffer
118 * at which the pointer to this buffer is located.
119 */
120struct binder_buffer_object {
121 struct binder_object_header hdr;
122 __u32 flags;
123 binder_uintptr_t buffer;
124 binder_size_t length;
125 binder_size_t parent;
126 binder_size_t parent_offset;
127};
128
129enum {
130 BINDER_BUFFER_FLAG_HAS_PARENT = 0x01,
131};
132
133/* struct binder_fd_array_object - object describing an array of fds in a buffer
134 * @hdr: common header structure
135 * @num_fds: number of file descriptors in the buffer
136 * @parent: index in offset array to buffer holding the fd array
137 * @parent_offset: start offset of fd array in the buffer
138 *
139 * A binder_fd_array object represents an array of file
140 * descriptors embedded in a binder_buffer_object. It is
141 * different from a regular binder_buffer_object because it
142 * describes a list of file descriptors to fix up, not an opaque
143 * blob of memory, and hence the kernel needs to treat it differently.
144 *
145 * An example of how this would be used is with Android's
146 * native_handle_t object, which is a struct with a list of integers
147 * and a list of file descriptors. The native_handle_t struct itself
148 * will be represented by a struct binder_buffer_objct, whereas the
149 * embedded list of file descriptors is represented by a
150 * struct binder_fd_array_object with that binder_buffer_object as
151 * a parent.
152 */
153struct binder_fd_array_object {
154 struct binder_object_header hdr;
155 binder_size_t num_fds;
156 binder_size_t parent;
157 binder_size_t parent_offset;
158};
159
73/*160/*
74 * On 64-bit platforms where user code may run in 32-bits the driver must161 * On 64-bit platforms where user code may run in 32-bits the driver must
75 * translate the buffer (and local binder) addresses appropriately.162 * translate the buffer (and local binder) addresses appropriately.
@@ -162,6 +249,11 @@ struct binder_transaction_data { · 86 unmodified lines
162 } data;249 } data;
163};250};
164 251
252struct binder_transaction_data_sg {
253 struct binder_transaction_data transaction_data;
254 binder_size_t buffers_size;
255};
256
165struct binder_ptr_cookie {257struct binder_ptr_cookie {
166 binder_uintptr_t ptr;258 binder_uintptr_t ptr;
167 binder_uintptr_t cookie;259 binder_uintptr_t cookie;
@@ -346,6 +438,12 @@ enum binder_driver_command_protocol { · 178 unmodified lines
346 /*438 /*
347 * void *: cookie439 * void *: cookie
348 */440 */
441
442 BC_TRANSACTION_SG = _IOW('c', 17, struct binder_transaction_data_sg),
443 BC_REPLY_SG = _IOW('c', 18, struct binder_transaction_data_sg),
444 /*
445 * binder_transaction_data_sg: the sent command.
446 */
349};447};
350 448
351#endif /* _UAPI_LINUX_BINDER_H */449#endif /* _UAPI_LINUX_BINDER_H */