aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/hugetlb.h
diff options
context:
space:
mode:
authorGerald Schaefer <gerald.schaefer@de.ibm.com>2008-04-28 05:13:27 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-28 11:58:25 -0400
commit6d779079bfd1196e077bb1d0a906c37ae770b102 (patch)
tree880b17a8c5d4badb548773928868606826899c68 /include/linux/hugetlb.h
parent71fe804b6d56d6a7aed680e096901434cef6a2c3 (diff)
hugetlbfs: architecture header cleanup
This patch moves all architecture functions for hugetlb to architecture header files (include/asm-foo/hugetlb.h) and converts all macros to inline functions. It also removes (!) ARCH_HAS_HUGEPAGE_ONLY_RANGE, ARCH_HAS_HUGETLB_FREE_PGD_RANGE, ARCH_HAS_PREPARE_HUGEPAGE_RANGE, ARCH_HAS_SETCLEAR_HUGE_PTE and ARCH_HAS_HUGETLB_PREFAULT_HOOK. Getting rid of the ARCH_HAS_xxx #ifdef and macro fugliness should increase readability and maintainability, at the price of some code duplication. An asm-generic common part would have reduced the loc, but we would end up with new ARCH_HAS_xxx defines eventually. Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com> Cc: Paul Mundt <lethal@linux-sh.org> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Ingo Molnar <mingo@elte.hu> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/hugetlb.h')
-rw-r--r--include/linux/hugetlb.h46
1 files changed, 1 insertions, 45 deletions
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index addca4cd4f11..a79e80b689d8 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -8,6 +8,7 @@
8#include <linux/mempolicy.h> 8#include <linux/mempolicy.h>
9#include <linux/shm.h> 9#include <linux/shm.h>
10#include <asm/tlbflush.h> 10#include <asm/tlbflush.h>
11#include <asm/hugetlb.h>
11 12
12struct ctl_table; 13struct ctl_table;
13 14
@@ -51,51 +52,6 @@ int pmd_huge(pmd_t pmd);
51void hugetlb_change_protection(struct vm_area_struct *vma, 52void hugetlb_change_protection(struct vm_area_struct *vma,
52 unsigned long address, unsigned long end, pgprot_t newprot); 53 unsigned long address, unsigned long end, pgprot_t newprot);
53 54
54#ifndef ARCH_HAS_HUGEPAGE_ONLY_RANGE
55#define is_hugepage_only_range(mm, addr, len) 0
56#endif
57
58#ifndef ARCH_HAS_HUGETLB_FREE_PGD_RANGE
59#define hugetlb_free_pgd_range free_pgd_range
60#else
61void hugetlb_free_pgd_range(struct mmu_gather **tlb, unsigned long addr,
62 unsigned long end, unsigned long floor,
63 unsigned long ceiling);
64#endif
65
66#ifndef ARCH_HAS_PREPARE_HUGEPAGE_RANGE
67/*
68 * If the arch doesn't supply something else, assume that hugepage
69 * size aligned regions are ok without further preparation.
70 */
71static inline int prepare_hugepage_range(unsigned long addr, unsigned long len)
72{
73 if (len & ~HPAGE_MASK)
74 return -EINVAL;
75 if (addr & ~HPAGE_MASK)
76 return -EINVAL;
77 return 0;
78}
79#else
80int prepare_hugepage_range(unsigned long addr, unsigned long len);
81#endif
82
83#ifndef ARCH_HAS_SETCLEAR_HUGE_PTE
84#define set_huge_pte_at(mm, addr, ptep, pte) set_pte_at(mm, addr, ptep, pte)
85#define huge_ptep_get_and_clear(mm, addr, ptep) ptep_get_and_clear(mm, addr, ptep)
86#else
87void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
88 pte_t *ptep, pte_t pte);
89pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
90 pte_t *ptep);
91#endif
92
93#ifndef ARCH_HAS_HUGETLB_PREFAULT_HOOK
94#define hugetlb_prefault_arch_hook(mm) do { } while (0)
95#else
96void hugetlb_prefault_arch_hook(struct mm_struct *mm);
97#endif
98
99#else /* !CONFIG_HUGETLB_PAGE */ 55#else /* !CONFIG_HUGETLB_PAGE */
100 56
101static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) 57static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)