From 9d4ae7276ae26c5bfba6207cf05340af1931d8d4 Mon Sep 17 00:00:00 2001 From: Deepak Saxena Date: Mon, 9 Jan 2006 19:23:11 +0000 Subject: [ARM] 3070/2: Add __ioremap_pfn() API Patch from Deepak Saxena In working on adding 36-bit addressed supersection support to ioremap(), I came to the conclusion that it would be far simpler to do so by just splitting __ioremap() into a main external interface and adding an __ioremap_pfn() function that takes a pfn + offset into the page that __ioremap() can call. This way existing callers of __ioremap() won't have to change their code and 36-bit systems will just call __ioremap_pfn() and we will not have to deal with unsigned long long variables. Note that __ioremap_pfn() should _NOT_ be called directly by drivers but is reserved for use by arch_ioremap() implementations that map 32-bit resource regions into the real 36-bit address and then call this new function. Signed-off-by: Deepak Saxena Signed-off-by: Russell King --- include/asm-arm/memory.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/asm-arm/memory.h') diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h index 3e572364ee73..3d7f08bd9030 100644 --- a/include/asm-arm/memory.h +++ b/include/asm-arm/memory.h @@ -57,6 +57,12 @@ #define __phys_to_virt(x) ((x) - PHYS_OFFSET + PAGE_OFFSET) #endif +/* + * Convert a physical address to a Page Frame Number and back + */ +#define __phys_to_pfn(paddr) ((paddr) >> PAGE_SHIFT) +#define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT) + /* * The module space lives between the addresses given by TASK_SIZE * and PAGE_OFFSET - it must be within 32MB of the kernel text. -- cgit v1.2.2