diff options
Diffstat (limited to 'include/asm-mips/pgtable-64.h')
-rw-r--r-- | include/asm-mips/pgtable-64.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/asm-mips/pgtable-64.h b/include/asm-mips/pgtable-64.h index 7e7320300aa3..b9b1e86493ee 100644 --- a/include/asm-mips/pgtable-64.h +++ b/include/asm-mips/pgtable-64.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <asm/addrspace.h> | 14 | #include <asm/addrspace.h> |
15 | #include <asm/page.h> | 15 | #include <asm/page.h> |
16 | #include <asm/cachectl.h> | 16 | #include <asm/cachectl.h> |
17 | #include <asm/fixmap.h> | ||
17 | 18 | ||
18 | #include <asm-generic/pgtable-nopud.h> | 19 | #include <asm-generic/pgtable-nopud.h> |
19 | 20 | ||
@@ -103,6 +104,13 @@ | |||
103 | #define VMALLOC_START MAP_BASE | 104 | #define VMALLOC_START MAP_BASE |
104 | #define VMALLOC_END \ | 105 | #define VMALLOC_END \ |
105 | (VMALLOC_START + PTRS_PER_PGD * PTRS_PER_PMD * PTRS_PER_PTE * PAGE_SIZE) | 106 | (VMALLOC_START + PTRS_PER_PGD * PTRS_PER_PMD * PTRS_PER_PTE * PAGE_SIZE) |
107 | #if defined(CONFIG_MODULES) && !defined(CONFIG_BUILD_ELF64) && \ | ||
108 | VMALLOC_START != CKSSEG | ||
109 | /* Load modules into 32bit-compatible segment. */ | ||
110 | #define MODULE_START CKSSEG | ||
111 | #define MODULE_END (FIXADDR_START-2*PAGE_SIZE) | ||
112 | extern pgd_t module_pg_dir[PTRS_PER_PGD]; | ||
113 | #endif | ||
106 | 114 | ||
107 | #define pte_ERROR(e) \ | 115 | #define pte_ERROR(e) \ |
108 | printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e)) | 116 | printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e)) |
@@ -174,7 +182,12 @@ static inline void pud_clear(pud_t *pudp) | |||
174 | #define __pmd_offset(address) pmd_index(address) | 182 | #define __pmd_offset(address) pmd_index(address) |
175 | 183 | ||
176 | /* to find an entry in a kernel page-table-directory */ | 184 | /* to find an entry in a kernel page-table-directory */ |
185 | #ifdef MODULE_START | ||
186 | #define pgd_offset_k(address) \ | ||
187 | ((address) >= MODULE_START ? module_pg_dir : pgd_offset(&init_mm, 0UL)) | ||
188 | #else | ||
177 | #define pgd_offset_k(address) pgd_offset(&init_mm, 0UL) | 189 | #define pgd_offset_k(address) pgd_offset(&init_mm, 0UL) |
190 | #endif | ||
178 | 191 | ||
179 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) | 192 | #define pgd_index(address) (((address) >> PGDIR_SHIFT) & (PTRS_PER_PGD-1)) |
180 | #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) | 193 | #define pmd_index(address) (((address) >> PMD_SHIFT) & (PTRS_PER_PMD-1)) |