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
3333 BINDER_TYPE_HANDLE = B_PACK_CHARS('s', 'h', '*', B_TYPE_LARGE),
3434 BINDER_TYPE_WEAK_HANDLE = B_PACK_CHARS('w', 'h', '*', B_TYPE_LARGE),
3535 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),
3638 };
3739
3840 enum {
@@ -48,6 +50,14 @@ typedef __u64 binder_size_t; · 9 unmodified lines
4850 typedef __u64 binder_uintptr_t;
4951 #endif
5052
53+/**
54+ * struct binder_object_header - header shared by all binder metadata objects.
55+ * @type: type of the object
56+ */
57+struct binder_object_header {
58+ __u32 type;
59+};
60+
5161 /*
5262 * This is the flattened representation of a Binder object for transfer
5363 * between processes. The 'offsets' supplied as part of a binder transaction
@@ -56,9 +66,8 @@ typedef __u64 binder_uintptr_t; · 2 unmodified lines
5666 * between processes.
5767 */
5868 struct flat_binder_object {
59− /* 8 bytes for large_flat_header. */
60− __u32 type;
61− __u32 flags;
69+ struct binder_object_header hdr;
70+ __u32 flags;
6271
6372 /* 8 bytes of data. */
6473 union {
@@ -70,6 +79,84 @@ struct flat_binder_object { · 5 unmodified lines
7079 binder_uintptr_t cookie;
7180 };
7281
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+ */
90+struct 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+ */
120+struct 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+
129+enum {
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+ */
153+struct 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+
73160 /*
74161 * On 64-bit platforms where user code may run in 32-bits the driver must
75162 * translate the buffer (and local binder) addresses appropriately.
@@ -162,6 +249,11 @@ struct binder_transaction_data { · 86 unmodified lines
162249 } data;
163250 };
164251
252+struct binder_transaction_data_sg {
253+ struct binder_transaction_data transaction_data;
254+ binder_size_t buffers_size;
255+};
256+
165257 struct binder_ptr_cookie {
166258 binder_uintptr_t ptr;
167259 binder_uintptr_t cookie;
@@ -346,6 +438,12 @@ enum binder_driver_command_protocol { · 178 unmodified lines
346438 /*
347439 * void *: cookie
348440 */
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+ */
349447 };
350448
351449 #endif /* _UAPI_LINUX_BINDER_H */