]> git.hungrycats.org Git - linux/commitdiff
[SPARC64]: Override {pgd,pmd}_addr_end() to handle vaddr hole.
authorDavid S. Miller <davem@sunset.davemloft.net>
Tue, 15 Mar 2005 12:34:36 +0000 (04:34 -0800)
committerDavid S. Miller <davem@sunset.davemloft.net>
Tue, 15 Mar 2005 12:34:36 +0000 (04:34 -0800)
Signed-off-by: David S. Miller <davem@davemloft.net>
include/asm-generic/pgtable.h
include/asm-sparc64/pgtable.h

index 60148466d023935c2223b97238ee27af8d5ca1d3..46db1558d99cfce1443bce1f194c38345ebd6717 100644 (file)
@@ -141,10 +141,12 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres
  * wrap to 0 only in clear_page_range, __boundary may wrap to 0 throughout.
  */
 
+#ifndef pgd_addr_end
 #define pgd_addr_end(addr, end)                                                \
 ({     unsigned long __boundary = ((addr) + PGDIR_SIZE) & PGDIR_MASK;  \
        (__boundary - 1 < (end) - 1)? __boundary: (end);                \
 })
+#endif
 
 #ifndef pud_addr_end
 #define pud_addr_end(addr, end)                                                \
index f6bc1dbdb367eea3568cad09f1544667d1bebb82..886dd0c7c4546fb183aacf6773b4b4ac3c5da939 100644 (file)
@@ -432,6 +432,21 @@ extern int io_remap_page_range(struct vm_area_struct *vma, unsigned long from,
                               unsigned long offset,
                               unsigned long size, pgprot_t prot, int space);
 
+/* Override for {pgd,pmd}_addr_end() to deal with the virtual address
+ * space hole.  We simply sign extend bit 43.
+ */
+#define pgd_addr_end(addr, end)                                                \
+({     unsigned long __boundary = ((addr) + PGDIR_SIZE) & PGDIR_MASK;  \
+       __boundary = ((long) (__boundary << 20)) >> 20;                 \
+       (__boundary - 1 < (end) - 1)? __boundary: (end);                \
+})
+
+#define pmd_addr_end(addr, end)                                                \
+({     unsigned long __boundary = ((addr) + PMD_SIZE) & PMD_MASK;      \
+       __boundary = ((long) (__boundary << 20)) >> 20;                 \
+       (__boundary - 1 < (end) - 1)? __boundary: (end);                \
+})
+
 #include <asm-generic/pgtable.h>
 
 /* We provide our own get_unmapped_area to cope with VA holes for userland */