diff options
author | Thiemo Seufer <ths@networkno.de> | 2005-02-21 06:11:32 -0500 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2005-10-29 14:30:40 -0400 |
commit | f29244a59460a62f20885e1e3b55a845fb5a8fdb (patch) | |
tree | 1a70946919172b93a61bd690223aee4ba48be8c6 /include | |
parent | dc953df1ba5526814982676f47580c8e1bcdbfeb (diff) |
Fix compilation, and bring 32/64 bit variants more in line.
Signed-off-by: Thiemo Seufer <ths@networkno.de>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-mips/pgtable-32.h | 9 | ||||
-rw-r--r-- | include/asm-mips/pgtable-64.h | 9 |
2 files changed, 8 insertions, 10 deletions
diff --git a/include/asm-mips/pgtable-32.h b/include/asm-mips/pgtable-32.h index 8d66303eabc4..9b4d39d9f2f0 100644 --- a/include/asm-mips/pgtable-32.h +++ b/include/asm-mips/pgtable-32.h | |||
@@ -43,10 +43,6 @@ extern int add_temporary_entry(unsigned long entrylo0, unsigned long entrylo1, | |||
43 | * works even with the cache aliasing problem the R4k and above have. | 43 | * works even with the cache aliasing problem the R4k and above have. |
44 | */ | 44 | */ |
45 | 45 | ||
46 | /* PMD_SHIFT determines the size of the area a second-level page table can map */ | ||
47 | #define PMD_SIZE (1UL << PMD_SHIFT) | ||
48 | #define PMD_MASK (~(PMD_SIZE-1)) | ||
49 | |||
50 | /* PGDIR_SHIFT determines what a third-level page table entry can map */ | 46 | /* PGDIR_SHIFT determines what a third-level page table entry can map */ |
51 | #ifdef CONFIG_64BIT_PHYS_ADDR | 47 | #ifdef CONFIG_64BIT_PHYS_ADDR |
52 | #define PGDIR_SHIFT 21 | 48 | #define PGDIR_SHIFT 21 |
@@ -78,7 +74,7 @@ extern int add_temporary_entry(unsigned long entrylo0, unsigned long entrylo1, | |||
78 | #define USER_PTRS_PER_PGD (0x80000000UL/PGDIR_SIZE) | 74 | #define USER_PTRS_PER_PGD (0x80000000UL/PGDIR_SIZE) |
79 | #define FIRST_USER_ADDRESS 0 | 75 | #define FIRST_USER_ADDRESS 0 |
80 | 76 | ||
81 | #define VMALLOC_START KSEG2 | 77 | #define VMALLOC_START MAP_BASE |
82 | 78 | ||
83 | #ifdef CONFIG_HIGHMEM | 79 | #ifdef CONFIG_HIGHMEM |
84 | # define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE) | 80 | # define VMALLOC_END (PKMAP_BASE-2*PAGE_SIZE) |
@@ -146,12 +142,13 @@ pfn_pte(unsigned long pfn, pgprot_t prot) | |||
146 | #endif /* defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) */ | 142 | #endif /* defined(CONFIG_64BIT_PHYS_ADDR) && defined(CONFIG_CPU_MIPS32) */ |
147 | 143 | ||
148 | #define __pgd_offset(address) pgd_index(address) | 144 | #define __pgd_offset(address) pgd_index(address) |
145 | #define __pud_offset(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1)) | ||
149 | #define __pmd_offset(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) | 146 | #define __pmd_offset(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) |
150 | 147 | ||
151 | /* to find an entry in a kernel page-table-directory */ | 148 | /* to find an entry in a kernel page-table-directory */ |
152 | #define pgd_offset_k(address) pgd_offset(&init_mm, address) | 149 | #define pgd_offset_k(address) pgd_offset(&init_mm, address) |
153 | 150 | ||
154 | #define pgd_index(address) ((address) >> PGDIR_SHIFT) | 151 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) |
155 | 152 | ||
156 | /* to find an entry in a page-table-directory */ | 153 | /* to find an entry in a page-table-directory */ |
157 | #define pgd_offset(mm,addr) ((mm)->pgd + pgd_index(addr)) | 154 | #define pgd_offset(mm,addr) ((mm)->pgd + pgd_index(addr)) |
diff --git a/include/asm-mips/pgtable-64.h b/include/asm-mips/pgtable-64.h index ac5517fa1ee4..35007250ac2b 100644 --- a/include/asm-mips/pgtable-64.h +++ b/include/asm-mips/pgtable-64.h | |||
@@ -59,7 +59,7 @@ | |||
59 | * two levels would be easy to implement. | 59 | * two levels would be easy to implement. |
60 | * | 60 | * |
61 | * For 16kB page size we use a 2 level page tree which permits a total of | 61 | * For 16kB page size we use a 2 level page tree which permits a total of |
62 | * 36 bits of virtual address space. We could add a third leve. but it seems | 62 | * 36 bits of virtual address space. We could add a third level but it seems |
63 | * like at the moment there's no need for this. | 63 | * like at the moment there's no need for this. |
64 | * | 64 | * |
65 | * For 64kB page size we use a 2 level page table tree for a total of 42 bits | 65 | * For 64kB page size we use a 2 level page table tree for a total of 42 bits |
@@ -97,7 +97,7 @@ | |||
97 | #define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) | 97 | #define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE) |
98 | #define FIRST_USER_ADDRESS 0 | 98 | #define FIRST_USER_ADDRESS 0 |
99 | 99 | ||
100 | #define VMALLOC_START XKSEG | 100 | #define VMALLOC_START MAP_BASE |
101 | #define VMALLOC_END \ | 101 | #define VMALLOC_END \ |
102 | (VMALLOC_START + PTRS_PER_PGD * PTRS_PER_PMD * PTRS_PER_PTE * PAGE_SIZE) | 102 | (VMALLOC_START + PTRS_PER_PGD * PTRS_PER_PMD * PTRS_PER_PTE * PAGE_SIZE) |
103 | 103 | ||
@@ -134,7 +134,7 @@ static inline void pmd_clear(pmd_t *pmdp) | |||
134 | } | 134 | } |
135 | 135 | ||
136 | /* | 136 | /* |
137 | * Empty pgd entries point to the invalid_pmd_table. | 137 | * Empty pud entries point to the invalid_pmd_table. |
138 | */ | 138 | */ |
139 | static inline int pud_none(pud_t pud) | 139 | static inline int pud_none(pud_t pud) |
140 | { | 140 | { |
@@ -166,12 +166,13 @@ static inline void pud_clear(pud_t *pudp) | |||
166 | #endif | 166 | #endif |
167 | 167 | ||
168 | #define __pgd_offset(address) pgd_index(address) | 168 | #define __pgd_offset(address) pgd_index(address) |
169 | #define __pud_offset(address) (((address) >> PUD_SHIFT) & (PTRS_PER_PUD-1)) | ||
169 | #define page_pte(page) page_pte_prot(page, __pgprot(0)) | 170 | #define page_pte(page) page_pte_prot(page, __pgprot(0)) |
170 | 171 | ||
171 | /* to find an entry in a kernel page-table-directory */ | 172 | /* to find an entry in a kernel page-table-directory */ |
172 | #define pgd_offset_k(address) pgd_offset(&init_mm, 0) | 173 | #define pgd_offset_k(address) pgd_offset(&init_mm, 0) |
173 | 174 | ||
174 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) | 175 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) |
175 | 176 | ||
176 | /* to find an entry in a page-table-directory */ | 177 | /* to find an entry in a page-table-directory */ |
177 | #define pgd_offset(mm,addr) ((mm)->pgd + pgd_index(addr)) | 178 | #define pgd_offset(mm,addr) ((mm)->pgd + pgd_index(addr)) |