simple mmap problem on at91sam9263
Harald Krammer
Harald.Krammer at hkr.at
Wed Oct 10 19:43:44 UTC 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Phillip Liang schrieb:
> Hi,
> I am trying GPIO on at91sam9263 with 2.6.21.1 Kernel using uclibc 0.9.29.
> The simple mmap always return -1. errno = 22, EINVAL.
> How do I debug the problem?
> thanks.
>
> #define MAP_SIZE 4096UL
> #define MAP_MASK (MAP_SIZE - 1)
> #define AT91_SYS 0xFFFFE000
>
>
> map_base = mmap(0, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, AT91_SYS & ~MAP_MASK);
>
> the same error from :
> map_base = mmap(0, getpagesize(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0xffffe000);
>
Hello,
fd is created like this ?
if( (fd = open("/dev/mem", O_RDWR | O_SYNC)) == -1)
....
There was a bug in mmap in 0.9.29 (patch
uClibc-0.9.29-001-fix-mmap.patch should fix it )
http://www.uclibc.org/cgi-bin/viewcvs.cgi/trunk/buildroot/toolchain/uClibc/uClibc-0.9.29-001-fix-mmap.patch
You can try 0.9.28.3 or latest version...
Nice greetings,
Harald
- --
Harald Krammer
Brucknerstrasse 33
A - 4020 Linz
AUSTRIA
Mobil +43.(0) 664. 130 59 58
Mail: Harald.Krammer (at) hkr.at
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFHDStu9QlAsubHO9sRAoIxAJoCfvC6EyYTqIoMyRxjwb51smO3sQCgjLqM
V7DI3rNGGZBKu4o7JySv25E=
=2ra9
-----END PGP SIGNATURE-----
More information about the uClibc
mailing list