linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Steven Scholz <steven.scholz@imc-berlin.de>
To: LinuxPPC <linuxppc-embedded@lists.linuxppc.org>
Subject: uncached user space mapping with mmap() ???
Date: Thu, 04 Mar 2004 14:51:32 +0100	[thread overview]
Message-ID: <40473464.8010203@imc-berlin.de> (raw)


Hi there,

I am trying to access a hardware timer implemented in an FPGA from
user space. I implemented a simple mmap() functionality (taken from
Runbini's Linux Device Driver)

int simple_remap_mmap(struct file *filp, struct vm_area_struct *vma)
{
      unsigned long offset = vma->vm_pgoff << PAGE_SHIFT;

      if (offset >= __pa(high_memory) || (filp->f_flags & O_SYNC)) {
          vma->vm_flags |= VM_IO;
      }
      vma->vm_flags |= VM_RESERVED;

      if (remap_page_range(vma->vm_start, offset,
	vma->vm_end-vma->vm_start, vma->vm_page_prot))
	        return -EAGAIN;

      return 0;
}

I just learned that

 > getting an uncached user space mapping is architecture dependent.
 > On ARM, however, passing pgprot_noncached(vma->vm_page_prot) to
 > remap_page_range() will alter the page protections such that the
 > mapping will be uncached.

How could I do this on an MPC8xx?

Thanks a million!


--
Steven Scholz

imc Measurement & Control               imc Meßsysteme GmbH
Voltastr. 5                             Voltastr. 5
13355 Berlin                            13355 Berlin
Germany                                 Deutschland


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

             reply	other threads:[~2004-03-04 13:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-04 13:51 Steven Scholz [this message]
2004-03-04 17:00 ` uncached user space mapping with mmap() ??? Dan Malek
2004-03-05  8:18 ` Steven Scholz
2004-03-05 11:35   ` Jon Masters
2004-03-05 11:41     ` Steven Scholz
2004-03-05 13:21       ` Jon Masters
  -- strict thread matches above, loose matches on Subject: below --
2004-03-04 14:15 Fillod Stephane
2004-03-04 14:35 ` Steven Scholz
2004-03-04 17:28   ` Eugene Surovegin
2004-03-04 14:47 Fillod Stephane
2004-03-04 14:51 ` Steven Scholz
2004-03-04 23:02 Richard Williams
2004-03-04 23:17 ` Dan Malek
2004-03-08 10:25 Fillod Stephane
2004-03-09 10:55 ` Jon Masters
2004-03-09 12:49 Fillod Stephane
2004-03-12 12:07 ` Jon Masters

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=40473464.8010203@imc-berlin.de \
    --to=steven.scholz@imc-berlin.de \
    --cc=linuxppc-embedded@lists.linuxppc.org \
    /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;
as well as URLs for NNTP newsgroup(s).