@@ -175,10 +175,8 @@ static inline pgprot_t arch_apei_get_mem_attribute(phys_addr_t addr)
#endif /* CONFIG_ACPI_APEI */
#ifdef CONFIG_ACPI_NUMA
-int acpi_numa_get_nid(unsigned int cpu);
void acpi_map_cpus_to_nodes(void);
#else
-static inline int acpi_numa_get_nid(unsigned int cpu) { return NUMA_NO_NODE; }
static inline void acpi_map_cpus_to_nodes(void) { }
#endif /* CONFIG_ACPI_NUMA */
@@ -29,7 +29,7 @@
static int acpi_early_node_map[NR_CPUS] __initdata = { NUMA_NO_NODE };
-int __init acpi_numa_get_nid(unsigned int cpu)
+static int __init acpi_numa_get_nid(unsigned int cpu)
{
return acpi_early_node_map[cpu];
}
@@ -72,9 +72,15 @@ static int __init acpi_parse_gicc_pxm(union acpi_subtable_headers *header,
void __init acpi_map_cpus_to_nodes(void)
{
+ int i;
+
acpi_table_parse_entries(ACPI_SIG_SRAT, sizeof(struct acpi_table_srat),
ACPI_SRAT_TYPE_GICC_AFFINITY,
acpi_parse_gicc_pxm, 0);
+
+ for (i = 0; i < nr_cpu_ids; i++)
+ early_map_cpu_to_node(i, acpi_numa_get_nid(i));
+
}
/* Callback for Proximity Domain -> ACPI processor UID mapping */
@@ -650,8 +650,6 @@ acpi_parse_gic_cpu_interface(union acpi_subtable_headers *header,
static void __init acpi_parse_and_init_cpus(void)
{
- int i;
-
/*
* do a walk of MADT to determine how many CPUs
* we have including disabled CPUs, and get information
@@ -669,9 +667,6 @@ static void __init acpi_parse_and_init_cpus(void)
* as separate steps.
*/
acpi_map_cpus_to_nodes();
-
- for (i = 0; i < nr_cpu_ids; i++)
- early_map_cpu_to_node(i, acpi_numa_get_nid(i));
}
#else
#define acpi_parse_and_init_cpus(...) do { } while (0)
To do the preparation of moving acpi_numa.c to drivers/acpi/arm64, Make acpi_numa_get_nid() invisible to kernel/smp.c, with less export functions. Signed-off-by: Hanjun Guo <guohanjun@huawei.com> --- arch/arm64/include/asm/acpi.h | 2 -- arch/arm64/kernel/acpi_numa.c | 8 +++++++- arch/arm64/kernel/smp.c | 5 ----- 3 files changed, 7 insertions(+), 8 deletions(-)