ACPI / NUMA: move bad_srat() and srat_disabled() to drivers/acpi/numa.c
authorDavid Daney <david.daney@cavium.com>
Tue, 24 May 2016 22:35:39 +0000 (15:35 -0700)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 30 May 2016 12:27:08 +0000 (14:27 +0200)
bad_srat() and srat_disabled() are shared by x86 and follow-on arm64
patches.  Move them to drivers/acpi/numa.c in preparation for arm64
support.

Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Robert Richter <rrichter@cavium.com>
[david.daney@cavium.com moved definitions to drivers/acpi/numa.c]
Signed-off-by: David Daney <david.daney@cavium.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
arch/x86/include/asm/acpi.h
arch/x86/mm/numa.c
arch/x86/mm/srat.c
drivers/acpi/numa.c
include/acpi/acpi_numa.h

index 94c18ebfd68cafaec66c6fc0b8c31ccdf37641fb..65f1e95cade9d4bcb172507ed3faae51813d8a39 100644 (file)
@@ -145,7 +145,6 @@ static inline void disable_acpi(void) { }
 #define ARCH_HAS_POWER_INIT    1
 
 #ifdef CONFIG_ACPI_NUMA
-extern int acpi_numa;
 extern int x86_acpi_numa_init(void);
 #endif /* CONFIG_ACPI_NUMA */
 
index 9c086c57105c18cac6bbb4030c6c448eadf03af8..968ac028c34e29baf2fa7e1bee6a466910a078ce 100644 (file)
@@ -1,4 +1,5 @@
 /* Common code for 32 and 64-bit NUMA */
+#include <linux/acpi.h>
 #include <linux/kernel.h>
 #include <linux/mm.h>
 #include <linux/string.h>
@@ -15,7 +16,6 @@
 #include <asm/e820.h>
 #include <asm/proto.h>
 #include <asm/dma.h>
-#include <asm/acpi.h>
 #include <asm/amd_nb.h>
 
 #include "numa_internal.h"
index 9e2a833b54fb67a652793b1dce9fe6d7bbc19eb2..4217071fb4d27b59601a682040f94f1a62dc4619 100644 (file)
 #include <asm/apic.h>
 #include <asm/uv/uv.h>
 
-int acpi_numa __initdata;
-
-static __init void bad_srat(void)
-{
-       printk(KERN_ERR "SRAT: SRAT not used.\n");
-       acpi_numa = -1;
-}
-
-static __init inline int srat_disabled(void)
-{
-       return acpi_numa < 0;
-}
-
 /* Callback for Proximity Domain -> x2APIC mapping */
 void __init
 acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
index 7e0649d11da2a567ba8c961c3756aeeb49974899..af0c8d5c845b9e6d805f33890f7ab12416a4aa76 100644 (file)
@@ -40,6 +40,7 @@ static int node_to_pxm_map[MAX_NUMNODES]
                        = { [0 ... MAX_NUMNODES - 1] = PXM_INVAL };
 
 unsigned char acpi_srat_revision __initdata;
+int acpi_numa __initdata;
 
 int pxm_to_node(int pxm)
 {
@@ -197,6 +198,17 @@ static int __init slit_valid(struct acpi_table_slit *slit)
        return 1;
 }
 
+void __init bad_srat(void)
+{
+       pr_err("SRAT: SRAT not used.\n");
+       acpi_numa = -1;
+}
+
+int __init srat_disabled(void)
+{
+       return acpi_numa < 0;
+}
+
 #if defined(CONFIG_X86) || defined(CONFIG_ARM64)
 /*
  * Callback for SLIT parsing.  pxm_to_node() returns NUMA_NO_NODE for
index 94a37cd7fbda47ce85c6ff1a2e82772c4582045b..d4b72944ccdabc89748f054dd92c7b355f05de5a 100644 (file)
@@ -15,6 +15,10 @@ extern int pxm_to_node(int);
 extern int node_to_pxm(int);
 extern int acpi_map_pxm_to_node(int);
 extern unsigned char acpi_srat_revision;
+extern int acpi_numa __initdata;
+
+extern void bad_srat(void);
+extern int srat_disabled(void);
 
 #endif                         /* CONFIG_ACPI_NUMA */
 #endif                         /* __ACP_NUMA_H */