All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Williams <steve@icarus.com>
To: linuxppc-embedded@ozlabs.org
Subject: mmap nocache on PPC, 2.4
Date: Mon, 22 Aug 2005 07:35:24 -0700	[thread overview]
Message-ID: <4309E2AC.9080404@icarus.com> (raw)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


In an embedded system, I want a big chunk of virtual memory in the
user process to be uncached. I've created a virtual device driver that
has this mmap method:

static int heap_mmap(struct file*filp, struct vm_area_struct*vma)
{
	/* Mark this whole region uncached. The setup of this
	   additional flag, and the VM_RESERVED, are the whole point
	   of this module. This hopefully will cause all pages mapped
	   into this vma to be uncached. */
~      pgprot_val(vma->vm_page_prot) |= _PAGE_NO_CACHE;
~      vma->vm_flags |= VM_RESERVED;

~      vma->vm_ops = &heap_vm_ops;
~      heap_vm_open(vma);
~      return 0;
}

I then allocate in the nopage from get_free_page as usual. My
question is, "Is this doing what I think it is doing?"

- --
Steve Williams                "The woods are lovely, dark and deep.
steve at icarus.com           But I have promises to keep,
http://www.icarus.com         and lines to code before I sleep,
http://www.picturel.com       And lines to code before I sleep."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFDCeKrrPt1Sc2b3ikRAlsVAKDD6+O4ihBYkHreyqkNcQuuvKIK8wCg4b6v
jRBU8FJrOyczJJdPkicf22s=
=zMkX
-----END PGP SIGNATURE-----

             reply	other threads:[~2005-08-22 14:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-22 14:35 Stephen Williams [this message]
2005-08-22 17:09 ` mmap nocache on PPC, 2.4 Dan Malek
2005-08-22 17:26   ` Stephen Williams
2005-08-22 17:47     ` Stephen Williams

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=4309E2AC.9080404@icarus.com \
    --to=steve@icarus.com \
    --cc=linuxppc-embedded@ozlabs.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.