Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca280cea authored by Arne Coucheron's avatar Arne Coucheron Committed by TARKZiM
Browse files

binder: Modifications for building with 3.10 kernel

Change-Id: I0f5a3190457bcca5c7824c8d53b3c40c712e3fea
parent 8b77bb9f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ config ANDROID_BINDER_IPC
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
	default n
	---help---
	  The Binder API has been changed to support both 32 and 64bit
	  applications in a mixed environment.
+23 −16
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@
#include <linux/pid_namespace.h>
#include <linux/security.h>
#include <linux/spinlock.h>
#include <linux/uidgid.h>

#include "binder.h"
#include "binder_alloc.h"
@@ -672,7 +673,7 @@ struct binder_transaction {
 * structures associated with the given proc.
 */
#define binder_proc_lock(proc) _binder_proc_lock(proc, __LINE__)
static void
static void __attribute__((__unused__))
_binder_proc_lock(struct binder_proc *proc, int line)
{
	binder_debug(BINDER_DEBUG_SPINLOCKS,
@@ -687,7 +688,7 @@ _binder_proc_lock(struct binder_proc *proc, int line)
 * Release lock acquired via binder_proc_lock()
 */
#define binder_proc_unlock(_proc) _binder_proc_unlock(_proc, __LINE__)
static void
static void __attribute__((__unused__))
_binder_proc_unlock(struct binder_proc *proc, int line)
{
	binder_debug(BINDER_DEBUG_SPINLOCKS,
@@ -702,7 +703,7 @@ _binder_proc_unlock(struct binder_proc *proc, int line)
 * Acquires proc->inner_lock. Used to protect todo lists
 */
#define binder_inner_proc_lock(proc) _binder_inner_proc_lock(proc, __LINE__)
static void
static void __attribute__((__unused__))
_binder_inner_proc_lock(struct binder_proc *proc, int line)
{
	binder_debug(BINDER_DEBUG_SPINLOCKS,
@@ -717,7 +718,7 @@ _binder_inner_proc_lock(struct binder_proc *proc, int line)
 * Release lock acquired via binder_inner_proc_lock()
 */
#define binder_inner_proc_unlock(proc) _binder_inner_proc_unlock(proc, __LINE__)
static void
static void __attribute__((__unused__))
_binder_inner_proc_unlock(struct binder_proc *proc, int line)
{
	binder_debug(BINDER_DEBUG_SPINLOCKS,
@@ -732,7 +733,7 @@ _binder_inner_proc_unlock(struct binder_proc *proc, int line)
 * Acquires node->lock. Used to protect binder_node fields
 */
#define binder_node_lock(node) _binder_node_lock(node, __LINE__)
static void
static void __attribute__((__unused__))
_binder_node_lock(struct binder_node *node, int line)
{
	binder_debug(BINDER_DEBUG_SPINLOCKS,
@@ -747,7 +748,7 @@ _binder_node_lock(struct binder_node *node, int line)
 * Release lock acquired via binder_node_lock()
 */
#define binder_node_unlock(node) _binder_node_unlock(node, __LINE__)
static void
static void __attribute__((__unused__))
_binder_node_unlock(struct binder_node *node, int line)
{
	binder_debug(BINDER_DEBUG_SPINLOCKS,
@@ -5134,6 +5135,7 @@ static int binder_release(struct inode *nodp, struct file *filp)
static int binder_node_release(struct binder_node *node, int refs)
{
	struct binder_ref *ref;
	struct hlist_node *pos;
	int death = 0;
	struct binder_proc *proc = node->proc;

@@ -5163,7 +5165,7 @@ static int binder_node_release(struct binder_node *node, int refs)
	hlist_add_head(&node->dead_node, &binder_dead_nodes);
	spin_unlock(&binder_dead_nodes_lock);

	hlist_for_each_entry(ref, &node->refs, node_entry) {
	hlist_for_each_entry(ref, pos, &node->refs, node_entry) {
		refs++;
		/*
		 * Need the node lock to synchronize
@@ -5467,10 +5469,11 @@ static void print_binder_node_nilocked(struct seq_file *m,
{
	struct binder_ref *ref;
	struct binder_work *w;
	struct hlist_node *pos;
	int count;

	count = 0;
	hlist_for_each_entry(ref, &node->refs, node_entry)
	hlist_for_each_entry(ref, pos, &node->refs, node_entry)
		count++;

	seq_printf(m, "  node %d: u%016llx c%016llx pri %d:%d hs %d hw %d ls %d lw %d is %d iw %d tr %d",
@@ -5481,7 +5484,7 @@ static void print_binder_node_nilocked(struct seq_file *m,
		   node->internal_strong_refs, count, node->tmp_refs);
	if (count) {
		seq_puts(m, " proc");
		hlist_for_each_entry(ref, &node->refs, node_entry)
		hlist_for_each_entry(ref, pos, &node->refs, node_entry)
			seq_printf(m, " %d", ref->proc->pid);
	}
	seq_puts(m, "\n");
@@ -5734,13 +5737,14 @@ static int binder_state_show(struct seq_file *m, void *unused)
	struct binder_proc *proc;
	struct binder_node *node;
	struct binder_node *last_node = NULL;
	struct hlist_node *pos;

	seq_puts(m, "binder state:\n");

	spin_lock(&binder_dead_nodes_lock);
	if (!hlist_empty(&binder_dead_nodes))
		seq_puts(m, "dead nodes:\n");
	hlist_for_each_entry(node, &binder_dead_nodes, dead_node) {
	hlist_for_each_entry(node, pos, &binder_dead_nodes, dead_node) {
		/*
		 * take a temporary reference on the node so it
		 * survives and isn't removed from the list
@@ -5761,7 +5765,7 @@ static int binder_state_show(struct seq_file *m, void *unused)
		binder_put_node(last_node);

	mutex_lock(&binder_procs_lock);
	hlist_for_each_entry(proc, &binder_procs, proc_node)
	hlist_for_each_entry(proc, pos, &binder_procs, proc_node)
		print_binder_proc(m, proc, 1);
	mutex_unlock(&binder_procs_lock);

@@ -5771,13 +5775,14 @@ static int binder_state_show(struct seq_file *m, void *unused)
static int binder_stats_show(struct seq_file *m, void *unused)
{
	struct binder_proc *proc;
	struct hlist_node *pos;

	seq_puts(m, "binder stats:\n");

	print_binder_stats(m, "", &binder_stats);

	mutex_lock(&binder_procs_lock);
	hlist_for_each_entry(proc, &binder_procs, proc_node)
	hlist_for_each_entry(proc, pos, &binder_procs, proc_node)
		print_binder_proc_stats(m, proc);
	mutex_unlock(&binder_procs_lock);

@@ -5787,10 +5792,11 @@ static int binder_stats_show(struct seq_file *m, void *unused)
static int binder_transactions_show(struct seq_file *m, void *unused)
{
	struct binder_proc *proc;
	struct hlist_node *pos;

	seq_puts(m, "binder transactions:\n");
	mutex_lock(&binder_procs_lock);
	hlist_for_each_entry(proc, &binder_procs, proc_node)
	hlist_for_each_entry(proc, pos, &binder_procs, proc_node)
		print_binder_proc(m, proc, 0);
	mutex_unlock(&binder_procs_lock);

@@ -5800,10 +5806,11 @@ static int binder_transactions_show(struct seq_file *m, void *unused)
static int binder_proc_show(struct seq_file *m, void *unused)
{
	struct binder_proc *itr;
	struct hlist_node *pos;
	int pid = (unsigned long)m->private;

	mutex_lock(&binder_procs_lock);
	hlist_for_each_entry(itr, &binder_procs, proc_node) {
	hlist_for_each_entry(itr, pos, &binder_procs, proc_node) {
		if (itr->pid == pid) {
			seq_puts(m, "binder proc state:\n");
			print_binder_proc(m, itr, 1);
@@ -5910,7 +5917,7 @@ static int __init binder_init(void)
	int ret;
	char *device_name, *device_names;
	struct binder_device *device;
	struct hlist_node *tmp;
	struct hlist_node *node, *tmp;

	binder_alloc_shrinker_init();

@@ -5973,7 +5980,7 @@ static int __init binder_init(void)
	return ret;

err_init_binder_device_failed:
	hlist_for_each_entry_safe(device, tmp, &binder_devices, hlist) {
	hlist_for_each_entry_safe(device, node, tmp, &binder_devices, hlist) {
		misc_deregister(&device->miscdev);
		hlist_del(&device->hlist);
		kfree(device);
+1 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <asm/cacheflush.h>
#include <linux/err.h>
#include <linux/list.h>
#include <linux/mm.h>
#include <linux/module.h>