aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/init_64.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-03-03 20:29:19 -0500
committerIngo Molnar <mingo@elte.hu>2009-03-03 20:29:19 -0500
commit91d75e209bd59695f0708d66964d928d45b3b2f3 (patch)
tree32cab1359d951e4193bebb181a0f0319824a2b95 /arch/x86/mm/init_64.c
parent9976b39b5031bbf76f715893cf080b6a17683881 (diff)
parent8b0e5860cb099d7958d13b00ffbc35ad02735700 (diff)
Merge branch 'x86/core' into core/percpu
Diffstat (limited to 'arch/x86/mm/init_64.c')
-rw-r--r--arch/x86/mm/init_64.c39
1 files changed, 2 insertions, 37 deletions
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index 7d4e76da3368..11981fc8570a 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -748,6 +748,8 @@ unsigned long __init_refok init_memory_mapping(unsigned long start,
748 pos = start_pfn << PAGE_SHIFT; 748 pos = start_pfn << PAGE_SHIFT;
749 end_pfn = ((pos + (PMD_SIZE - 1)) >> PMD_SHIFT) 749 end_pfn = ((pos + (PMD_SIZE - 1)) >> PMD_SHIFT)
750 << (PMD_SHIFT - PAGE_SHIFT); 750 << (PMD_SHIFT - PAGE_SHIFT);
751 if (end_pfn > (end >> PAGE_SHIFT))
752 end_pfn = end >> PAGE_SHIFT;
751 if (start_pfn < end_pfn) { 753 if (start_pfn < end_pfn) {
752 nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0); 754 nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0);
753 pos = end_pfn << PAGE_SHIFT; 755 pos = end_pfn << PAGE_SHIFT;
@@ -979,43 +981,6 @@ void __init mem_init(void)
979 initsize >> 10); 981 initsize >> 10);
980} 982}
981 983
982void free_init_pages(char *what, unsigned long begin, unsigned long end)
983{
984 unsigned long addr = begin;
985
986 if (addr >= end)
987 return;
988
989 /*
990 * If debugging page accesses then do not free this memory but
991 * mark them not present - any buggy init-section access will
992 * create a kernel page fault:
993 */
994#ifdef CONFIG_DEBUG_PAGEALLOC
995 printk(KERN_INFO "debug: unmapping init memory %08lx..%08lx\n",
996 begin, PAGE_ALIGN(end));
997 set_memory_np(begin, (end - begin) >> PAGE_SHIFT);
998#else
999 printk(KERN_INFO "Freeing %s: %luk freed\n", what, (end - begin) >> 10);
1000
1001 for (; addr < end; addr += PAGE_SIZE) {
1002 ClearPageReserved(virt_to_page(addr));
1003 init_page_count(virt_to_page(addr));
1004 memset((void *)(addr & ~(PAGE_SIZE-1)),
1005 POISON_FREE_INITMEM, PAGE_SIZE);
1006 free_page(addr);
1007 totalram_pages++;
1008 }
1009#endif
1010}
1011
1012void free_initmem(void)
1013{
1014 free_init_pages("unused kernel memory",
1015 (unsigned long)(&__init_begin),
1016 (unsigned long)(&__init_end));
1017}
1018
1019#ifdef CONFIG_DEBUG_RODATA 984#ifdef CONFIG_DEBUG_RODATA
1020const int rodata_test_data = 0xC3; 985const int rodata_test_data = 0xC3;
1021EXPORT_SYMBOL_GPL(rodata_test_data); 986EXPORT_SYMBOL_GPL(rodata_test_data);