Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | #ifndef _4LEVEL_FIXUP_H |
| 3 | #define _4LEVEL_FIXUP_H |
| 4 | |
| 5 | #define __ARCH_HAS_4LEVEL_HACK |
Martin Schwidefsky | a8874e7 | 2018-10-31 12:11:48 +0100 | [diff] [blame] | 6 | #define __PAGETABLE_PUD_FOLDED 1 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | |
Kirill A. Shutemov | 4155b8e | 2015-02-11 15:26:44 -0800 | [diff] [blame] | 8 | #define PUD_SHIFT PGDIR_SHIFT |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 9 | #define PUD_SIZE PGDIR_SIZE |
| 10 | #define PUD_MASK PGDIR_MASK |
| 11 | #define PTRS_PER_PUD 1 |
| 12 | |
| 13 | #define pud_t pgd_t |
| 14 | |
Hugh Dickins | 1bb3630 | 2005-10-29 18:16:22 -0700 | [diff] [blame] | 15 | #define pmd_alloc(mm, pud, address) \ |
| 16 | ((unlikely(pgd_none(*(pud))) && __pmd_alloc(mm, pud, address))? \ |
| 17 | NULL: pmd_offset(pud, address)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 18 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 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) |
Dave McCracken | 46a82b2 | 2006-09-25 23:31:48 -0700 | [diff] [blame] | 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) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | |
| 30 | #undef pud_free_tlb |
Benjamin Herrenschmidt | 9e1b32c | 2009-07-22 15:44:28 +1000 | [diff] [blame] | 31 | #define pud_free_tlb(tlb, x, addr) do { } while (0) |
Benjamin Herrenschmidt | 5e54197 | 2008-02-04 22:29:14 -0800 | [diff] [blame] | 32 | #define pud_free(mm, x) do { } while (0) |
Benjamin Herrenschmidt | 9e1b32c | 2009-07-22 15:44:28 +1000 | [diff] [blame] | 33 | #define __pud_free_tlb(tlb, x, addr) do { } while (0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | |
| 35 | #undef pud_addr_end |
| 36 | #define pud_addr_end(addr, end) (end) |
| 37 | |
Kirill A. Shutemov | 505a60e | 2017-03-09 17:24:03 +0300 | [diff] [blame] | 38 | #include <asm-generic/5level-fixup.h> |
| 39 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | #endif |