public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* mmap going to wrong physical address
@ 2004-11-03 21:51 mark slutz
  2004-11-04 21:38 ` Bill Davidsen
  0 siblings, 1 reply; 2+ messages in thread
From: mark slutz @ 2004-11-03 21:51 UTC (permalink / raw)
  To: linux-kernel

I am writting an application that needs control over large (1gig+)
portions of contiguous memory. I am currently doing this by using
mem=1024m during boot. My system is a dual opteron with 5 gig of
memory. In my program I have

if ((fd=open("/dev/mem", O_RDWR))<0)
{
perror("open");
exit(-1);
}


PtrMemoryBase = (void *) mmap64(
NULL,
size,
PROT_READ | PROT_WRITE,
MAP_FILE | MAP_SHARED,
fd,
base );

size = 1MB

I also have -D_FILE_OFFSET_BITS=64.

If base is between 1 and 3 gig the process works fine. When base is 4
gig + the mmap64 works but the memory does not seem to be mapped to
the base location. I write a pattern to PtrMemoryBase then have my
hardware start doing DMA transfers from the base address but I do not
get the data I wrote to PtrMemoryBase.

Thanks for any help
Mark

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-11-05 15:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-03 21:51 mmap going to wrong physical address mark slutz
2004-11-04 21:38 ` Bill Davidsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox