hugetlb.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #ifndef _ASM_SPARC64_HUGETLB_H
  2. #define _ASM_SPARC64_HUGETLB_H
  3. #include <asm/page.h>
  4. #include <asm-generic/hugetlb.h>
  5. void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
  6. pte_t *ptep, pte_t pte);
  7. pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
  8. pte_t *ptep);
  9. static inline int is_hugepage_only_range(struct mm_struct *mm,
  10. unsigned long addr,
  11. unsigned long len) {
  12. return 0;
  13. }
  14. /*
  15. * If the arch doesn't supply something else, assume that hugepage
  16. * size aligned regions are ok without further preparation.
  17. */
  18. static inline int prepare_hugepage_range(struct file *file,
  19. unsigned long addr, unsigned long len)
  20. {
  21. if (len & ~HPAGE_MASK)
  22. return -EINVAL;
  23. if (addr & ~HPAGE_MASK)
  24. return -EINVAL;
  25. return 0;
  26. }
  27. static inline void huge_ptep_clear_flush(struct vm_area_struct *vma,
  28. unsigned long addr, pte_t *ptep)
  29. {
  30. }
  31. static inline int huge_pte_none(pte_t pte)
  32. {
  33. return pte_none(pte);
  34. }
  35. static inline pte_t huge_pte_wrprotect(pte_t pte)
  36. {
  37. return pte_wrprotect(pte);
  38. }
  39. static inline void huge_ptep_set_wrprotect(struct mm_struct *mm,
  40. unsigned long addr, pte_t *ptep)
  41. {
  42. pte_t old_pte = *ptep;
  43. set_huge_pte_at(mm, addr, ptep, pte_wrprotect(old_pte));
  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. int changed = !pte_same(*ptep, pte);
  50. if (changed) {
  51. set_huge_pte_at(vma->vm_mm, addr, ptep, pte);
  52. flush_tlb_page(vma, addr);
  53. }
  54. return changed;
  55. }
  56. static inline pte_t huge_ptep_get(pte_t *ptep)
  57. {
  58. return *ptep;
  59. }
  60. static inline void arch_clear_hugepage_flags(struct page *page)
  61. {
  62. }
  63. void hugetlb_free_pgd_range(struct mmu_gather *tlb, unsigned long addr,
  64. unsigned long end, unsigned long floor,
  65. unsigned long ceiling);
  66. #endif /* _ASM_SPARC64_HUGETLB_H */