pgalloc.h 761 B

123456789101112131415161718192021222324252627282930313233343536
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ALPHA_PGALLOC_H
  3. #define _ALPHA_PGALLOC_H
  4. #include <linux/mm.h>
  5. #include <linux/mmzone.h>
  6. #include <asm-generic/pgalloc.h>
  7. /*
  8. * Allocate and free page tables. The xxx_kernel() versions are
  9. * used to allocate a kernel page table - this turns on ASN bits
  10. * if any.
  11. */
  12. static inline void
  13. pmd_populate(struct mm_struct *mm, pmd_t *pmd, pgtable_t pte)
  14. {
  15. pmd_set(pmd, (pte_t *)(page_to_pa(pte) + PAGE_OFFSET));
  16. }
  17. static inline void
  18. pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmd, pte_t *pte)
  19. {
  20. pmd_set(pmd, pte);
  21. }
  22. static inline void
  23. pud_populate(struct mm_struct *mm, pud_t *pud, pmd_t *pmd)
  24. {
  25. pud_set(pud, pmd);
  26. }
  27. extern pgd_t *pgd_alloc(struct mm_struct *mm);
  28. #endif /* _ALPHA_PGALLOC_H */