Access physical address on application layer

来源:互联网 发布:淘宝宝贝推荐排序 编辑:程序博客网 时间:2024/05/25 19:58
void * get_io_base(unsigned int address, unsigned int size){    fd = open("/dev/mem", O_RDWR | O_SYNC);      if (fd < 0 )             return NULL;    phy_base =(void *) address;    map_base = mmap(0, size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, address);       return  map_base;}
1 0
原创粉丝点击