blob: 12ef96f256c68e30763e53754f5305b47d2f6e6c [file] [log] [blame]
Christian Brauner3ad20fe2018-12-14 13:11:14 +01001/* SPDX-License-Identifier: GPL-2.0 */
2
3#ifndef _LINUX_BINDER_INTERNAL_H
4#define _LINUX_BINDER_INTERNAL_H
5
6#include <linux/export.h>
7#include <linux/fs.h>
8#include <linux/list.h>
9#include <linux/miscdevice.h>
10#include <linux/mutex.h>
11#include <linux/stddef.h>
12#include <linux/types.h>
13#include <linux/uidgid.h>
14
15struct binder_context {
16 struct binder_node *binder_context_mgr_node;
17 struct mutex context_mgr_node_lock;
18 kuid_t binder_context_mgr_uid;
19 const char *name;
20};
21
22/**
23 * struct binder_device - information about a binder device node
24 * @hlist: list of binder devices (only used for devices requested via
25 * CONFIG_ANDROID_BINDER_DEVICES)
26 * @miscdev: information about a binder character device node
27 * @context: binder context information
28 * @binderfs_inode: This is the inode of the root dentry of the super block
29 * belonging to a binderfs mount.
30 */
31struct binder_device {
32 struct hlist_node hlist;
33 struct miscdevice miscdev;
34 struct binder_context context;
35 struct inode *binderfs_inode;
36};
37
38extern const struct file_operations binder_fops;
39
Hridya Valsarajuca2864c2019-09-04 13:07:03 +020040extern char *binder_devices_param;
41
Christian Brauner3ad20fe2018-12-14 13:11:14 +010042#ifdef CONFIG_ANDROID_BINDERFS
43extern bool is_binderfs_device(const struct inode *inode);
44#else
45static inline bool is_binderfs_device(const struct inode *inode)
46{
47 return false;
48}
49#endif
50
Christian Brauner5b9633a2019-01-31 01:25:02 +010051#ifdef CONFIG_ANDROID_BINDERFS
52extern int __init init_binderfs(void);
53#else
54static inline int __init init_binderfs(void)
55{
56 return 0;
57}
58#endif
59
Hridya Valsaraju0e13e452019-09-03 09:16:53 -070060int binder_stats_show(struct seq_file *m, void *unused);
61DEFINE_SHOW_ATTRIBUTE(binder_stats);
62
63int binder_state_show(struct seq_file *m, void *unused);
64DEFINE_SHOW_ATTRIBUTE(binder_state);
65
66int binder_transactions_show(struct seq_file *m, void *unused);
67DEFINE_SHOW_ATTRIBUTE(binder_transactions);
Christian Brauner3ad20fe2018-12-14 13:11:14 +010068#endif /* _LINUX_BINDER_INTERNAL_H */