Merge branch 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[pandora-kernel.git] / arch / x86 / kernel / apic / numaq_32.c
index 6273eee..c4a61ca 100644 (file)
@@ -48,8 +48,6 @@
 #include <asm/e820.h>
 #include <asm/ipi.h>
 
-#define        MB_TO_PAGES(addr)               ((addr) << (20 - PAGE_SHIFT))
-
 int found_numaq;
 
 /*
@@ -79,31 +77,20 @@ int                                 quad_local_to_mp_bus_id[NR_CPUS/4][4];
 static inline void numaq_register_node(int node, struct sys_cfg_data *scd)
 {
        struct eachquadmem *eq = scd->eq + node;
+       u64 start = (u64)(eq->hi_shrd_mem_start - eq->priv_mem_size) << 20;
+       u64 end = (u64)(eq->hi_shrd_mem_start + eq->hi_shrd_mem_size) << 20;
+       int ret;
 
-       node_set_online(node);
-
-       /* Convert to pages */
-       node_start_pfn[node] =
-                MB_TO_PAGES(eq->hi_shrd_mem_start - eq->priv_mem_size);
-
-       node_end_pfn[node] =
-                MB_TO_PAGES(eq->hi_shrd_mem_start + eq->hi_shrd_mem_size);
-
-       memblock_x86_register_active_regions(node, node_start_pfn[node],
-                                               node_end_pfn[node]);
-
-       memory_present(node, node_start_pfn[node], node_end_pfn[node]);
-
-       node_remap_size[node] = node_memmap_size_bytes(node,
-                                       node_start_pfn[node],
-                                       node_end_pfn[node]);
+       node_set(node, numa_nodes_parsed);
+       ret = numa_add_memblk(node, start, end);
+       BUG_ON(ret < 0);
 }
 
 /*
  * Function: smp_dump_qct()
  *
  * Description: gets memory layout from the quad config table.  This
- * function also updates node_online_map with the nodes (quads) present.
+ * function also updates numa_nodes_parsed with the nodes (quads) present.
  */
 static void __init smp_dump_qct(void)
 {
@@ -112,7 +99,6 @@ static void __init smp_dump_qct(void)
 
        scd = (void *)__va(SYS_CFG_DATA_PRIV_ADDR);
 
-       nodes_clear(node_online_map);
        for_each_node(node) {
                if (scd->quads_present31_0 & (1 << node))
                        numaq_register_node(node, scd);
@@ -282,14 +268,14 @@ static __init void early_check_numaq(void)
        }
 }
 
-int __init get_memcfg_numaq(void)
+int __init numaq_numa_init(void)
 {
        early_check_numaq();
        if (!found_numaq)
-               return 0;
+               return -ENOENT;
        smp_dump_qct();
 
-       return 1;
+       return 0;
 }
 
 #define NUMAQ_APIC_DFR_VALUE   (APIC_DFR_CLUSTER)
@@ -486,8 +472,8 @@ static void numaq_setup_portio_remap(void)
                (u_long) xquad_portio, (u_long) num_quads*XQUAD_PORTIO_QUAD);
 }
 
-/* Use __refdata to keep false positive warning calm.  */
-struct apic __refdata apic_numaq = {
+/* Use __refdata to keep false positive warning calm.  */
+static struct apic __refdata apic_numaq = {
 
        .name                           = "NUMAQ",
        .probe                          = probe_numaq,
@@ -551,3 +537,5 @@ struct apic __refdata apic_numaq = {
        .x86_32_early_logical_apicid    = noop_x86_32_early_logical_apicid,
        .x86_32_numa_cpu_node           = numaq_numa_cpu_node,
 };
+
+apic_driver(apic_numaq);