aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHugh Dickins <hugh@veritas.com>2005-04-19 16:29:17 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org.(none)>2005-04-19 16:29:17 -0400
commit8f6c99c11ae63ce887686f3e51c412cc4d8d8a7d (patch)
tree4c3f29ce21f2a69f9105581c95e07de5bc5bb7aa /include
parent3bf5ee95648c694bac4d13529563c230cd4fe5f2 (diff)
[PATCH] freepgt: remove arch pgd_addr_end
ia64 and sparc64 hurriedly had to introduce their own variants of pgd_addr_end, to leapfrog over the holes in their virtual address spaces which the final clear_page_range suddenly presented when converted from pgd_index to pgd_addr_end. But now that free_pgtables respects the vma list, those holes are never presented, and the arch variants can go. Signed-off-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/pgtable.h8
-rw-r--r--include/asm-ia64/pgtable.h26
-rw-r--r--include/asm-sparc64/pgtable.h15
3 files changed, 3 insertions, 46 deletions
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index a3b28710d56c..1f4ec7b70270 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -140,17 +140,15 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addres
140#endif 140#endif
141 141
142/* 142/*
143 * When walking page tables, get the address of the next boundary, or 143 * When walking page tables, get the address of the next boundary,
144 * the end address of the range if that comes earlier. Although end might 144 * or the end address of the range if that comes earlier. Although no
145 * wrap to 0 only in clear_page_range, __boundary may wrap to 0 throughout. 145 * vma end wraps to 0, rounded up __boundary may wrap to 0 throughout.
146 */ 146 */
147 147
148#ifndef pgd_addr_end
149#define pgd_addr_end(addr, end) \ 148#define pgd_addr_end(addr, end) \
150({ unsigned long __boundary = ((addr) + PGDIR_SIZE) & PGDIR_MASK; \ 149({ unsigned long __boundary = ((addr) + PGDIR_SIZE) & PGDIR_MASK; \
151 (__boundary - 1 < (end) - 1)? __boundary: (end); \ 150 (__boundary - 1 < (end) - 1)? __boundary: (end); \
152}) 151})
153#endif
154 152
155#ifndef pud_addr_end 153#ifndef pud_addr_end
156#define pud_addr_end(addr, end) \ 154#define pud_addr_end(addr, end) \
diff --git a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h
index bbf6dd757003..fecfd0f68961 100644
--- a/include/asm-ia64/pgtable.h
+++ b/include/asm-ia64/pgtable.h
@@ -561,32 +561,6 @@ do { \
561#define __HAVE_ARCH_PGD_OFFSET_GATE 561#define __HAVE_ARCH_PGD_OFFSET_GATE
562#define __HAVE_ARCH_LAZY_MMU_PROT_UPDATE 562#define __HAVE_ARCH_LAZY_MMU_PROT_UPDATE
563 563
564/*
565 * Override for pgd_addr_end() to deal with the virtual address space holes
566 * in each region. In regions 0..4 virtual address bits are used like this:
567 * +--------+------+--------+-----+-----+--------+
568 * | pgdhi3 | rsvd | pgdlow | pmd | pte | offset |
569 * +--------+------+--------+-----+-----+--------+
570 * 'pgdlow' overflows to pgdhi3 (a.k.a. region bits) leaving rsvd==0
571 */
572#define IA64_PGD_OVERFLOW (PGDIR_SIZE << (PAGE_SHIFT-6))
573
574#define pgd_addr_end(addr, end) \
575({ unsigned long __boundary = ((addr) + PGDIR_SIZE) & PGDIR_MASK; \
576 if (REGION_NUMBER(__boundary) < 5 && \
577 __boundary & IA64_PGD_OVERFLOW) \
578 __boundary += (RGN_SIZE - 1) & ~(IA64_PGD_OVERFLOW - 1);\
579 (__boundary - 1 < (end) - 1)? __boundary: (end); \
580})
581
582#define pmd_addr_end(addr, end) \
583({ unsigned long __boundary = ((addr) + PMD_SIZE) & PMD_MASK; \
584 if (REGION_NUMBER(__boundary) < 5 && \
585 __boundary & IA64_PGD_OVERFLOW) \
586 __boundary += (RGN_SIZE - 1) & ~(IA64_PGD_OVERFLOW - 1);\
587 (__boundary - 1 < (end) - 1)? __boundary: (end); \
588})
589
590#include <asm-generic/pgtable-nopud.h> 564#include <asm-generic/pgtable-nopud.h>
591#include <asm-generic/pgtable.h> 565#include <asm-generic/pgtable.h>
592 566
diff --git a/include/asm-sparc64/pgtable.h b/include/asm-sparc64/pgtable.h
index ca04ac105b69..c93011574843 100644
--- a/include/asm-sparc64/pgtable.h
+++ b/include/asm-sparc64/pgtable.h
@@ -424,21 +424,6 @@ extern int io_remap_pfn_range(struct vm_area_struct *vma, unsigned long from,
424#define GET_IOSPACE(pfn) (pfn >> (BITS_PER_LONG - 4)) 424#define GET_IOSPACE(pfn) (pfn >> (BITS_PER_LONG - 4))
425#define GET_PFN(pfn) (pfn & 0x0fffffffffffffffUL) 425#define GET_PFN(pfn) (pfn & 0x0fffffffffffffffUL)
426 426
427/* Override for {pgd,pmd}_addr_end() to deal with the virtual address
428 * space hole. We simply sign extend bit 43.
429 */
430#define pgd_addr_end(addr, end) \
431({ unsigned long __boundary = ((addr) + PGDIR_SIZE) & PGDIR_MASK; \
432 __boundary = ((long) (__boundary << 20)) >> 20; \
433 (__boundary - 1 < (end) - 1)? __boundary: (end); \
434})
435
436#define pmd_addr_end(addr, end) \
437({ unsigned long __boundary = ((addr) + PMD_SIZE) & PMD_MASK; \
438 __boundary = ((long) (__boundary << 20)) >> 20; \
439 (__boundary - 1 < (end) - 1)? __boundary: (end); \
440})
441
442#include <asm-generic/pgtable.h> 427#include <asm-generic/pgtable.h>
443 428
444/* We provide our own get_unmapped_area to cope with VA holes for userland */ 429/* We provide our own get_unmapped_area to cope with VA holes for userland */