lkml.org 
[lkml]   [2001]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mmap + wrapping around to 0
I have a fix for this problem. In the file
include/linux/mm.h
in the inline function do_mmap(), change
if ((offset + PAGE_ALIGN(len)) < offset)
to
if ((offset + PAGE_ALIGN(len)-1) < offset)

-Dave

On Wed, 7 Nov 2001, Dave Ashley wrote:

> I'm using linux on an embedded system based on the 2.4.2 kernel. There
> is a flash rom at physical address FFE00000 of 2 megabytes size. I have
> a flash utility that uses mmap() on /dev/mem, but I can't call it with
> offset 0xffe00000, size 0x00200000, I must call it with size
> 0x001ff000 (1 page size less than the real size). I figure this is because
> the end address has wrapped around to 0 and this messes up the system.
>
> This should work, the memory is there. But I can't access that last page.
>
> BTW the cpu is a ppc 8260 (603e core).
>
> -Dave
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

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