First,to be honest,my doubt comes from the binder driver part in /
kernel/drivers/android/binder.c
// 1. register binder as a misc device
static int __init binder_init(void){
int ret;
...
ret = misc_register(&binder_miscdev);
...
}
// 2.declare fops as &binder_fops
static struct miscdevice binder_miscdev = {
.minor = MISC_DYNAMIC_MINOR,
.name = "binder",
.fops = &binder_fops
};
// 3.binder_fops is defined as follows
static struct file_operations binder_fops = {
.owner = THIS_MODULE,
.poll = binder_poll,
.unlocked_ioctl = binder_ioctl,
.mmap = binder_mmap,
.open = binder_open,
.flush = binder_flush,
.release = binder_release,
};
Then take a look at /framework/base/cmds/servicemanager/binder.c,there
are one place where runs ioctl and another place where runs mmap.
int binder_become_context_manager(struct binder_state *bs)
{
return ioctl(bs->fd, BINDER_SET_CONTEXT_MGR, 0);
}
struct binder_state *binder_open(unsigned mapsize)
{
struct binder_state *bs;
...
bs->mapped = mmap(NULL, mapsize, PROT_READ, MAP_PRIVATE, bs->fd,
0);
...
}
Since above,I am not sure the relationship between ioctl() and
binder_ioctl() defined in driver ,along with the relationship between
mmap() and binder_mmap() defined in driver,could someone help me to
make it clear,thanks.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en