[PATCH 07/13] android: binder: add functions for manipulating transaction stack

2015-05-28 Thread Riley Andrews
Add helper functions for manipulating the transaction stack, and for validating the transaction stack during binder transactions and replies. Signed-off-by: Riley Andrews --- drivers/android/binder.c | 126 +-- 1 file changed, 79 insertions(+), 47

[PATCH 10/13] android: binder: refactor binder_thread_read loop

2015-05-28 Thread Riley Andrews
Add dedicated functions for every work type in the switch statement. Refactor the loop logic to remove the while 1, and make it explicit which work items cause the loop to exit. Signed-off-by: Riley Andrews --- drivers/android/binder.c | 433 +-- 1

[PATCH 02/13] android: binder: fix duplicate error return.

2015-05-28 Thread Riley Andrews
Duplicate errors can be returned to userspace when the thread error code is left set when the read buffer runs out of space. Signed-off-by: Riley Andrews --- drivers/android/binder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/android/binder.c b/drivers/android

[PATCH 04/13] android: binder: refactor binder_transact handle translation

2015-05-28 Thread Riley Andrews
Add dedicated functions for handling the movement of fds, binder objects, and references across processes. Signed-off-by: Riley Andrews --- drivers/android/binder.c | 311 +-- 1 file changed, 167 insertions(+), 144 deletions(-) diff --git a/drivers

[PATCH 12/13] android: binder: add function to pass thread errors to userspace

2015-05-28 Thread Riley Andrews
Add a dedicated function for handling errors. Signed-off-by: Riley Andrews --- drivers/android/binder.c | 51 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index c98436c

[PATCH 01/13] drivers: android: correct the size of struct binder_uintptr_t for BC_DEAD_BINDER_DONE

2015-05-28 Thread Riley Andrews
From: Lisa Du There's one point was missed in the patch commit da49889deb34 ("staging: binder: Support concurrent 32 bit and 64 bit processes."). When configure BINDER_IPC_32BIT, the size of binder_uintptr_t was 32bits, but size of void * is 64bit on 64bit system. Correct it here. Signed-off-by:

[PATCH 13/13] android: binder: add function for processing work nodes in binder_thread_read

2015-05-28 Thread Riley Andrews
Split up binder_thread_read into a function for waiting for work and a function for processing the work nodes. Signed-off-by: Riley Andrews --- drivers/android/binder.c | 96 1 file changed, 56 insertions(+), 40 deletions(-) diff --git a/drivers

[PATCH 05/13] android: binder: refactor binder_transact transaction buffer loop

2015-05-28 Thread Riley Andrews
Pull the loop that translates the flat_binder_objects into a separate function, binder_transaction_buffer_acquire. Signed-off-by: Riley Andrews --- drivers/android/binder.c | 128 --- 1 file changed, 77 insertions(+), 51 deletions(-) diff --git a

[PATCH 03/13] android: binder: refactor binder_thread_write

2015-05-28 Thread Riley Andrews
Give every case in the switch statement its own dedicated function. Remove the process argument to binder_transact, as it can be derived from the thread argument as with all of the other newly created functions. Signed-off-by: Riley Andrews --- drivers/android/binder.c | 613

[PATCH 11/13] android: binder: add function to handle waiting for binder_thread_read

2015-05-28 Thread Riley Andrews
Add another helper function for binder_thread_read. All of the logic for waiting for work to do has been pulled into this function. Signed-off-by: Riley Andrews --- drivers/android/binder.c | 104 ++- 1 file changed, 66 insertions(+), 38 deletions

[PATCH 06/13] android: binder: add function to find target binder node

2015-05-28 Thread Riley Andrews
Pull the logic that determines the target_node of a transaction into a dedicated function. Signed-off-by: Riley Andrews --- drivers/android/binder.c | 46 +++--- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/drivers/android/binder.c b

[PATCH 09/13] android: binder: add function for finding prior thread in transaction stack

2015-05-28 Thread Riley Andrews
Add a helper function to find a thread within a transaction stack. Signed-off-by: Riley Andrews --- drivers/android/binder.c | 23 +++ 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index f7f2217..abd5556

[PATCH 08/13] android: binder: add function for logging failed transactions

2015-05-28 Thread Riley Andrews
Add another helper function that adds log entries to failed log. Signed-off-by: Riley Andrews --- drivers/android/binder.c | 18 +++--- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/android/binder.c b/drivers/android/binder.c index ed94121..f7f2217 100644