diff options
Diffstat (limited to 'include/linux/mm.h')
-rw-r--r-- | include/linux/mm.h | 34 |
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 | ||
1564 | static inline int __p4d_alloc(struct mm_struct *mm, pgd_t *pgd, | ||
1565 | unsigned long address) | ||
1566 | { | ||
1567 | return 0; | ||
1568 | } | ||
1569 | #else | ||
1570 | int __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 |
1564 | static inline int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, | 1574 | static 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 |
1570 | int __pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address); | 1580 | int __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) |
1622 | static inline pud_t *pud_alloc(struct mm_struct *mm, pgd_t *pgd, unsigned long address) | 1632 | |
1633 | #ifndef __ARCH_HAS_5LEVEL_HACK | ||
1634 | static 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 | |||
1641 | static 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 | ||
1628 | static inline pmd_t *pmd_alloc(struct mm_struct *mm, pud_t *pud, unsigned long address) | 1649 | static 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 | ||
2386 | struct page *sparse_mem_map_populate(unsigned long pnum, int nid); | 2407 | struct page *sparse_mem_map_populate(unsigned long pnum, int nid); |
2387 | pgd_t *vmemmap_pgd_populate(unsigned long addr, int node); | 2408 | pgd_t *vmemmap_pgd_populate(unsigned long addr, int node); |
2388 | pud_t *vmemmap_pud_populate(pgd_t *pgd, unsigned long addr, int node); | 2409 | p4d_t *vmemmap_p4d_populate(pgd_t *pgd, unsigned long addr, int node); |
2410 | pud_t *vmemmap_pud_populate(p4d_t *p4d, unsigned long addr, int node); | ||
2389 | pmd_t *vmemmap_pmd_populate(pud_t *pud, unsigned long addr, int node); | 2411 | pmd_t *vmemmap_pmd_populate(pud_t *pud, unsigned long addr, int node); |
2390 | pte_t *vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node); | 2412 | pte_t *vmemmap_pte_populate(pmd_t *pmd, unsigned long addr, int node); |
2391 | void *vmemmap_alloc_block(unsigned long size, int node); | 2413 | void *vmemmap_alloc_block(unsigned long size, int node); |