Can't mmap the top 1MB of /dev/mem?

Mark S. Mathews mark at
Fri Jun 23 05:50:20 EST 2000

I figured it was something like that.  Shouldn't that expression be
testing the topmost address of the mmap'd region instead of one beyond it?


   if ( (off+len-1) < off )
	return EINVAL;

It works on the G3?  Perhaps the compiler/processor difference is getting
you into some of the 64-bit register goofiness or a slightly different
code sequence that does something different w/ the overflow flag.  Just
guessing here.


On Thu, 22 Jun 2000, Pavel Roskin wrote:

> Hello, Mark!
> > If it _were_ extremely  important I could always trace the mmap system
> > call.
> I already know that it happens in do_mmap(), at this point:
> /* offset overflow? */
> if (off + len < off)
>         return -EINVAL;
> I'm puzzled why it doesn't happen on G3.
> > _That's_ why Linux is so cool.
> Yup.
> Pavel

Mark S. Mathews

AbsoluteValue Systems      Web:
P.O. Box 941149            e-mail: mark at
Maitland, FL 32794-1149    Phone:  407.644.8582
USA                        Fax:    407.539.1294

** Sent via the linuxppc-embedded mail list. See

More information about the Linuxppc-embedded mailing list