android: binder: support for scatter-gather.
authorMartijn Coenen <maco@google.com>
Fri, 30 Sep 2016 12:10:07 +0000 (14:10 +0200)
committerAmit Pundir <amit.pundir@linaro.org>
Tue, 15 Nov 2016 14:53:03 +0000 (20:23 +0530)
commit34b8f97791ba0c2ee897993484df5ee70a01d780
treebf48c879a8cabc44f54b1908d9b3f214539d0847
parentd7c114e9e7acd710307306090f4c4d70b48dec9c
android: binder: support for scatter-gather.

Previously all data passed over binder needed
to be serialized, with the exception of Binder
objects and file descriptors.

This patchs adds support for scatter-gathering raw
memory buffers into a binder transaction, avoiding
the need to first serialize them into a Parcel.

To remain backwards compatibile with existing
binder clients, it introduces two new command
ioctls for this purpose - BC_TRANSACTION_SG and
BC_REPLY_SG. These commands may only be used with
the new binder_transaction_data_sg structure,
which adds a field for the total size of the
buffers we are scatter-gathering.

Because memory buffers may contain pointers to
other buffers, we allow callers to specify
a parent buffer and an offset into it, to indicate
this is a location pointing to the buffer that
we are fixing up. The kernel will then take care
of fixing up the pointer to that buffer as well.

Change-Id: I02417f28cff14688f2e1d6fcb959438fd96566cc
Signed-off-by: Martijn Coenen <maco@google.com>
drivers/android/binder.c
include/uapi/linux/android/binder.h