hugetlb.h 932 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ASM_SH_HUGETLB_H
  3. #define _ASM_SH_HUGETLB_H
  4. #include <asm/cacheflush.h>
  5. #include <asm/page.h>
  6. /*
  7. * If the arch doesn't supply something else, assume that hugepage
  8. * size aligned regions are ok without further preparation.
  9. */
  10. #define __HAVE_ARCH_PREPARE_HUGEPAGE_RANGE
  11. static inline int prepare_hugepage_range(struct file *file,
  12. unsigned long addr, unsigned long len)
  13. {
  14. if (len & ~HPAGE_MASK)
  15. return -EINVAL;
  16. if (addr & ~HPAGE_MASK)
  17. return -EINVAL;
  18. return 0;
  19. }
  20. #define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH
  21. static inline pte_t huge_ptep_clear_flush(struct vm_area_struct *vma,
  22. unsigned long addr, pte_t *ptep)
  23. {
  24. return *ptep;
  25. }
  26. static inline void arch_clear_hugepage_flags(struct page *page)
  27. {
  28. clear_bit(PG_dcache_clean, &page->flags);
  29. }
  30. #define arch_clear_hugepage_flags arch_clear_hugepage_flags
  31. #include <asm-generic/hugetlb.h>
  32. #endif /* _ASM_SH_HUGETLB_H */