]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - include/asm-arm/memory.h
Auto-update from upstream
[mv-sheeva.git] / include / asm-arm / memory.h
index bee10fcf7e836fa039a7ee1a1c302a3c19473fb9..3e572364ee73c665dbc2fd21a34e33d076e6363b 100644 (file)
 #error Top of user space clashes with start of module space
 #endif
 
+/*
+ * The XIP kernel gets mapped at the bottom of the module vm area.
+ * Since we use sections to map it, this macro replaces the physical address
+ * with its virtual address while keeping offset from the base section.
+ */
+#define XIP_VIRT_ADDR(physaddr)  (MODULE_START + ((physaddr) & 0x000fffff))
+
 #ifndef __ASSEMBLY__
 
 /*
@@ -115,6 +122,7 @@ static inline void *phys_to_virt(unsigned long x)
  */
 #define __pa(x)                        __virt_to_phys((unsigned long)(x))
 #define __va(x)                        ((void *)__phys_to_virt((unsigned long)(x)))
+#define pfn_to_kaddr(pfn)      __va((pfn) << PAGE_SHIFT)
 
 /*
  * Virtual <-> DMA view memory address translations