lkml.org 
[lkml]   [2001]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [OT] Wrapping memory.
Date

alan@lxorguk.ukuu.org.uk said:
> > I would like to have a 64 KBarray (of char), that's trivial, however
> > what I would like is for the last 4 KB [yes thankfully this is exactly
> > one page... (assume i386)] to reference the same physical memory as the
> > first four.

> mmap will do what you need. Create a 60K object on disk and mmap it at
> the base address and then 60K further on for 4K.

You said 'assume i386', but just to make it clear - this is likely to break
horribly on some non-i386 platforms, due to dcache aliasing. You may find
that the second mmap(MAP_FIXED) fails, or if it succeeds then changes made
with one virtual address won't be instantly visible through the other
mapping. About the best case on such hardware is that Linux will just map
the offending page uncached.

--
dwmw2


-
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.102 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site