public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bill Davidsen <davidsen@tmr.com>
To: mark slutz <mystuff.mark@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: mmap going to wrong physical address
Date: Thu, 04 Nov 2004 16:38:53 -0500	[thread overview]
Message-ID: <418AA16D.40002@tmr.com> (raw)
In-Reply-To: <6707bb6404110313514013794e@mail.gmail.com>

mark slutz wrote:
> 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

I'm not sure it will help, but have you tried the MAP_FIXED option, and 
is your address which doesn't work a multiple of the page size?

-- 
    -bill davidsen (davidsen@tmr.com)
"The secret to procrastination is to put things off until the
  last possible moment - but no longer"  -me


      reply	other threads:[~2004-11-05 15:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-03 21:51 mmap going to wrong physical address mark slutz
2004-11-04 21:38 ` Bill Davidsen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=418AA16D.40002@tmr.com \
    --to=davidsen@tmr.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mystuff.mark@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox