Merge branch 'x86/urgent' into core/efi, to pick up a pending EFI fix
[linux-2.6-block.git] / arch / arm64 / include / asm / memory.h
index 4112b3d7468e061e71198ab5f6f3f489fe293fd1..67027c611dbd51e66b72492943394ff317c3998a 100644 (file)
 #define __virt_to_phys(x)      (((phys_addr_t)(x) - PAGE_OFFSET + PHYS_OFFSET))
 #define __phys_to_virt(x)      ((unsigned long)((x) - PHYS_OFFSET + PAGE_OFFSET))
 
-/*
- * Convert a physical address to a Page Frame Number and back
- */
-#define        __phys_to_pfn(paddr)    ((unsigned long)((paddr) >> PAGE_SHIFT))
-#define        __pfn_to_phys(pfn)      ((phys_addr_t)(pfn) << PAGE_SHIFT)
-
 /*
  * Convert a page to/from a physical address
  */
@@ -114,6 +108,14 @@ extern phys_addr_t         memstart_addr;
 /* PHYS_OFFSET - the physical address of the start of memory. */
 #define PHYS_OFFSET            ({ memstart_addr; })
 
+/*
+ * The maximum physical address that the linear direct mapping
+ * of system RAM can cover. (PAGE_OFFSET can be interpreted as
+ * a 2's complement signed quantity and negated to derive the
+ * maximum size of the linear mapping.)
+ */
+#define MAX_MEMBLOCK_ADDR      ({ memstart_addr - PAGE_OFFSET - 1; })
+
 /*
  * PFNs are used to describe any physical page; this means
  * PFN 0 == physical address 0.