patch-2.4.21 linux-2.4.21/arch/alpha/mm/init.c
Next file: linux-2.4.21/arch/alpha/mm/numa.c
Previous file: linux-2.4.21/arch/alpha/mm/Makefile
Back to the patch index
Back to the overall index
- Lines: 51
- Date:
2003-06-13 07:51:29.000000000 -0700
- Orig file:
linux-2.4.20/arch/alpha/mm/init.c
- Orig date:
2002-08-02 17:39:42.000000000 -0700
diff -urN linux-2.4.20/arch/alpha/mm/init.c linux-2.4.21/arch/alpha/mm/init.c
@@ -368,18 +368,23 @@
#endif /* CONFIG_DISCONTIGMEM */
void
-free_initmem (void)
+free_reserved_mem(void *start, void *end)
{
- extern char __init_begin, __init_end;
- unsigned long addr;
-
- addr = (unsigned long)(&__init_begin);
- for (; addr < (unsigned long)(&__init_end); addr += PAGE_SIZE) {
- ClearPageReserved(virt_to_page(addr));
- set_page_count(virt_to_page(addr), 1);
- free_page(addr);
+ void *__start = start;
+ for (; __start < end; __start += PAGE_SIZE) {
+ ClearPageReserved(virt_to_page(__start));
+ set_page_count(virt_to_page(__start), 1);
+ free_page((long)__start);
totalram_pages++;
}
+}
+
+void
+free_initmem(void)
+{
+ extern char __init_begin, __init_end;
+
+ free_reserved_mem(&__init_begin, &__init_end);
printk (KERN_INFO "Freeing unused kernel memory: %ldk freed\n",
(&__init_end - &__init_begin) >> 10);
}
@@ -388,14 +393,9 @@
void
free_initrd_mem(unsigned long start, unsigned long end)
{
- unsigned long __start = start;
- for (; start < end; start += PAGE_SIZE) {
- ClearPageReserved(virt_to_page(start));
- set_page_count(virt_to_page(start), 1);
- free_page(start);
- totalram_pages++;
- }
- printk (KERN_INFO "Freeing initrd memory: %ldk freed\n", (end - __start) >> 10);
+ free_reserved_mem((void *)start, (void *)end);
+ printk(KERN_INFO "Freeing initrd memory: %ldk freed\n",
+ (end - start) >> 10);
}
#endif
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)