Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef _ASM_POWERPC_PGALLOC_32_H
0003 #define _ASM_POWERPC_PGALLOC_32_H
0004 
0005 #include <linux/threads.h>
0006 #include <linux/slab.h>
0007 
0008 /*
0009  * We don't have any real pmd's, and this code never triggers because
0010  * the pgd will always be present..
0011  */
0012 /* #define pmd_alloc_one(mm,address)       ({ BUG(); ((pmd_t *)2); }) */
0013 #define pmd_free(mm, x)         do { } while (0)
0014 #define __pmd_free_tlb(tlb,x,a)     do { } while (0)
0015 /* #define pgd_populate(mm, pmd, pte)      BUG() */
0016 
0017 static inline void pmd_populate_kernel(struct mm_struct *mm, pmd_t *pmdp,
0018                        pte_t *pte)
0019 {
0020     if (IS_ENABLED(CONFIG_BOOKE))
0021         *pmdp = __pmd((unsigned long)pte | _PMD_PRESENT);
0022     else
0023         *pmdp = __pmd(__pa(pte) | _PMD_PRESENT);
0024 }
0025 
0026 static inline void pmd_populate(struct mm_struct *mm, pmd_t *pmdp,
0027                 pgtable_t pte_page)
0028 {
0029     if (IS_ENABLED(CONFIG_BOOKE))
0030         *pmdp = __pmd((unsigned long)pte_page | _PMD_PRESENT);
0031     else
0032         *pmdp = __pmd(__pa(pte_page) | _PMD_USER | _PMD_PRESENT);
0033 }
0034 
0035 #endif /* _ASM_POWERPC_PGALLOC_32_H */