diff options
Diffstat (limited to 'arch/sparc64/mm/init.c')
-rw-r--r-- | arch/sparc64/mm/init.c | 36 |
1 files changed, 7 insertions, 29 deletions
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index 4fb9de00fc8a..3c10daf8fc01 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c | |||
@@ -50,10 +50,7 @@ | |||
50 | #include <asm/cpudata.h> | 50 | #include <asm/cpudata.h> |
51 | #include <asm/irq.h> | 51 | #include <asm/irq.h> |
52 | 52 | ||
53 | #define MAX_PHYS_ADDRESS (1UL << 42UL) | 53 | #include "init.h" |
54 | #define KPTE_BITMAP_CHUNK_SZ (256UL * 1024UL * 1024UL) | ||
55 | #define KPTE_BITMAP_BYTES \ | ||
56 | ((MAX_PHYS_ADDRESS / KPTE_BITMAP_CHUNK_SZ) / 8) | ||
57 | 54 | ||
58 | unsigned long kern_linear_pte_xor[2] __read_mostly; | 55 | unsigned long kern_linear_pte_xor[2] __read_mostly; |
59 | 56 | ||
@@ -415,17 +412,9 @@ void mmu_info(struct seq_file *m) | |||
415 | #endif /* CONFIG_DEBUG_DCFLUSH */ | 412 | #endif /* CONFIG_DEBUG_DCFLUSH */ |
416 | } | 413 | } |
417 | 414 | ||
418 | struct linux_prom_translation { | ||
419 | unsigned long virt; | ||
420 | unsigned long size; | ||
421 | unsigned long data; | ||
422 | }; | ||
423 | |||
424 | /* Exported for kernel TLB miss handling in ktlb.S */ | ||
425 | struct linux_prom_translation prom_trans[512] __read_mostly; | 415 | struct linux_prom_translation prom_trans[512] __read_mostly; |
426 | unsigned int prom_trans_ents __read_mostly; | 416 | unsigned int prom_trans_ents __read_mostly; |
427 | 417 | ||
428 | /* Exported for SMP bootup purposes. */ | ||
429 | unsigned long kern_locked_tte_data; | 418 | unsigned long kern_locked_tte_data; |
430 | 419 | ||
431 | /* The obp translations are saved based on 8k pagesize, since obp can | 420 | /* The obp translations are saved based on 8k pagesize, since obp can |
@@ -2064,7 +2053,6 @@ pgprot_t PAGE_COPY __read_mostly; | |||
2064 | pgprot_t PAGE_SHARED __read_mostly; | 2053 | pgprot_t PAGE_SHARED __read_mostly; |
2065 | EXPORT_SYMBOL(PAGE_SHARED); | 2054 | EXPORT_SYMBOL(PAGE_SHARED); |
2066 | 2055 | ||
2067 | pgprot_t PAGE_EXEC __read_mostly; | ||
2068 | unsigned long pg_iobits __read_mostly; | 2056 | unsigned long pg_iobits __read_mostly; |
2069 | 2057 | ||
2070 | unsigned long _PAGE_IE __read_mostly; | 2058 | unsigned long _PAGE_IE __read_mostly; |
@@ -2077,14 +2065,6 @@ unsigned long _PAGE_CACHE __read_mostly; | |||
2077 | EXPORT_SYMBOL(_PAGE_CACHE); | 2065 | EXPORT_SYMBOL(_PAGE_CACHE); |
2078 | 2066 | ||
2079 | #ifdef CONFIG_SPARSEMEM_VMEMMAP | 2067 | #ifdef CONFIG_SPARSEMEM_VMEMMAP |
2080 | |||
2081 | #define VMEMMAP_CHUNK_SHIFT 22 | ||
2082 | #define VMEMMAP_CHUNK (1UL << VMEMMAP_CHUNK_SHIFT) | ||
2083 | #define VMEMMAP_CHUNK_MASK ~(VMEMMAP_CHUNK - 1UL) | ||
2084 | #define VMEMMAP_ALIGN(x) (((x)+VMEMMAP_CHUNK-1UL)&VMEMMAP_CHUNK_MASK) | ||
2085 | |||
2086 | #define VMEMMAP_SIZE ((((1UL << MAX_PHYSADDR_BITS) >> PAGE_SHIFT) * \ | ||
2087 | sizeof(struct page *)) >> VMEMMAP_CHUNK_SHIFT) | ||
2088 | unsigned long vmemmap_table[VMEMMAP_SIZE]; | 2068 | unsigned long vmemmap_table[VMEMMAP_SIZE]; |
2089 | 2069 | ||
2090 | int __meminit vmemmap_populate(struct page *start, unsigned long nr, int node) | 2070 | int __meminit vmemmap_populate(struct page *start, unsigned long nr, int node) |
@@ -2168,7 +2148,6 @@ static void __init sun4u_pgprot_init(void) | |||
2168 | _PAGE_CACHE_4U | _PAGE_P_4U | | 2148 | _PAGE_CACHE_4U | _PAGE_P_4U | |
2169 | __ACCESS_BITS_4U | __DIRTY_BITS_4U | | 2149 | __ACCESS_BITS_4U | __DIRTY_BITS_4U | |
2170 | _PAGE_EXEC_4U | _PAGE_L_4U); | 2150 | _PAGE_EXEC_4U | _PAGE_L_4U); |
2171 | PAGE_EXEC = __pgprot(_PAGE_EXEC_4U); | ||
2172 | 2151 | ||
2173 | _PAGE_IE = _PAGE_IE_4U; | 2152 | _PAGE_IE = _PAGE_IE_4U; |
2174 | _PAGE_E = _PAGE_E_4U; | 2153 | _PAGE_E = _PAGE_E_4U; |
@@ -2179,10 +2158,10 @@ static void __init sun4u_pgprot_init(void) | |||
2179 | 2158 | ||
2180 | #ifdef CONFIG_DEBUG_PAGEALLOC | 2159 | #ifdef CONFIG_DEBUG_PAGEALLOC |
2181 | kern_linear_pte_xor[0] = (_PAGE_VALID | _PAGE_SZBITS_4U) ^ | 2160 | kern_linear_pte_xor[0] = (_PAGE_VALID | _PAGE_SZBITS_4U) ^ |
2182 | 0xfffff80000000000; | 2161 | 0xfffff80000000000UL; |
2183 | #else | 2162 | #else |
2184 | kern_linear_pte_xor[0] = (_PAGE_VALID | _PAGE_SZ4MB_4U) ^ | 2163 | kern_linear_pte_xor[0] = (_PAGE_VALID | _PAGE_SZ4MB_4U) ^ |
2185 | 0xfffff80000000000; | 2164 | 0xfffff80000000000UL; |
2186 | #endif | 2165 | #endif |
2187 | kern_linear_pte_xor[0] |= (_PAGE_CP_4U | _PAGE_CV_4U | | 2166 | kern_linear_pte_xor[0] |= (_PAGE_CP_4U | _PAGE_CV_4U | |
2188 | _PAGE_P_4U | _PAGE_W_4U); | 2167 | _PAGE_P_4U | _PAGE_W_4U); |
@@ -2220,7 +2199,6 @@ static void __init sun4v_pgprot_init(void) | |||
2220 | __ACCESS_BITS_4V | __DIRTY_BITS_4V | | 2199 | __ACCESS_BITS_4V | __DIRTY_BITS_4V | |
2221 | _PAGE_EXEC_4V); | 2200 | _PAGE_EXEC_4V); |
2222 | PAGE_KERNEL_LOCKED = PAGE_KERNEL; | 2201 | PAGE_KERNEL_LOCKED = PAGE_KERNEL; |
2223 | PAGE_EXEC = __pgprot(_PAGE_EXEC_4V); | ||
2224 | 2202 | ||
2225 | _PAGE_IE = _PAGE_IE_4V; | 2203 | _PAGE_IE = _PAGE_IE_4V; |
2226 | _PAGE_E = _PAGE_E_4V; | 2204 | _PAGE_E = _PAGE_E_4V; |
@@ -2228,20 +2206,20 @@ static void __init sun4v_pgprot_init(void) | |||
2228 | 2206 | ||
2229 | #ifdef CONFIG_DEBUG_PAGEALLOC | 2207 | #ifdef CONFIG_DEBUG_PAGEALLOC |
2230 | kern_linear_pte_xor[0] = (_PAGE_VALID | _PAGE_SZBITS_4V) ^ | 2208 | kern_linear_pte_xor[0] = (_PAGE_VALID | _PAGE_SZBITS_4V) ^ |
2231 | 0xfffff80000000000; | 2209 | 0xfffff80000000000UL; |
2232 | #else | 2210 | #else |
2233 | kern_linear_pte_xor[0] = (_PAGE_VALID | _PAGE_SZ4MB_4V) ^ | 2211 | kern_linear_pte_xor[0] = (_PAGE_VALID | _PAGE_SZ4MB_4V) ^ |
2234 | 0xfffff80000000000; | 2212 | 0xfffff80000000000UL; |
2235 | #endif | 2213 | #endif |
2236 | kern_linear_pte_xor[0] |= (_PAGE_CP_4V | _PAGE_CV_4V | | 2214 | kern_linear_pte_xor[0] |= (_PAGE_CP_4V | _PAGE_CV_4V | |
2237 | _PAGE_P_4V | _PAGE_W_4V); | 2215 | _PAGE_P_4V | _PAGE_W_4V); |
2238 | 2216 | ||
2239 | #ifdef CONFIG_DEBUG_PAGEALLOC | 2217 | #ifdef CONFIG_DEBUG_PAGEALLOC |
2240 | kern_linear_pte_xor[1] = (_PAGE_VALID | _PAGE_SZBITS_4V) ^ | 2218 | kern_linear_pte_xor[1] = (_PAGE_VALID | _PAGE_SZBITS_4V) ^ |
2241 | 0xfffff80000000000; | 2219 | 0xfffff80000000000UL; |
2242 | #else | 2220 | #else |
2243 | kern_linear_pte_xor[1] = (_PAGE_VALID | _PAGE_SZ256MB_4V) ^ | 2221 | kern_linear_pte_xor[1] = (_PAGE_VALID | _PAGE_SZ256MB_4V) ^ |
2244 | 0xfffff80000000000; | 2222 | 0xfffff80000000000UL; |
2245 | #endif | 2223 | #endif |
2246 | kern_linear_pte_xor[1] |= (_PAGE_CP_4V | _PAGE_CV_4V | | 2224 | kern_linear_pte_xor[1] |= (_PAGE_CP_4V | _PAGE_CV_4V | |
2247 | _PAGE_P_4V | _PAGE_W_4V); | 2225 | _PAGE_P_4V | _PAGE_W_4V); |