hugetlb.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #ifndef _ASM_POWERPC_HUGETLB_H
  2. #define _ASM_POWERPC_HUGETLB_H
  3. #include <asm/page.h>
  4. int is_hugepage_only_range(struct mm_struct *mm, unsigned long addr,
  5. unsigned long len);
  6. void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
  7. unsigned long end, unsigned long floor,
  8. unsigned long ceiling);
  9. void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
  10. pte_t *ptep, pte_t pte);
  11. pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
  12. pte_t *ptep);
  13. /*
  14. * The version of vma_mmu_pagesize() in arch/powerpc/mm/hugetlbpage.c needs
  15. * to override the version in mm/hugetlb.c
  16. */
  17. #define vma_mmu_pagesize vma_mmu_pagesize
  18. /*
  19. * If the arch doesn't supply something else, assume that hugepage
  20. * size aligned regions are ok without further preparation.
  21. */
  22. static inline int prepare_hugepage_range(struct file *file,
  23. unsigned long addr, unsigned long len)
  24. {
  25. struct hstate *h = hstate_file(file);
  26. if (len & ~huge_page_mask(h))
  27. return -EINVAL;
  28. if (addr & ~huge_page_mask(h))
  29. return -EINVAL;
  30. return 0;
  31. }
  32. static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm)
  33. {
  34. }
  35. static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
  36. unsigned long addr, pte_t *ptep)
  37. {
  38. }
  39. static inline int huge_pte_none(pte_t pte)
  40. {
  41. return pte_none(pte);
  42. }
  43. static inline pte_t huge_pte_wrprotect(pte_t pte)
  44. {
  45. return pte_wrprotect(pte);
  46. }
  47. static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
  48. unsigned long addr, pte_t *ptep,
  49. pte_t pte, int dirty)
  50. {
  51. return ptep_set_access_flags(vma, addr, ptep, pte, dirty);
  52. }
  53. static inline pte_t huge_ptep_get(pte_t *ptep)
  54. {
  55. return *ptep;
  56. }
  57. static inline int arch_prepare_hugepage(struct page *page)
  58. {
  59. return 0;
  60. }
  61. static inline void arch_release_hugepage(struct page *page)
  62. {
  63. }
  64. #endif /* _ASM_POWERPC_HUGETLB_H */