lkml.org 
[lkml]   [1999]   [Nov]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: help can not mmap fffff000 - ffffffff using /dev/mem
david wrote:
>
> the bios is at this add and i need to read it
> but all i get from
> Base = 0xfffff000 ; size = 0x00001000 ;
> mem = mmap( NULL , size , PROT_READ | PROT_WRITE , MAP_SHARED , memfile
> , Base ) ;
> is errno = 22 Invalid argument
> thank you

If you look at do_mmap in mm/mmap.c you can see that your parameters
cause an overflow:

[...]
/* offset overflow? */
if (off + len < off)
return -EINVAL;
[...]

And it wouldn't even help you to change the size argument since the size
gets aligned to a page-size (0x1000) first:
[...]
if ((len = PAGE_ALIGN(len)) == 0)
return addr;
[...]

Maybe you try to change the expression above to:

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

Christian

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [W:0.070 / U:0.432 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site