hugetlb.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. * If the arch doesn't supply something else, assume that hugepage
  15. * size aligned regions are ok without further preparation.
  16. */
  17. static inline int prepare_hugepage_range(struct file *file,
  18. unsigned long addr, unsigned long len)
  19. {
  20. struct hstate *h = hstate_file(file);
  21. if (len & ~huge_page_mask(h))
  22. return -EINVAL;
  23. if (addr & ~huge_page_mask(h))
  24. return -EINVAL;
  25. return 0;
  26. }
  27. static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm)
  28. {
  29. }
  30. static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
  31. unsigned long addr, pte_t *ptep)
  32. {
  33. }
  34. static inline int huge_pte_none(pte_t pte)
  35. {
  36. return pte_none(pte);
  37. }
  38. static inline pte_t huge_pte_wrprotect(pte_t pte)
  39. {
  40. return pte_wrprotect(pte);
  41. }
  42. static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
  43. unsigned long addr, pte_t *ptep,
  44. pte_t pte, int dirty)
  45. {
  46. return ptep_set_access_flags(vma, addr, ptep, pte, dirty);
  47. }
  48. static inline pte_t huge_ptep_get(pte_t *ptep)
  49. {
  50. return *ptep;
  51. }
  52. static inline int arch_prepare_hugepage(struct page *page)
  53. {
  54. return 0;
  55. }
  56. static inline void arch_release_hugepage(struct page *page)
  57. {
  58. }
  59. #endif /* _ASM_POWERPC_HUGETLB_H */