binder结构体

转载自:http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/drivers/staging/android/binder.c


 struct binder_node {
         int debug_id;
         struct binder_work work;
         union {
                 struct rb_node rb_node;
                 struct hlist_node dead_node;
         };
         struct binder_proc *proc;
         struct hlist_head refs;
         int internal_strong_refs;
         int local_weak_refs;
         int local_strong_refs;
         void __user *ptr;
         void __user *cookie;
         unsigned has_strong_ref:1;
         unsigned pending_strong_ref:1;
         unsigned has_weak_ref:1;
         unsigned pending_weak_ref:1;
         unsigned has_async_transaction:1;
         unsigned accept_fds:1;
         unsigned min_priority:8;
         struct list_head async_todo;
 };

struct binder_buffer {
         struct list_head entry; /* free and allocated entries by addesss */
         struct rb_node rb_node; /* free entry by size or allocated entry */
                                 /* by address */
         unsigned free:1;
         unsigned allow_user_free:1;
         unsigned async_transaction:1;
         unsigned debug_id:29;
 
         struct binder_transaction *transaction;
 
         struct binder_node *target_node;
         size_t data_size;
         size_t offsets_size;
         uint8_t data[0];
 };

struct binder_proc {
         struct hlist_node proc_node;
         struct rb_root threads;
         struct rb_root nodes;
         struct rb_root refs_by_desc;
         struct rb_root refs_by_node;
         int pid;
         struct vm_area_struct *vma;
         struct task_struct *tsk;
         struct files_struct *files;
         struct hlist_node deferred_work_node;
         int deferred_work;
         void *buffer;
         ptrdiff_t user_buffer_offset;
 
         struct list_head buffers;
         struct rb_root free_buffers;
         struct rb_root allocated_buffers;
         size_t free_async_space;
 
         struct page **pages;
         size_t buffer_size;
         uint32_t buffer_free;
         struct list_head todo;
         wait_queue_head_t wait;
         struct binder_stats stats;
         struct list_head delivered_death;
         int max_threads;
         int requested_threads;
         int requested_threads_started;
         int ready_threads;
         long default_priority;
 };


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值