hugetlb.h 1.7 KB

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