diff options
| author | Randy Dunlap <rddunlap@osdl.org> | 2005-03-28 04:01:12 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-03-28 04:01:12 -0800 |
| commit | 2fd200244636c19389ded891665d8abb8d96d440 (patch) | |
| tree | 88fc9e76513ec4aeacbac2a29d4ecb30a71eb15f /include/asm-sh64 | |
| parent | 58aceba09b4f67abd309d199de8f2da375f45e88 (diff) | |
[PATCH] io_remap_pfn_range: add for all arch-es
This patch introduces a new interface function for mapping bus/device memory:
io_remap_pfn_range. This accepts the same parameters as remap_pfn_range and
io_remap_page_range but should be used in any situation where the caller is
not simply remapping ordinary RAM. For example, when mapping device registers
the new function should be used.
The distinction between remapping device memory and ordinary RAM is critical
for the Xen hypervisor.
This patch series also cleans up the remaining users of io_remap_page_range
(in particular, the several sparc-specific sections in various drivers that
use a special form of io_remap_page_range: an extra <iospace> argument for
SPARC arch.) by converting them to use io_remap_pfn_range(), where
io_remap_pfn_range() supports passing <iospace> as part of the pfn argument.
The sparc32 & sparc64 code needs live testing.
(from Keir:)
I have audited the drivers/ and sound/ directories. Most uses of
remap_pfn_range are okay, but there are a small handful that are remapping
device memory (mostly AGP and DRM drivers).
Of particular driver is the HPET driver, whose mmap function is broken even
for native (non-Xen) builds. If nothing else, vmalloc_to_phys should be used
instead of __pa to convert an ioremapped virtual address to a valid physical
address. The fix in this patch is to remember the original bus address as
probed at boot time and to pass this to io_remap_pfn_range.
io_remap_pfn_range():
add io_remap_pfn_range() for all arches;
add MK_IOSPACE_PFN(), GET_IOSPACE(), and GET_PFN()
for all arches but primarily for sparc32/64's extended IO space,
sparc: kill the hack of using low bit of <offset> to mean
write_combine or set side-effect (_PAGE_E) bit;
(DaveM suggested that I kill it;)
future: convert remaining callers of io_remap_page_range() to
io_remap_pfn_range() and deprecate io_remap_page_range();
Signed-off-by: Randy Dunlap <rddunlap@osdl.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-sh64')
| -rw-r--r-- | include/asm-sh64/pgtable.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/asm-sh64/pgtable.h b/include/asm-sh64/pgtable.h index 8157a2a727cc..45f70c0f4a5e 100644 --- a/include/asm-sh64/pgtable.h +++ b/include/asm-sh64/pgtable.h @@ -482,6 +482,14 @@ extern void update_mmu_cache(struct vm_area_struct * vma, #define io_remap_page_range(vma, vaddr, paddr, size, prot) \ remap_pfn_range(vma, vaddr, (paddr) >> PAGE_SHIFT, size, prot) + +#define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ + remap_pfn_range(vma, vaddr, pfn, size, prot) + +#define MK_IOSPACE_PFN(space, pfn) (pfn) +#define GET_IOSPACE(pfn) 0 +#define GET_PFN(pfn) (pfn) + #endif /* !__ASSEMBLY__ */ /* |
