diff options
Diffstat (limited to 'arch/sh/include/asm/pgtable.h')
-rw-r--r-- | arch/sh/include/asm/pgtable.h | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/arch/sh/include/asm/pgtable.h b/arch/sh/include/asm/pgtable.h index ba3046e4f06f..02f77450cd8f 100644 --- a/arch/sh/include/asm/pgtable.h +++ b/arch/sh/include/asm/pgtable.h | |||
@@ -12,7 +12,11 @@ | |||
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 | #ifdef CONFIG_X2TLB |
16 | #include <asm/pgtable-3level.h> | ||
17 | #else | ||
18 | #include <asm/pgtable-2level.h> | ||
19 | #endif | ||
16 | #include <asm/page.h> | 20 | #include <asm/page.h> |
17 | 21 | ||
18 | #ifndef __ASSEMBLY__ | 22 | #ifndef __ASSEMBLY__ |
@@ -51,28 +55,12 @@ static inline unsigned long long neff_sign_extend(unsigned long val) | |||
51 | #define NPHYS_SIGN (1LL << (NPHYS - 1)) | 55 | #define NPHYS_SIGN (1LL << (NPHYS - 1)) |
52 | #define NPHYS_MASK (-1LL << NPHYS) | 56 | #define NPHYS_MASK (-1LL << NPHYS) |
53 | 57 | ||
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) | 58 | #define PGDIR_SIZE (1UL << PGDIR_SHIFT) |
69 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) | 59 | #define PGDIR_MASK (~(PGDIR_SIZE-1)) |
70 | 60 | ||
71 | /* Entries per level */ | 61 | /* Entries per level */ |
72 | #define PTRS_PER_PTE (PAGE_SIZE / (1 << PTE_MAGNITUDE)) | 62 | #define PTRS_PER_PTE (PAGE_SIZE / (1 << PTE_MAGNITUDE)) |
73 | #define PTRS_PER_PGD (PAGE_SIZE / sizeof(pgd_t)) | ||
74 | 63 | ||
75 | #define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE) | ||
76 | #define FIRST_USER_ADDRESS 0 | 64 | #define FIRST_USER_ADDRESS 0 |
77 | 65 | ||
78 | #define PHYS_ADDR_MASK29 0x1fffffff | 66 | #define PHYS_ADDR_MASK29 0x1fffffff |
@@ -153,9 +141,9 @@ typedef pte_t *pte_addr_t; | |||
153 | #define pte_pfn(x) ((unsigned long)(((x).pte_low >> PAGE_SHIFT))) | 141 | #define pte_pfn(x) ((unsigned long)(((x).pte_low >> PAGE_SHIFT))) |
154 | 142 | ||
155 | /* | 143 | /* |
156 | * No page table caches to initialise | 144 | * Initialise the page table caches |
157 | */ | 145 | */ |
158 | #define pgtable_cache_init() do { } while (0) | 146 | extern void pgtable_cache_init(void); |
159 | 147 | ||
160 | struct vm_area_struct; | 148 | struct vm_area_struct; |
161 | 149 | ||
@@ -165,8 +153,9 @@ extern void __update_tlb(struct vm_area_struct *vma, | |||
165 | unsigned long address, pte_t pte); | 153 | unsigned long address, pte_t pte); |
166 | 154 | ||
167 | static inline void | 155 | static inline void |
168 | update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t pte) | 156 | update_mmu_cache(struct vm_area_struct *vma, unsigned long address, pte_t *ptep) |
169 | { | 157 | { |
158 | pte_t pte = *ptep; | ||
170 | __update_cache(vma, address, pte); | 159 | __update_cache(vma, address, pte); |
171 | __update_tlb(vma, address, pte); | 160 | __update_tlb(vma, address, pte); |
172 | } | 161 | } |