hugetlb.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. if (len & ~HPAGE_MASK)
  21. return -EINVAL;
  22. if (addr & ~HPAGE_MASK)
  23. return -EINVAL;
  24. return 0;
  25. }
  26. static inline void hugetlb_prefault_arch_hook(struct mm_struct *mm)
  27. {
  28. }
  29. static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
  30. unsigned long addr, pte_t *ptep)
  31. {
  32. }
  33. static inline int huge_pte_none(pte_t pte)
  34. {
  35. return pte_none(pte);
  36. }
  37. static inline pte_t huge_pte_wrprotect(pte_t pte)
  38. {
  39. return pte_wrprotect(pte);
  40. }
  41. static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
  42. unsigned long addr, pte_t *ptep,
  43. pte_t pte, int dirty)
  44. {
  45. return ptep_set_access_flags(vma, addr, ptep, pte, dirty);
  46. }
  47. static inline pte_t huge_ptep_get(pte_t *ptep)
  48. {
  49. return *ptep;
  50. }
  51. static inline int arch_prepare_hugepage(struct page *page)
  52. {
  53. return 0;
  54. }
  55. static inline void arch_release_hugepage(struct page *page)
  56. {
  57. }
  58. #endif /* _ASM_POWERPC_HUGETLB_H */