diff options
Diffstat (limited to 'arch/sparc64/mm')
-rw-r--r-- | arch/sparc64/mm/init.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index 977698269d3a..087cbf09d0b7 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c | |||
@@ -191,12 +191,9 @@ inline void flush_dcache_page_impl(struct page *page) | |||
191 | } | 191 | } |
192 | 192 | ||
193 | #define PG_dcache_dirty PG_arch_1 | 193 | #define PG_dcache_dirty PG_arch_1 |
194 | #define PG_dcache_cpu_shift 24UL | 194 | #define PG_dcache_cpu_shift 32UL |
195 | #define PG_dcache_cpu_mask (256UL - 1UL) | 195 | #define PG_dcache_cpu_mask \ |
196 | 196 | ((1UL<<ilog2(roundup_pow_of_two(NR_CPUS)))-1UL) | |
197 | #if NR_CPUS > 256 | ||
198 | #error D-cache dirty tracking and thread_info->cpu need fixing for > 256 cpus | ||
199 | #endif | ||
200 | 197 | ||
201 | #define dcache_dirty_cpu(page) \ | 198 | #define dcache_dirty_cpu(page) \ |
202 | (((page)->flags >> PG_dcache_cpu_shift) & PG_dcache_cpu_mask) | 199 | (((page)->flags >> PG_dcache_cpu_shift) & PG_dcache_cpu_mask) |
@@ -1349,6 +1346,19 @@ void __init paging_init(void) | |||
1349 | unsigned long end_pfn, pages_avail, shift, phys_base; | 1346 | unsigned long end_pfn, pages_avail, shift, phys_base; |
1350 | unsigned long real_end, i; | 1347 | unsigned long real_end, i; |
1351 | 1348 | ||
1349 | /* These build time checkes make sure that the dcache_dirty_cpu() | ||
1350 | * page->flags usage will work. | ||
1351 | * | ||
1352 | * When a page gets marked as dcache-dirty, we store the | ||
1353 | * cpu number starting at bit 32 in the page->flags. Also, | ||
1354 | * functions like clear_dcache_dirty_cpu use the cpu mask | ||
1355 | * in 13-bit signed-immediate instruction fields. | ||
1356 | */ | ||
1357 | BUILD_BUG_ON(FLAGS_RESERVED != 32); | ||
1358 | BUILD_BUG_ON(SECTIONS_WIDTH + NODES_WIDTH + ZONES_WIDTH + | ||
1359 | ilog2(roundup_pow_of_two(NR_CPUS)) > FLAGS_RESERVED); | ||
1360 | BUILD_BUG_ON(NR_CPUS > 4096); | ||
1361 | |||
1352 | kern_base = (prom_boot_mapping_phys_low >> 22UL) << 22UL; | 1362 | kern_base = (prom_boot_mapping_phys_low >> 22UL) << 22UL; |
1353 | kern_size = (unsigned long)&_end - (unsigned long)KERNBASE; | 1363 | kern_size = (unsigned long)&_end - (unsigned long)KERNBASE; |
1354 | 1364 | ||