diff options
author | Matt Fleming <matt@console-pimps.org> | 2009-11-25 17:00:08 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2009-12-17 00:31:15 -0500 |
commit | b73c806341cfc7492ede6a2ce713cb579547d0ab (patch) | |
tree | 9318727eab90409f518c95031445063e93c0a651 /arch/sh/include/asm/pgtable.h | |
parent | 2f7bb2dfed3b15b388c88250b66f590aabc438da (diff) |
sh: Abstract the number of page table levels
Keep the dimensions of the page tables in a separate header file in
preparation for allowing a three level page table structure.
Signed-off-by: Matt Fleming <matt@console-pimps.org>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/include/asm/pgtable.h')
-rw-r--r-- | arch/sh/include/asm/pgtable.h | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/arch/sh/include/asm/pgtable.h b/arch/sh/include/asm/pgtable.h index ba3046e4f06f..9a0f66c1134c 100644 --- a/arch/sh/include/asm/pgtable.h +++ b/arch/sh/include/asm/pgtable.h | |||
@@ -12,7 +12,7 @@ | |||
12 | #ifndef __ASM_SH_PGTABLE_H | 12 | #ifndef __ASM_SH_PGTABLE_H |
13 | #define __ASM_SH_PGTABLE_H | 13 | #define __ASM_SH_PGTABLE_H |
14 | 14 | ||
15 | #include <asm-generic/pgtable-nopmd.h> | 15 | #include <asm/pgtable_nopmd.h> |
16 | #include <asm/page.h> | 16 | #include <asm/page.h> |
17 | 17 | ||
18 | #ifndef __ASSEMBLY__ | 18 | #ifndef __ASSEMBLY__ |
@@ -51,28 +51,12 @@ static inline unsigned long long neff_sign_extend(unsigned long val) | |||
51 | #define NPHYS_SIGN (1LL << (NPHYS - 1)) | 51 | #define NPHYS_SIGN (1LL << (NPHYS - 1)) |
52 | #define NPHYS_MASK (-1LL << NPHYS) | 52 | #define NPHYS_MASK (-1LL << NPHYS) |
53 | 53 | ||
54 | /* | ||
55 | * traditional two-level paging structure | ||
56 | */ | ||
57 | /* PTE bits */ | ||
58 | #if defined(CONFIG_X2TLB) || defined(CONFIG_SUPERH64) | ||
59 | # define PTE_MAGNITUDE 3 /* 64-bit PTEs on extended mode SH-X2 TLB */ | ||
60 | #else | ||
61 | # define PTE_MAGNITUDE 2 /* 32-bit PTEs */ | ||
62 | #endif | ||
63 | #define PTE_SHIFT PAGE_SHIFT | ||
64 | #define PTE_BITS (PTE_SHIFT - PTE_MAGNITUDE) | ||
65 | |||
66 | /* PGD bits */ | ||
67 | #define PGDIR_SHIFT (PTE_SHIFT + PTE_BITS) | ||
68 | #define PGDIR_SIZE (1UL << PGDIR_SHIFT) | 54 | #define PGDIR_SIZE (1UL << PGDIR_SHIFT) |
69 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) | 55 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) |
70 | 56 | ||
71 | /* Entries per level */ | 57 | /* Entries per level */ |
72 | #define PTRS_PER_PTE (PAGE_SIZE / (1 << PTE_MAGNITUDE)) | 58 | #define PTRS_PER_PTE (PAGE_SIZE / (1 << PTE_MAGNITUDE)) |
73 | #define PTRS_PER_PGD (PAGE_SIZE / sizeof(pgd_t)) | ||
74 | 59 | ||
75 | #define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) | ||
76 | #define FIRST_USER_ADDRESS 0 | 60 | #define FIRST_USER_ADDRESS 0 |
77 | 61 | ||
78 | #define PHYS_ADDR_MASK29 0x1fffffff | 62 | #define PHYS_ADDR_MASK29 0x1fffffff |