I am trying to use mmap
to map a uio device for user-space usage.
This is what I use in my code:
if (map == MAP_FAILED) {
perror("mmap");
close(fd);
return -1;
}
fd is dev/uio0
device
In the address value, I use NULL, which, to the best of my knowledge lets the kernel find the right address according to the device opened.
It fails, and the map pointer value is 0xffffffff
.
I hope yuo guys can help me figure out what’s wrong with my implementation. I’d add more details if necessary.