hugetlb.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #ifndef _ASM_SH_HUGETLB_H
  2. #define _ASM_SH_HUGETLB_H
  3. #include <asm/cacheflush.h>
  4. #include <asm/page.h>
  5. #include <asm-generic/hugetlb.h>
  6. static inline int is_hugepage_only_range(struct mm_struct *mm,
  7. unsigned long addr,
  8. unsigned long len) {
  9. return 0;
  10. }
  11. /*
  12. * If the arch doesn't supply something else, assume that hugepage
  13. * size aligned regions are ok without further preparation.
  14. */
  15. static inline int prepare_hugepage_range(struct file *file,
  16. unsigned long addr, unsigned long len)
  17. {
  18. if (len & ~HPAGE_MASK)
  19. return -EINVAL;
  20. if (addr & ~HPAGE_MASK)
  21. return -EINVAL;
  22. return 0;
  23. }
  24. static inline void hugetlb_free_pgd_range(struct mmu_gather *tlb,
  25. unsigned long addr, unsigned long end,
  26. unsigned long floor,
  27. unsigned long ceiling)
  28. {
  29. free_pgd_range(tlb, addr, end, floor, ceiling);
  30. }
  31. static inline void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
  32. pte_t *ptep, pte_t pte)
  33. {
  34. set_pte_at(mm, addr, ptep, pte);
  35. }
  36. static inline pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
  37. unsigned long addr, pte_t *ptep)
  38. {
  39. return ptep_get_and_clear(mm, addr, ptep);
  40. }
  41. static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
  42. unsigned long addr, pte_t *ptep)
  43. {
  44. }
  45. static inline int huge_pte_none(pte_t pte)
  46. {
  47. return pte_none(pte);
  48. }
  49. static inline pte_t huge_pte_wrprotect(pte_t pte)
  50. {
  51. return pte_wrprotect(pte);
  52. }
  53. static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
  54. unsigned long addr, pte_t *ptep)
  55. {
  56. ptep_set_wrprotect(mm, addr, ptep);
  57. }
  58. static inline int huge_ptep_set_access_flags(struct vm_area_struct *vma,
  59. unsigned long addr, pte_t *ptep,
  60. pte_t pte, int dirty)
  61. {
  62. return ptep_set_access_flags(vma, addr, ptep, pte, dirty);
  63. }
  64. static inline pte_t huge_ptep_get(pte_t *ptep)
  65. {
  66. return *ptep;
  67. }
  68. static inline void arch_clear_hugepage_flags(struct page *page)
  69. {
  70. clear_bit(PG_dcache_clean, &page->flags);
  71. }
  72. #endif /* _ASM_SH_HUGETLB_H */