lkml.org 
[lkml]   [2005]   [May]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Will __pa(vmalloc()) ever work?
Gerd Knorr wrote:

> You should use vmalloc_to_page() (this does the page-table walking
> with correct locking), then the usual dma mapping interface
> (pci_map_page() or pci_map_sg()) to get bus address(es) you can pass
> to your device for DMA.

My problem is that I don't know where the memory came from. It could have been allocated
via kmalloc, or vmalloc, or anywhere else. Can I call vmalloc_to_page() on memory
allocated via kmalloc()? If the answer is no, then how can I tell whether the memory was
allocated via vmalloc() or some other method? I need a reliable virtual-to-physical (or
virtual-to-bus, which is the same thing on x86 architectures) method for any memory address.

--
Timur Tabi
Staff Software Engineer
timur.tabi@ammasso.com

One thing a Southern boy will never say is,
"I don't think duct tape will fix it."
-- Ed Smylie, NASA engineer for Apollo 13
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-05-31 20:51    [W:0.062 / U:0.348 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site