]> git.karo-electronics.de Git - linux-beck.git/blobdiff - arch/arm/include/asm/memory.h
Merge branch 'pending-dma-streaming' (early part) into devel
[linux-beck.git] / arch / arm / include / asm / memory.h
index bc2ff8b281335d8d021586318f6fd7f7b63aaffe..5421d82a2572475667189fd1e93e07e19359de25 100644 (file)
 #define        __phys_to_pfn(paddr)    ((paddr) >> PAGE_SHIFT)
 #define        __pfn_to_phys(pfn)      ((pfn) << PAGE_SHIFT)
 
+/*
+ * Convert a page to/from a physical address
+ */
+#define page_to_phys(page)     (__pfn_to_phys(page_to_pfn(page)))
+#define phys_to_page(phys)     (pfn_to_page(__phys_to_pfn(phys)))
+
 #ifndef __ASSEMBLY__
 
 /*
@@ -196,7 +202,8 @@ static inline void *phys_to_virt(unsigned long x)
 #ifndef __virt_to_bus
 #define __virt_to_bus  __virt_to_phys
 #define __bus_to_virt  __phys_to_virt
-#define __pfn_to_bus(x)        ((x) << PAGE_SHIFT)
+#define __pfn_to_bus(x)        __pfn_to_phys(x)
+#define __bus_to_pfn(x)        __phys_to_pfn(x)
 #endif
 
 static inline __deprecated unsigned long virt_to_bus(void *x)
@@ -294,11 +301,6 @@ static inline __deprecated void *bus_to_virt(unsigned long x)
 
 #endif /* !CONFIG_DISCONTIGMEM */
 
-/*
- * For BIO.  "will die".  Kill me when bio_to_phys() and bvec_to_phys() die.
- */
-#define page_to_phys(page)     (page_to_pfn(page) << PAGE_SHIFT)
-
 /*
  * Optional coherency support.  Currently used only by selected
  * Intel XSC3-based systems.