Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
binder.c File Reference
#include <asm/cacheflush.h>
#include <linux/fdtable.h>
#include <linux/file.h>
#include <linux/fs.h>
#include <linux/list.h>
#include <linux/miscdevice.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/nsproxy.h>
#include <linux/poll.h>
#include <linux/debugfs.h>
#include <linux/rbtree.h>
#include <linux/sched.h>
#include <linux/seq_file.h>
#include <linux/uaccess.h>
#include <linux/vmalloc.h>
#include <linux/slab.h>
#include "binder.h"

Go to the source code of this file.

Data Structures

struct  binder_stats
 
struct  binder_transaction_log_entry
 
struct  binder_transaction_log
 
struct  binder_work
 
struct  binder_node
 
struct  binder_ref_death
 
struct  binder_ref
 
struct  binder_buffer
 
struct  binder_proc
 
struct  binder_thread
 
struct  binder_transaction
 

Macros

#define BINDER_DEBUG_ENTRY(name)
 
#define SZ_1K   0x400
 
#define SZ_4M   0x400000
 
#define FORBIDDEN_MMAP_FLAGS   (VM_WRITE)
 
#define BINDER_SMALL_BUF_SIZE   (PAGE_SIZE * 64)
 
#define binder_debug(mask, x...)
 
#define binder_user_error(x...)
 

Enumerations

enum  {
  BINDER_DEBUG_USER_ERROR = 1U << 0, BINDER_DEBUG_FAILED_TRANSACTION = 1U << 1, BINDER_DEBUG_DEAD_TRANSACTION = 1U << 2, BINDER_DEBUG_OPEN_CLOSE = 1U << 3,
  BINDER_DEBUG_DEAD_BINDER = 1U << 4, BINDER_DEBUG_DEATH_NOTIFICATION = 1U << 5, BINDER_DEBUG_READ_WRITE = 1U << 6, BINDER_DEBUG_USER_REFS = 1U << 7,
  BINDER_DEBUG_THREADS = 1U << 8, BINDER_DEBUG_TRANSACTION = 1U << 9, BINDER_DEBUG_TRANSACTION_COMPLETE = 1U << 10, BINDER_DEBUG_FREE_BUFFER = 1U << 11,
  BINDER_DEBUG_INTERNAL_REFS = 1U << 12, BINDER_DEBUG_BUFFER_ALLOC = 1U << 13, BINDER_DEBUG_PRIORITY_CAP = 1U << 14, BINDER_DEBUG_BUFFER_ALLOC_ASYNC = 1U << 15
}
 
enum  binder_stat_types {
  BINDER_STAT_PROC, BINDER_STAT_THREAD, BINDER_STAT_NODE, BINDER_STAT_REF,
  BINDER_STAT_DEATH, BINDER_STAT_TRANSACTION, BINDER_STAT_TRANSACTION_COMPLETE, BINDER_STAT_COUNT
}
 
enum  binder_deferred_state { BINDER_DEFERRED_PUT_FILES = 0x01, BINDER_DEFERRED_FLUSH = 0x02, BINDER_DEFERRED_RELEASE = 0x04 }
 
enum  {
  BINDER_LOOPER_STATE_REGISTERED = 0x01, BINDER_LOOPER_STATE_ENTERED = 0x02, BINDER_LOOPER_STATE_EXITED = 0x04, BINDER_LOOPER_STATE_INVALID = 0x08,
  BINDER_LOOPER_STATE_WAITING = 0x10, BINDER_LOOPER_STATE_NEED_RETURN = 0x20
}
 

Functions

 BINDER_DEBUG_ENTRY (proc)
 
 module_param_named (debug_mask, binder_debug_mask, uint, S_IWUSR|S_IRUGO)
 
 module_param_named (proc_no_lock, binder_debug_no_lock, bool, S_IWUSR|S_IRUGO)
 
 module_param_call (stop_on_user_error, binder_set_stop_on_user_error, param_get_int,&binder_stop_on_user_error, S_IWUSR|S_IRUGO)
 
int binder_thread_write (struct binder_proc *proc, struct binder_thread *thread, void __user *buffer, int size, signed long *consumed)
 
void binder_stat_br (struct binder_proc *proc, struct binder_thread *thread, uint32_t cmd)
 
 BINDER_DEBUG_ENTRY (state)
 
 BINDER_DEBUG_ENTRY (stats)
 
 BINDER_DEBUG_ENTRY (transactions)
 
 BINDER_DEBUG_ENTRY (transaction_log)
 
 device_initcall (binder_init)
 
 MODULE_LICENSE ("GPL v2")
 

