hugetlb.h 2.1 KB

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