blob: a4f08f10fe1f231429cfe07959ce680d85917ad8 [file] [log] [blame]
Gerald Schaefer6d779072008-04-28 02:13:27 -07001#ifndef _ASM_POWERPC_HUGETLB_H
2#define _ASM_POWERPC_HUGETLB_H
3
4#include <asm/page.h>
5
Gerald Schaefer6d779072008-04-28 02:13:27 -07006int is_hugepage_only_range(struct mm_struct *mm, unsigned long addr,
7 unsigned long len);
8
Jan Beulich42b77722008-07-23 21:27:10 -07009void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
Gerald Schaefer6d779072008-04-28 02:13:27 -070010 unsigned long end, unsigned long floor,
11 unsigned long ceiling);
12
13void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
14 pte_t *ptep, pte_t pte);
15
16pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
17 pte_t *ptep);
18
19/*
Mel Gorman33402892009-01-06 14:38:54 -080020 * The version of vma_mmu_pagesize() in arch/powerpc/mm/hugetlbpage.c needs
21 * to override the version in mm/hugetlb.c
22 */
23#define vma_mmu_pagesize vma_mmu_pagesize
24
25/*
Gerald Schaefer6d779072008-04-28 02:13:27 -070026 * If the arch doesn't supply something else, assume that hugepage
27 * size aligned regions are ok without further preparation.
28 */
Andi Kleena5516432008-07-23 21:27:41 -070029static inline int prepare_hugepage_range(struct file *file,
30 unsigned long addr, unsigned long len)
Gerald Schaefer6d779072008-04-28 02:13:27 -070031{
Jon Tollefson0d9ea752008-07-23 21:27:56 -070032 struct hstate *h = hstate_file(file);
33 if (len & ~huge_page_mask(h))
Gerald Schaefer6d779072008-04-28 02:13:27 -070034 return -EINVAL;
Jon Tollefson0d9ea752008-07-23 21:27:56 -070035 if (addr & ~huge_page_mask(h))
Gerald Schaefer6d779072008-04-28 02:13:27 -070036 return -EINVAL;
37 return 0;
38}
39
40static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm)
41{
42}
43
Gerald Schaefer8fe627e2008-04-28 02:13:28 -070044static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
45 unsigned long addr, pte_t *ptep)
46{
47}
48
Gerald Schaefer7f2e9522008-04-28 02:13:29 -070049static inline int huge_pte_none(pte_t pte)
50{
51 return pte_none(pte);
52}
53
54static inline pte_t huge_pte_wrprotect(pte_t pte)
55{
56 return pte_wrprotect(pte);
57}
58
Gerald Schaefer7f2e9522008-04-28 02:13:29 -070059static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
60 unsigned long addr, pte_t *ptep,
61 pte_t pte, int dirty)
62{
63 return ptep_set_access_flags(vma, addr, ptep, pte, dirty);
64}
65
66static inline pte_t huge_ptep_get(pte_t *ptep)
67{
68 return *ptep;
69}
70
71static inline int arch_prepare_hugepage(struct page *page)
72{
73 return 0;
74}
75
76static inline void arch_release_hugepage(struct page *page)
77{
78}
79
Gerald Schaefer6d779072008-04-28 02:13:27 -070080#endif /* _ASM_POWERPC_HUGETLB_H */