Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI / NUMA: move bad_srat() and srat_disabled() to drivers/acpi/numa.c

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>

authored by

David Daney and committed by
Rafael J. Wysocki
e84025e2 2faeff1d

+17 -15
-1
arch/x86/include/asm/acpi.h
··· 145 145 #define ARCH_HAS_POWER_INIT 1 146 146 147 147 #ifdef CONFIG_ACPI_NUMA 148 - extern int acpi_numa; 149 148 extern int x86_acpi_numa_init(void); 150 149 #endif /* CONFIG_ACPI_NUMA */ 151 150
+1 -1
arch/x86/mm/numa.c
··· 1 1 /* Common code for 32 and 64-bit NUMA */ 2 + #include <linux/acpi.h> 2 3 #include <linux/kernel.h> 3 4 #include <linux/mm.h> 4 5 #include <linux/string.h> ··· 16 15 #include <asm/e820.h> 17 16 #include <asm/proto.h> 18 17 #include <asm/dma.h> 19 - #include <asm/acpi.h> 20 18 #include <asm/amd_nb.h> 21 19 22 20 #include "numa_internal.h"
-13
arch/x86/mm/srat.c
··· 24 24 #include <asm/apic.h> 25 25 #include <asm/uv/uv.h> 26 26 27 - int acpi_numa __initdata; 28 - 29 - static __init void bad_srat(void) 30 - { 31 - printk(KERN_ERR "SRAT: SRAT not used.\n"); 32 - acpi_numa = -1; 33 - } 34 - 35 - static __init inline int srat_disabled(void) 36 - { 37 - return acpi_numa < 0; 38 - } 39 - 40 27 /* Callback for Proximity Domain -> x2APIC mapping */ 41 28 void __init 42 29 acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa)
+12
drivers/acpi/numa.c
··· 40 40 = { [0 ... MAX_NUMNODES - 1] = PXM_INVAL }; 41 41 42 42 unsigned char acpi_srat_revision __initdata; 43 + int acpi_numa __initdata; 43 44 44 45 int pxm_to_node(int pxm) 45 46 { ··· 196 195 } 197 196 } 198 197 return 1; 198 + } 199 + 200 + void __init bad_srat(void) 201 + { 202 + pr_err("SRAT: SRAT not used.\n"); 203 + acpi_numa = -1; 204 + } 205 + 206 + int __init srat_disabled(void) 207 + { 208 + return acpi_numa < 0; 199 209 } 200 210 201 211 #if defined(CONFIG_X86) || defined(CONFIG_ARM64)
+4
include/acpi/acpi_numa.h
··· 15 15 extern int node_to_pxm(int); 16 16 extern int acpi_map_pxm_to_node(int); 17 17 extern unsigned char acpi_srat_revision; 18 + extern int acpi_numa __initdata; 19 + 20 + extern void bad_srat(void); 21 + extern int srat_disabled(void); 18 22 19 23 #endif /* CONFIG_ACPI_NUMA */ 20 24 #endif /* __ACP_NUMA_H */