aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/android
diff options
context:
space:
mode:
authorMartijn Coenen <maco@google.com>2017-02-03 17:40:45 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-02-10 10:00:01 -0500
commitfeba3900cabb8e7c87368faa28e7a6936809ba22 (patch)
tree4c2ae14351965f1ae8644c0899862e1796256bd4 /include/uapi/linux/android
parent8fa8bea728c261551baed01ef230e1138f2944ce (diff)
binder: Split flat_binder_object
flat_binder_object is used for both handling binder objects and file descriptors, even though the two are mostly independent. Since we'll have more fixup objects in binder in the future, instead of extending flat_binder_object again, split out file descriptors to their own object while retaining backwards compatibility to existing user-space clients. All binder objects just share a header. Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Martijn Coenen <maco@google.com> Cc: Arve Hjønnevåg <arve@android.com> Cc: Amit Pundir <amit.pundir@linaro.org> Cc: Serban Constantinescu <serban.constantinescu@arm.com> Cc: Dmitry Shmidt <dimitrysh@google.com> Cc: Rom Lemarchand <romlem@google.com> Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: Martijn Coenen <maco@google.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/uapi/linux/android')
-rw-r--r--include/uapi/linux/android/binder.h31
1 files changed, 28 insertions, 3 deletions
diff --git a/include/uapi/linux/android/binder.h b/include/uapi/linux/android/binder.h
index 41420e341e75..f67c2b1c0713 100644
--- a/include/uapi/linux/android/binder.h
+++ b/include/uapi/linux/android/binder.h
@@ -48,6 +48,14 @@ typedef __u64 binder_size_t;
48typedef __u64 binder_uintptr_t; 48typedef __u64 binder_uintptr_t;
49#endif 49#endif
50 50
51/**
52 * struct binder_object_header - header shared by all binder metadata objects.
53 * @type: type of the object
54 */
55struct binder_object_header {
56 __u32 type;
57};
58
51/* 59/*
52 * This is the flattened representation of a Binder object for transfer 60 * This is the flattened representation of a Binder object for transfer
53 * between processes. The 'offsets' supplied as part of a binder transaction 61 * between processes. The 'offsets' supplied as part of a binder transaction
@@ -56,9 +64,8 @@ typedef __u64 binder_uintptr_t;
56 * between processes. 64 * between processes.
57 */ 65 */
58struct flat_binder_object { 66struct flat_binder_object {
59 /* 8 bytes for large_flat_header. */ 67 struct binder_object_header hdr;
60 __u32 type; 68 __u32 flags;
61 __u32 flags;
62 69
63 /* 8 bytes of data. */ 70 /* 8 bytes of data. */
64 union { 71 union {
@@ -70,6 +77,24 @@ struct flat_binder_object {
70 binder_uintptr_t cookie; 77 binder_uintptr_t cookie;
71}; 78};
72 79
80/**
81 * struct binder_fd_object - describes a filedescriptor to be fixed up.
82 * @hdr: common header structure
83 * @pad_flags: padding to remain compatible with old userspace code
84 * @pad_binder: padding to remain compatible with old userspace code
85 * @fd: file descriptor
86 * @cookie: opaque data, used by user-space
87 */
88struct binder_fd_object {
89 struct binder_object_header hdr;
90 __u32 pad_flags;
91 union {
92 binder_uintptr_t pad_binder;
93 __u32 fd;
94 };
95
96 binder_uintptr_t cookie;
97};
73/* 98/*
74 * On 64-bit platforms where user code may run in 32-bits the driver must 99 * On 64-bit platforms where user code may run in 32-bits the driver must
75 * translate the buffer (and local binder) addresses appropriately. 100 * translate the buffer (and local binder) addresses appropriately.