Skip to content

Commit

Permalink
BACKPORT: staging: android: binder: move to the real part of the kernel
Browse files Browse the repository at this point in the history
The Android binder code has been "stable" for many years now.  No matter
what comes in the future, we are going to have to support this API, so
might as well move it to the "real" part of the kernel as there's no
real work that needs to be done to the existing code.

[@dev-harsh1998]: Adjust for 3.10 kernel

Signed-off-by: Greg Kroah-Hartman <[email protected]>
Signed-off-by: dev-harsh1998 <[email protected]>
Signed-off-by: Ad!thya R <[email protected]>
  • Loading branch information
gregkh authored and adithya2306 committed Jul 26, 2018
1 parent 607f837 commit afd1da6
Show file tree
Hide file tree
Showing 15 changed files with 70 additions and 50 deletions.
2 changes: 2 additions & 0 deletions drivers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -188,4 +188,6 @@ source "drivers/soc/Kconfig"

source "drivers/firmware/Kconfig"

source "drivers/android/Kconfig"

endmenu
1 change: 1 addition & 0 deletions drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,4 @@ obj-$(CONFIG_ESOC) += esoc/
obj-$(CONFIG_BIF) += bif/
obj-$(CONFIG_SENSORS) += sensors/
obj-$(CONFIG_SENSORS_SSC) += sensors/
obj-$(CONFIG_ANDROID) += android/
59 changes: 59 additions & 0 deletions drivers/android/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
menu "Android"

config ANDROID
bool "Android Drivers"
---help---
Enable support for various drivers needed on the Android platform

if ANDROID

config ANDROID_BINDER_IPC
bool "Android Binder IPC Driver"
depends on MMU
default n
---help---
Binder is used in Android for both communication between processes,
and remote method invocation.

This means one Android process can call a method/routine in another
Android process, using Binder to identify, invoke and pass arguments
between said processes.

config ANDROID_BINDER_IPC_32BIT
bool
depends on !64BIT && ANDROID_BINDER_IPC
default y
---help---
The Binder API has been changed to support both 32 and 64bit
applications in a mixed environment.

Enable this to support an old 32-bit Android user-space (v4.4 and
earlier).

Note that enabling this will break newer Android user-space.

config ANDROID_BINDER_DEVICES
string "Android Binder devices"
depends on ANDROID_BINDER_IPC
default "binder,hwbinder,vndbinder"
---help---
Default value for the binder.devices parameter.

The binder.devices parameter is a comma-separated list of strings
that specifies the names of the binder device nodes that will be
created. Each binder device has its own context manager, and is
therefore logically separated from the other devices.

config ANDROID_BINDER_IPC_SELFTEST
bool "Android Binder IPC Driver Selftest"
depends on ANDROID_BINDER_IPC
---help---
This feature allows binder selftest to run.

Binder selftest checks the allocation and free of binder buffers
exhaustively with combinations of various buffer sizes and
alignments.

endif # if ANDROID

endmenu
4 changes: 4 additions & 0 deletions drivers/android/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ccflags-y += -I$(src) # needed for trace events

obj-$(CONFIG_ANDROID_BINDER_IPC) += binder.o binder_alloc.o
obj-$(CONFIG_ANDROID_BINDER_IPC_SELFTEST) += binder_alloc_selftest.o
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define BINDER_IPC_32BIT 1
#endif

#include "uapi/binder.h"
#include <uapi/linux/android/binder.h>

#endif /* _LINUX_BINDER_H */

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
47 changes: 0 additions & 47 deletions drivers/staging/android/Kconfig
Original file line number Diff line number Diff line change
@@ -1,54 +1,7 @@
menu "Android"

config ANDROID
bool "Android Drivers"
default N
---help---
Enable support for various drivers needed on the Android platform

if ANDROID

config ANDROID_BINDER_IPC
bool "Android Binder IPC Driver"
default n
---help---
Binder is used in Android for both communication between processes,
and remote method invocation.

This means one Android process can call a method/routine in another
Android process, using Binder to identify, invoke and pass arguments
between said processes.

config ANDROID_BINDER_IPC_32BIT
bool "Use old (Android 4.4 and earlier) 32-bit binder API"
depends on !64BIT && ANDROID_BINDER_IPC
default y
---help---
Enable to support an old 32-bit Android user-space. Breaks the new
Android user-space.

config ANDROID_BINDER_DEVICES
string "Android Binder devices"
depends on ANDROID_BINDER_IPC
default "binder,hwbinder,vndbinder"
---help---
Default value for the binder.devices parameter.

The binder.devices parameter is a comma-separated list of strings
that specifies the names of the binder device nodes that will be
created. Each binder device has its own context manager, and is
therefore logically separated from the other devices.

config ANDROID_BINDER_IPC_SELFTEST
bool "Android Binder IPC Driver Selftest"
depends on ANDROID_BINDER_IPC
---help---
This feature allows binder selftest to run.

Binder selftest checks the allocation and free of binder buffers
exhaustively with combinations of various buffer sizes and
alignments.

config ASHMEM
bool "Enable the Anonymous Shared Memory Subsystem"
default n
Expand Down
2 changes: 0 additions & 2 deletions drivers/staging/android/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ ccflags-y += -I$(src) # needed for trace events
obj-y += ion/
obj-$(CONFIG_FIQ_DEBUGGER) += fiq_debugger/

obj-$(CONFIG_ANDROID_BINDER_IPC) += binder.o binder_alloc.o
obj-$(CONFIG_ANDROID_BINDER_IPC_SELFTEST) += binder_alloc_selftest.o
obj-$(CONFIG_ASHMEM) += ashmem.o
obj-$(CONFIG_ANDROID_LOGGER) += logger.o
obj-$(CONFIG_ANDROID_TIMED_OUTPUT) += timed_output.o
Expand Down
1 change: 1 addition & 0 deletions include/uapi/linux/Kbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# UAPI Header export list
header-y += android/
header-y += byteorder/
header-y += can/
header-y += caif/
Expand Down
2 changes: 2 additions & 0 deletions include/uapi/linux/android/Kbuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# UAPI Header export list
header-y += binder.h
File renamed without changes.

0 comments on commit afd1da6

Please sign in to comment.