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