Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Paul Mundt | e44d6c4 | 2010-01-13 19:18:39 +0900 | [diff] [blame] | 2 | #ifndef __ASM_SH_PGTABLE_2LEVEL_H |
| 3 | #define __ASM_SH_PGTABLE_2LEVEL_H |
Matt Fleming | b73c806 | 2009-11-25 22:00:08 +0000 | [diff] [blame] | 4 | |
Kirill A. Shutemov | 9849a56 | 2017-03-09 17:24:05 +0300 | [diff] [blame] | 5 | #define __ARCH_USE_5LEVEL_HACK |
Matt Fleming | b73c806 | 2009-11-25 22:00:08 +0000 | [diff] [blame] | 6 | #include <asm-generic/pgtable-nopmd.h> |
| 7 | |
| 8 | /* |
| 9 | * traditional two-level paging structure |
| 10 | */ |
Paul Mundt | 782bb5a | 2010-01-13 19:11:14 +0900 | [diff] [blame] | 11 | #define PAGETABLE_LEVELS 2 |
Matt Fleming | b73c806 | 2009-11-25 22:00:08 +0000 | [diff] [blame] | 12 | |
| 13 | /* PTE bits */ |
Paul Mundt | 782bb5a | 2010-01-13 19:11:14 +0900 | [diff] [blame] | 14 | #define PTE_MAGNITUDE 2 /* 32-bit PTEs */ |
Matt Fleming | b73c806 | 2009-11-25 22:00:08 +0000 | [diff] [blame] | 15 | |
Paul Mundt | 782bb5a | 2010-01-13 19:11:14 +0900 | [diff] [blame] | 16 | #define PTE_SHIFT PAGE_SHIFT |
| 17 | #define PTE_BITS (PTE_SHIFT - PTE_MAGNITUDE) |
Matt Fleming | b73c806 | 2009-11-25 22:00:08 +0000 | [diff] [blame] | 18 | |
| 19 | /* PGD bits */ |
Paul Mundt | 782bb5a | 2010-01-13 19:11:14 +0900 | [diff] [blame] | 20 | #define PGDIR_SHIFT (PTE_SHIFT + PTE_BITS) |
Matt Fleming | b73c806 | 2009-11-25 22:00:08 +0000 | [diff] [blame] | 21 | |
Paul Mundt | 782bb5a | 2010-01-13 19:11:14 +0900 | [diff] [blame] | 22 | #define PTRS_PER_PGD (PAGE_SIZE / (1 << PTE_MAGNITUDE)) |
Matt Fleming | b73c806 | 2009-11-25 22:00:08 +0000 | [diff] [blame] | 23 | #define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) |
| 24 | |
Paul Mundt | e44d6c4 | 2010-01-13 19:18:39 +0900 | [diff] [blame] | 25 | #endif /* __ASM_SH_PGTABLE_2LEVEL_H */ |