remap_pfn_range() and mapping RAM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello everyone,

While developing a method for mapping RAM memory into user space
I stumbled across Suresh Siddha's commit that "broke" my code:

  commit be03d9e8022030c16abf534e33e185bfc3d40eef
  x86, pat: fix warn_on_once() while mapping 0-1MB range with /dev/mem

I believe there were important reasons for the changes but how do I map
user RAM memory into user space?  Up to this point I've used something
along the lines of (error checking removed):

#v+
static int file_mmap(struct file *file, struct vm_area_struct *vma)
{
	const size_t start  = /* physical address of memory allocated
	                         using alloc_bootmem_low_pages() */;

	return remap_pfn_range(vma, vma->vm_start,
	                       (start >> PAGE_SHIFT) + vma->vm_pgoff
	                       vma->vm_end - vma->vm_start,
	                       vma->vm_page_prot);
}
#v-

Reverting the be03... commit makes it work again but I guess it's not
a good way to solve this problem.

Could anyone point me to proper function which may be used like
remap_pfn_range() but work on RAM addresses?  It is important, that the
function will work in similar fashion, ie. create raw PFN mappings
without associated struct page.

-- 
Best regards,                                         _     _
 .o. | Liege of Serenly Enlightened Majesty of      o' \,=./ `o
 ..o | Computer Science,  Michal "mina86" Nazarewicz   (o o)
 ooo +--<mina86*tlen.pl>--<jid:mina86*jabber.org>--ooO--(_)--Ooo--

Attachment: pgp9qlWZxOLzB.pgp
Description: PGP signature


[Index of Archives]     [Audio]     [Hams]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Fedora Users]

  Powered by Linux