memblock: replace free_bootmem{_node} with memblock_free
[linux-2.6-block.git] / arch / x86 / kernel / setup_percpu.c
index ea554f812ee18e46289bb1fc9b65cc7408189a74..a006f1ba4c39d93005210667b22ea01f0a51164f 100644 (file)
@@ -5,6 +5,7 @@
 #include <linux/export.h>
 #include <linux/init.h>
 #include <linux/bootmem.h>
+#include <linux/memblock.h>
 #include <linux/percpu.h>
 #include <linux/kexec.h>
 #include <linux/crash_dump.h>
@@ -106,20 +107,22 @@ static void * __init pcpu_alloc_bootmem(unsigned int cpu, unsigned long size,
        void *ptr;
 
        if (!node_online(node) || !NODE_DATA(node)) {
-               ptr = __alloc_bootmem_nopanic(size, align, goal);
+               ptr = memblock_alloc_from_nopanic(size, align, goal);
                pr_info("cpu %d has no node %d or node-local memory\n",
                        cpu, node);
                pr_debug("per cpu data for cpu%d %lu bytes at %016lx\n",
                         cpu, size, __pa(ptr));
        } else {
-               ptr = __alloc_bootmem_node_nopanic(NODE_DATA(node),
-                                                  size, align, goal);
+               ptr = memblock_alloc_try_nid_nopanic(size, align, goal,
+                                                    BOOTMEM_ALLOC_ACCESSIBLE,
+                                                    node);
+
                pr_debug("per cpu data for cpu%d %lu bytes on node%d at %016lx\n",
                         cpu, size, node, __pa(ptr));
        }
        return ptr;
 #else
-       return __alloc_bootmem_nopanic(size, align, goal);
+       return memblock_alloc_from_nopanic(size, align, goal);
 #endif
 }
 
@@ -133,7 +136,7 @@ static void * __init pcpu_fc_alloc(unsigned int cpu, size_t size, size_t align)
 
 static void __init pcpu_fc_free(void *ptr, size_t size)
 {
-       free_bootmem(__pa(ptr), size);
+       memblock_free(__pa(ptr), size);
 }
 
 static int __init pcpu_cpu_distance(unsigned int from, unsigned int to)