Macro Definition Documentation

#define binder_debug (   mask,
  x... 
)
Value:
do { \
if (binder_debug_mask & mask) \
pr_info(x); \
} while (0)

Definition at line 124 of file binder.c.

#define BINDER_DEBUG_ENTRY (   name)
Value:
static int binder_##name##_open(struct inode *inode, struct file *file) \
{ \
return single_open(file, binder_##name##_show, inode->i_private); \
} \
\
static const struct file_operations binder_##name##_fops = { \
.owner = THIS_MODULE, \
.open = binder_##name##_open, \
.read = seq_read, \
.llseek = seq_lseek, \
.release = single_release, \
}

Definition at line 54 of file binder.c.

#define BINDER_SMALL_BUF_SIZE   (PAGE_SIZE * 64)

Definition at line 82 of file binder.c.

#define binder_user_error (   x...)
Value:
do { \
if (binder_debug_mask & BINDER_DEBUG_USER_ERROR) \
pr_info(x); \
if (binder_stop_on_user_error) \
binder_stop_on_user_error = 2; \
} while (0)

Definition at line 130 of file binder.c.

#define FORBIDDEN_MMAP_FLAGS   (VM_WRITE)

Definition at line 80 of file binder.c.

#define SZ_1K   0x400

Definition at line 73 of file binder.c.

#define SZ_4M   0x400000

Definition at line 77 of file binder.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
BINDER_DEBUG_USER_ERROR 
BINDER_DEBUG_FAILED_TRANSACTION 
BINDER_DEBUG_DEAD_TRANSACTION 
BINDER_DEBUG_OPEN_CLOSE 
BINDER_DEBUG_DEAD_BINDER 
BINDER_DEBUG_DEATH_NOTIFICATION 
BINDER_DEBUG_READ_WRITE 
BINDER_DEBUG_USER_REFS 
BINDER_DEBUG_THREADS 
BINDER_DEBUG_TRANSACTION 
BINDER_DEBUG_TRANSACTION_COMPLETE 
BINDER_DEBUG_FREE_BUFFER 
BINDER_DEBUG_INTERNAL_REFS 
BINDER_DEBUG_BUFFER_ALLOC 
BINDER_DEBUG_PRIORITY_CAP 
BINDER_DEBUG_BUFFER_ALLOC_ASYNC 

Definition at line 84 of file binder.c.

anonymous enum
Enumerator:
BINDER_LOOPER_STATE_REGISTERED 
BINDER_LOOPER_STATE_ENTERED 
BINDER_LOOPER_STATE_EXITED 
BINDER_LOOPER_STATE_INVALID 
BINDER_LOOPER_STATE_WAITING 
BINDER_LOOPER_STATE_NEED_RETURN 

Definition at line 319 of file binder.c.

Enumerator:
BINDER_DEFERRED_PUT_FILES 
BINDER_DEFERRED_FLUSH 
BINDER_DEFERRED_RELEASE 

Definition at line 277 of file binder.c.

Enumerator:
BINDER_STAT_PROC 
BINDER_STAT_THREAD 
BINDER_STAT_NODE 
BINDER_STAT_REF 
BINDER_STAT_DEATH 
BINDER_STAT_TRANSACTION 
BINDER_STAT_TRANSACTION_COMPLETE 
BINDER_STAT_COUNT 

Definition at line 138 of file binder.c.

Function Documentation

BINDER_DEBUG_ENTRY ( proc  )
BINDER_DEBUG_ENTRY ( state  )
BINDER_DEBUG_ENTRY ( stats  )
BINDER_DEBUG_ENTRY ( transactions  )
BINDER_DEBUG_ENTRY ( transaction_log  )
void binder_stat_br ( struct binder_proc proc,
struct binder_thread thread,
uint32_t  cmd 
)

Definition at line 2089 of file binder.c.

int binder_thread_write ( struct binder_proc proc,
struct binder_thread thread,
void __user buffer,
int  size,
signed long consumed 
)

Definition at line 1704 of file binder.c.

device_initcall ( binder_init  )
MODULE_LICENSE ( "GPL v2 )
module_param_call ( stop_on_user_error  ,
binder_set_stop_on_user_error  ,
param_get_int  ,
binder_stop_on_user_error,
S_IWUSR S_IRUGO 
)
module_param_named ( debug_mask  ,
binder_debug_mask  ,
uint  ,
S_IWUSR S_IRUGO 
)
module_param_named ( proc_no_lock  ,
binder_debug_no_lock  ,
bool  ,
S_IWUSR S_IRUGO 
)