1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _4LEVEL_FIXUP_H
3 #define _4LEVEL_FIXUP_H
5 #define __ARCH_HAS_4LEVEL_HACK
6 #define __PAGETABLE_PUD_FOLDED
8 #define PUD_SHIFT PGDIR_SHIFT
9 #define PUD_SIZE PGDIR_SIZE
10 #define PUD_MASK PGDIR_MASK
11 #define PTRS_PER_PUD 1
15 #define pmd_alloc(mm, pud, address) \
16 ((unlikely(pgd_none(*(pud))) && __pmd_alloc(mm, pud, address))? \
17 NULL: pmd_offset(pud, address))
19 #define pud_offset(pgd, start) (pgd)
20 #define pud_none(pud) 0
21 #define pud_bad(pud) 0
22 #define pud_present(pud) 1
23 #define pud_ERROR(pud) do { } while (0)
24 #define pud_clear(pud) pgd_clear(pud)
25 #define pud_val(pud) pgd_val(pud)
26 #define pud_populate(mm, pud, pmd) pgd_populate(mm, pud, pmd)
27 #define pud_page(pud) pgd_page(pud)
28 #define pud_page_vaddr(pud) pgd_page_vaddr(pud)
31 #define pud_free_tlb(tlb, x, addr) do { } while (0)
32 #define pud_free(mm, x) do { } while (0)
33 #define __pud_free_tlb(tlb, x, addr) do { } while (0)
36 #define pud_addr_end(addr, end) (end)
38 #include <asm-generic/5level-fixup.h>