lkml.org 
[lkml]   [2011]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: How to create a kernel virtual mapping for physical addresses.
Date
On Saturday 09 April 2011 00:03:21 brace@beardog.cce.hp.com wrote:
> Given a physical address and a length (which may span contiguous pages), how
> does one go about creating a virtual mapping for that address? That address may
> be in high memory (above 4GB) in a 32bit system.
>
> ioremap() wants a 32bit physical address on 32bit systems. kmap() and
> kmap_atomic() wants a struct page which I am not sure how to get from a physical
> address.

Use kmap() on the page you get from pfn_to_page().

> If there already is a kernel mapping, then using the existing kernel mapping
> would be fine if I could figure out how to get it, but if there is not one,
> then I need to make one.
>
> I think setting the DMA mask to 32bit would mean that I do not have to deal
> with highmem addresses in my particular case, but I still do not know how to
> get a virtual address from a physical.

DMA mask is only about devices doing DMA to your data, not about the
kernel touching it.

Arnd


\
 
 \ /
  Last update: 2011-04-19 21:53    [W:0.057 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site