]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/sh/mm/init.c
sh: Fix compile error of arch/sh/mm/pmb.c
[linux-2.6-omap-h63xx.git] / arch / sh / mm / init.c
index 2032b39c229aa83839854622e98591065568332c..79c309780f953a16bf65c621aae490ffe10e9c8d 100644 (file)
 #include <asm/mmu_context.h>
 #include <asm/tlb.h>
 #include <asm/cacheflush.h>
+#include <asm/sections.h>
 #include <asm/cache.h>
 
 DEFINE_PER_CPU(struct mmu_gather, mmu_gathers);
 pgd_t swapper_pg_dir[PTRS_PER_PGD];
 
-void (*copy_page)(void *from, void *to);
-void (*clear_page)(void *to);
-
 void show_mem(void)
 {
        int total = 0, reserved = 0, free = 0;
@@ -132,11 +130,6 @@ void __set_fixmap(enum fixed_addresses idx, unsigned long phys, pgprot_t prot)
 }
 #endif /* CONFIG_MMU */
 
-/* References to section boundaries */
-
-extern char _text, _etext, _edata, __bss_start, _end;
-extern char __init_begin, __init_end;
-
 /*
  * paging_init() sets up the page tables
  */
@@ -174,6 +167,7 @@ void __init paging_init(void)
 }
 
 static struct kcore_list kcore_mem, kcore_vmalloc;
+int after_bootmem = 0;
 
 void __init mem_init(void)
 {
@@ -206,17 +200,7 @@ void __init mem_init(void)
        memset(empty_zero_page, 0, PAGE_SIZE);
        __flush_wback_region(empty_zero_page, PAGE_SIZE);
 
-       /*
-        * Setup wrappers for copy/clear_page(), these will get overridden
-        * later in the boot process if a better method is available.
-        */
-#ifdef CONFIG_MMU
-       copy_page = copy_page_slow;
-       clear_page = clear_page_slow;
-#else
-       copy_page = copy_page_nommu;
-       clear_page = clear_page_nommu;
-#endif
+       after_bootmem = 1;
 
        codesize =  (unsigned long) &_etext - (unsigned long) &_text;
        datasize =  (unsigned long) &_edata - (unsigned long) &_etext;
@@ -251,8 +235,9 @@ void free_initmem(void)
                free_page(addr);
                totalram_pages++;
        }
-       printk("Freeing unused kernel memory: %dk freed\n",
-              (&__init_end - &__init_begin) >> 10);
+       printk("Freeing unused kernel memory: %ldk freed\n",
+              ((unsigned long)&__init_end -
+               (unsigned long)&__init_begin) >> 10);
 }
 
 #ifdef CONFIG_BLK_DEV_INITRD
@@ -268,3 +253,41 @@ void free_initrd_mem(unsigned long start, unsigned long end)
        printk("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
 }
 #endif
+
+#ifdef CONFIG_MEMORY_HOTPLUG
+void online_page(struct page *page)
+{
+       ClearPageReserved(page);
+       init_page_count(page);
+       __free_page(page);
+       totalram_pages++;
+       num_physpages++;
+}
+
+int arch_add_memory(int nid, u64 start, u64 size)
+{
+       pg_data_t *pgdat;
+       unsigned long start_pfn = start >> PAGE_SHIFT;
+       unsigned long nr_pages = size >> PAGE_SHIFT;
+       int ret;
+
+       pgdat = NODE_DATA(nid);
+
+       /* We only have ZONE_NORMAL, so this is easy.. */
+       ret = __add_pages(pgdat->node_zones + ZONE_NORMAL, start_pfn, nr_pages);
+       if (unlikely(ret))
+               printk("%s: Failed, __add_pages() == %d\n", __FUNCTION__, ret);
+
+       return ret;
+}
+EXPORT_SYMBOL_GPL(arch_add_memory);
+
+#ifdef CONFIG_NUMA
+int memory_add_physaddr_to_nid(u64 addr)
+{
+       /* Node 0 for now.. */
+       return 0;
+}
+EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
+#endif
+#endif