diff options
Diffstat (limited to 'arch/x86/mm/init_64.c')
-rw-r--r-- | arch/x86/mm/init_64.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 03da9030d0ee..aae87456d930 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -945,50 +945,6 @@ void __init mem_init(void) | |||
945 | initsize >> 10); | 945 | initsize >> 10); |
946 | } | 946 | } |
947 | 947 | ||
948 | void free_init_pages(char *what, unsigned long begin, unsigned long end) | ||
949 | { | ||
950 | unsigned long addr = begin; | ||
951 | |||
952 | if (addr >= end) | ||
953 | return; | ||
954 | |||
955 | /* | ||
956 | * If debugging page accesses then do not free this memory but | ||
957 | * mark them not present - any buggy init-section access will | ||
958 | * create a kernel page fault: | ||
959 | */ | ||
960 | #ifdef CONFIG_DEBUG_PAGEALLOC | ||
961 | printk(KERN_INFO "debug: unmapping init memory %08lx..%08lx\n", | ||
962 | begin, PAGE_ALIGN(end)); | ||
963 | set_memory_np(begin, (end - begin) >> PAGE_SHIFT); | ||
964 | #else | ||
965 | /* | ||
966 | * We just marked the kernel text read only above, now that | ||
967 | * we are going to free part of that, we need to make that | ||
968 | * writeable first. | ||
969 | */ | ||
970 | set_memory_rw(begin, (end - begin) >> PAGE_SHIFT); | ||
971 | |||
972 | printk(KERN_INFO "Freeing %s: %luk freed\n", what, (end - begin) >> 10); | ||
973 | |||
974 | for (; addr < end; addr += PAGE_SIZE) { | ||
975 | ClearPageReserved(virt_to_page(addr)); | ||
976 | init_page_count(virt_to_page(addr)); | ||
977 | memset((void *)(addr & ~(PAGE_SIZE-1)), | ||
978 | POISON_FREE_INITMEM, PAGE_SIZE); | ||
979 | free_page(addr); | ||
980 | totalram_pages++; | ||
981 | } | ||
982 | #endif | ||
983 | } | ||
984 | |||
985 | void free_initmem(void) | ||
986 | { | ||
987 | free_init_pages("unused kernel memory", | ||
988 | (unsigned long)(&__init_begin), | ||
989 | (unsigned long)(&__init_end)); | ||
990 | } | ||
991 | |||
992 | #ifdef CONFIG_DEBUG_RODATA | 948 | #ifdef CONFIG_DEBUG_RODATA |
993 | const int rodata_test_data = 0xC3; | 949 | const int rodata_test_data = 0xC3; |
994 | EXPORT_SYMBOL_GPL(rodata_test_data); | 950 | EXPORT_SYMBOL_GPL(rodata_test_data); |