hugetlb.h 1.9 KB

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