aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r--include/linux/mm.h34
1 files changed, 28 insertions, 6 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 0d65dd72c0f4..5f01c88f0800 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1560,14 +1560,24 @@ static inline pte_t *get_locked_pte(struct mm_struct *mm, unsigned long addr,
1560 return ptep; 1560 return ptep;
1561} 1561}
1562 1562
1563#ifdef __PAGETABLE_P4D_FOLDED
1564static inline int __p4d_alloc(struct mm_struct *mm, pgd_t *pgd,
1565 unsigned long address)
1566{
1567 return 0;
1568}
1569#else
1570int __p4d_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address);
1571#endif
1572
1563#ifdef __PAGETABLE_PUD_FOLDED 1573#ifdef __PAGETABLE_PUD_FOLDED
1564static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, 1574static inline int __pud_alloc(struct mm_struct *mm, p4d_t *p4d,
1565 unsigned long address) 1575 unsigned long address)
1566{ 1576{
1567 return 0; 1577 return 0;
1568} 1578}
1569#else 1579#else
1570int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address); 1580int __pud_alloc(struct mm_struct *mm, p4d_t *p4d, unsigned long address);
1571#endif 1581#endif
1572 1582
1573#if defined(__PAGETABLE_PMD_FOLDED) || !defined(CONFIG_MMU) 1583#if defined(__PAGETABLE_PMD_FOLDED) || !defined(CONFIG_MMU)
@@ -1619,11 +1629,22 @@ int __pte_alloc_kernel(pmd_t *pmd, unsigned long address);
1619 * Remove it when 4level-fixup.h has been removed. 1629 * Remove it when 4level-fixup.h has been removed.
1620 */ 1630 */
1621#if defined(CONFIG_MMU) && !defined(__ARCH_HAS_4LEVEL_HACK) 1631#if defined(CONFIG_MMU) && !defined(__ARCH_HAS_4LEVEL_HACK)
1622static inline pud_t *pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address) 1632
1633#ifndef __ARCH_HAS_5LEVEL_HACK
1634static inline p4d_t *p4d_alloc(struct mm_struct *mm, pgd_t *pgd,
1635 unsigned long address)
1636{
1637 return (unlikely(pgd_none(*pgd)) && __p4d_alloc(mm, pgd, address)) ?
1638 NULL : p4d_offset(pgd, address);
1639}
1640
1641static inline pud_t *pud_alloc(struct mm_struct *mm, p4d_t *p4d,
1642 unsigned long address)
1623{ 1643{
1624 return (unlikely(pgd_none(*pgd)) && __pud_alloc(mm, pgd, address))? 1644 return (unlikely(p4d_none(*p4d)) && __pud_alloc(mm, p4d, address)) ?
1625 NULL: pud_offset(pgd, address); 1645 NULL : pud_offset(p4d, address);
1626} 1646}
1647#endif /* !__ARCH_HAS_5LEVEL_HACK */
1627 1648
1628static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address) 1649static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address)
1629{ 1650{
@@ -2385,7 +2406,8 @@ void sparse_mem_maps_populate_node(struct page **map_map,
2385 2406
2386struct page *sparse_mem_map_populate(unsigned long pnum, int nid); 2407struct page *sparse_mem_map_populate(unsigned long pnum, int nid);
2387pgd_t *vmemmap_pgd_populate(unsigned long addr, int node); 2408pgd_t *vmemmap_pgd_populate(unsigned long addr, int node);
2388pud_t *vmemmap_pud_populate(pgd_t *pgd, unsigned long addr, int node); 2409p4d_t *vmemmap_p4d_populate(pgd_t *pgd, unsigned long addr, int node);
2410pud_t *vmemmap_pud_populate(p4d_t *p4d, unsigned long addr, int node);
2389pmd_t *vmemmap_pmd_populate(pud_t *pud, unsigned long addr, int node); 2411pmd_t *vmemmap_pmd_populate(pud_t *pud, unsigned long addr, int node);
2390pte_t *vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node); 2412pte_t *vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node);
2391void *vmemmap_alloc_block(unsigned long size, int node); 2413void *vmemmap_alloc_block(unsigned long size, int node);