diff options
author | David S. Miller <davem@davemloft.net> | 2008-09-12 03:19:21 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-09-12 03:19:21 -0400 |
commit | af1ee569d32e4dec5d14758ce025cc374088394d (patch) | |
tree | 6c102a08b17fced8efb6b7dcb8c6fb73da1f4aca /arch/sparc64 | |
parent | b539c4676600dc25c2cd9322ff6bff2c2d455161 (diff) |
sparc64: Kill sparse warnings in mm/init.h
1) Several exported symbols need extern decls, they are exported
not for C code but for assembler routines.
2) PAGE_EXEC isn't used, delete
3) Several larger than 32-bit constants need "UL" markers
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc64')
-rw-r--r-- | arch/sparc64/mm/init.c | 36 | ||||
-rw-r--r-- | arch/sparc64/mm/init.h | 49 |
2 files changed, 56 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); |
diff --git a/arch/sparc64/mm/init.h b/arch/sparc64/mm/init.h new file mode 100644 index 000000000000..16063870a489 --- /dev/null +++ b/arch/sparc64/mm/init.h | |||
@@ -0,0 +1,49 @@ | |||
1 | #ifndef _SPARC64_MM_INIT_H | ||
2 | #define _SPARC64_MM_INIT_H | ||
3 | |||
4 | /* Most of the symbols in this file are defined in init.c and | ||
5 | * marked non-static so that assembler code can get at them. | ||
6 | */ | ||
7 | |||
8 | #define MAX_PHYS_ADDRESS (1UL << 42UL) | ||
9 | #define KPTE_BITMAP_CHUNK_SZ (256UL * 1024UL * 1024UL) | ||
10 | #define KPTE_BITMAP_BYTES \ | ||
11 | ((MAX_PHYS_ADDRESS / KPTE_BITMAP_CHUNK_SZ) / 8) | ||
12 | |||
13 | extern unsigned long kern_linear_pte_xor[2]; | ||
14 | extern unsigned long kpte_linear_bitmap[KPTE_BITMAP_BYTES / sizeof(unsigned long)]; | ||
15 | extern unsigned int sparc64_highest_unlocked_tlb_ent; | ||
16 | extern unsigned long sparc64_kern_pri_context; | ||
17 | extern unsigned long sparc64_kern_pri_nuc_bits; | ||
18 | extern unsigned long sparc64_kern_sec_context; | ||
19 | extern void mmu_info(struct seq_file *m); | ||
20 | |||
21 | struct linux_prom_translation { | ||
22 | unsigned long virt; | ||
23 | unsigned long size; | ||
24 | unsigned long data; | ||
25 | }; | ||
26 | |||
27 | /* Exported for kernel TLB miss handling in ktlb.S */ | ||
28 | extern struct linux_prom_translation prom_trans[512]; | ||
29 | extern unsigned int prom_trans_ents; | ||
30 | |||
31 | /* Exported for SMP bootup purposes. */ | ||
32 | extern unsigned long kern_locked_tte_data; | ||
33 | |||
34 | extern void prom_world(int enter); | ||
35 | |||
36 | extern void free_initmem(void); | ||
37 | |||
38 | #ifdef CONFIG_SPARSEMEM_VMEMMAP | ||
39 | #define VMEMMAP_CHUNK_SHIFT 22 | ||
40 | #define VMEMMAP_CHUNK (1UL << VMEMMAP_CHUNK_SHIFT) | ||
41 | #define VMEMMAP_CHUNK_MASK ~(VMEMMAP_CHUNK - 1UL) | ||
42 | #define VMEMMAP_ALIGN(x) (((x)+VMEMMAP_CHUNK-1UL)&VMEMMAP_CHUNK_MASK) | ||
43 | |||
44 | #define VMEMMAP_SIZE ((((1UL << MAX_PHYSADDR_BITS) >> PAGE_SHIFT) * \ | ||
45 | sizeof(struct page *)) >> VMEMMAP_CHUNK_SHIFT) | ||
46 | extern unsigned long vmemmap_table[VMEMMAP_SIZE]; | ||
47 | #endif | ||
48 | |||
49 | #endif /* _SPARC64_MM_INIT_H */ | ||