diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-07-04 13:35:12 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-07-04 13:35:12 -0400 |
commit | de481ba925e880764e38b8756c93c05006892507 (patch) | |
tree | 8ed982c9440f75e3899ea0d4e62bb83f2947fdf9 /arch/parisc/mm/init.c | |
parent | dd0888c264c0d5feb5d86eb69c1fdbcdb42566af (diff) | |
parent | 64daa4435a40aa1b7d0ece598ae783b89dda13ee (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/kyle/parisc-2.6: (27 commits)
parisc: use generic atomic64 on 32-bit
parisc: superio: fix build breakage
parisc: Fix PCI resource allocation on non-PAT SBA machines
parisc: perf: wire up sys_perf_counter_open
parisc: add task_pt_regs macro
parisc: wire sys_perf_counter_open to sys_ni_syscall
parisc: inventory.c, fix bloated stack frame
parisc: processor.c, fix bloated stack frame
parisc: fix compile warning in mm/init.c
parisc: remove dead code from sys_parisc32.c
parisc: wire up rt_tgsigqueueinfo
parisc: ensure broadcast tlb purge runs single threaded
parisc: fix "delay!" timer handling
parisc: fix mismatched parenthesis in memcpy.c
parisc: Fix gcc 4.4 warning in lba_pci.c
parisc: add parameter to read_cr16()
parisc: decode_exc.c should include kernel.h
parisc: remove obsolete hw_interrupt_type
parisc: fix irq compile bugs in arch/parisc/kernel/irq.c
parisc: advertise PCI devs after "assign_resources"
...
Manually fixed up trivial conflicts in tools/perf/perf.h due to addition
of SH vs HPPA perf-counter support.
Diffstat (limited to 'arch/parisc/mm/init.c')
-rw-r--r-- | arch/parisc/mm/init.c | 29 |
1 files changed, 9 insertions, 20 deletions
diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c index 4356ceb1e366..b0831d9e35cb 100644 --- a/arch/parisc/mm/init.c +++ b/arch/parisc/mm/init.c | |||
@@ -370,34 +370,22 @@ static void __init setup_bootmem(void) | |||
370 | 370 | ||
371 | void free_initmem(void) | 371 | void free_initmem(void) |
372 | { | 372 | { |
373 | unsigned long addr, init_begin, init_end; | 373 | unsigned long addr; |
374 | 374 | unsigned long init_begin = (unsigned long)__init_begin; | |
375 | printk(KERN_INFO "Freeing unused kernel memory: "); | 375 | unsigned long init_end = (unsigned long)__init_end; |
376 | 376 | ||
377 | #ifdef CONFIG_DEBUG_KERNEL | 377 | #ifdef CONFIG_DEBUG_KERNEL |
378 | /* Attempt to catch anyone trying to execute code here | 378 | /* Attempt to catch anyone trying to execute code here |
379 | * by filling the page with BRK insns. | 379 | * by filling the page with BRK insns. |
380 | * | ||
381 | * If we disable interrupts for all CPUs, then IPI stops working. | ||
382 | * Kinda breaks the global cache flushing. | ||
383 | */ | 380 | */ |
384 | local_irq_disable(); | 381 | memset((void *)init_begin, 0x00, init_end - init_begin); |
385 | 382 | flush_icache_range(init_begin, init_end); | |
386 | memset(__init_begin, 0x00, | ||
387 | (unsigned long)__init_end - (unsigned long)__init_begin); | ||
388 | |||
389 | flush_data_cache(); | ||
390 | asm volatile("sync" : : ); | ||
391 | flush_icache_range((unsigned long)__init_begin, (unsigned long)__init_end); | ||
392 | asm volatile("sync" : : ); | ||
393 | |||
394 | local_irq_enable(); | ||
395 | #endif | 383 | #endif |
396 | 384 | ||
397 | /* align __init_begin and __init_end to page size, | 385 | /* align __init_begin and __init_end to page size, |
398 | ignoring linker script where we might have tried to save RAM */ | 386 | ignoring linker script where we might have tried to save RAM */ |
399 | init_begin = PAGE_ALIGN((unsigned long)(__init_begin)); | 387 | init_begin = PAGE_ALIGN(init_begin); |
400 | init_end = PAGE_ALIGN((unsigned long)(__init_end)); | 388 | init_end = PAGE_ALIGN(init_end); |
401 | for (addr = init_begin; addr < init_end; addr += PAGE_SIZE) { | 389 | for (addr = init_begin; addr < init_end; addr += PAGE_SIZE) { |
402 | ClearPageReserved(virt_to_page(addr)); | 390 | ClearPageReserved(virt_to_page(addr)); |
403 | init_page_count(virt_to_page(addr)); | 391 | init_page_count(virt_to_page(addr)); |
@@ -409,7 +397,8 @@ void free_initmem(void) | |||
409 | /* set up a new led state on systems shipped LED State panel */ | 397 | /* set up a new led state on systems shipped LED State panel */ |
410 | pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE); | 398 | pdc_chassis_send_status(PDC_CHASSIS_DIRECT_BCOMPLETE); |
411 | 399 | ||
412 | printk("%luk freed\n", (init_end - init_begin) >> 10); | 400 | printk(KERN_INFO "Freeing unused kernel memory: %luk freed\n", |
401 | (init_end - init_begin) >> 10); | ||
413 | } | 402 | } |
414 | 403 | ||
415 | 404 | ||