Re: mmap /dev/mem on AT91SAM9260

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Russell King - ARM Linux
Date:  
To: Zolnierczuk, Piotr, linux-arm-kernel
Subject: Re: mmap /dev/mem on AT91SAM9260
On Tue, Mar 06, 2007 at 04:02:21PM +0000, Russell King - ARM Linux wrote:
> On Tue, Mar 06, 2007 at 10:11:35AM -0500, Zolnierczuk, Piotr wrote:
> > I think the problem is in uClibc and not in the kernel
> > Here's are revealing portion of uClibc/libc/sysdeps/linux/arm/mmap.c:
> > #if defined __ARM_EABI__
> > #define __NR__mmap __NR_mmap2
> > #else
> > #define __NR__mmap __NR_mmap
> > #endif
>
> That's just utterly dumb, utterly idiotic and plain old damned right
> stupid. The two syscalls have completely different argument formats,
> so you can't write a common set of code for both and just change the
> syscall number.


Yes, looking at:

http://www.uclibc.org/cgi-bin/viewcvs.cgi/trunk/uClibc/libc/sysdeps/linux/arm/mmap.c?rev=16341&view=markup

the code is total and utter bullshit. It definitely falls into the
category of "lets blindly write code without any reference to what is
actually required" and "test? what's that? you must be mad, I don't
test the code I write!"

Grr.