Skip to content

Commit 8d34b6f

Browse files
James Morsectmarinas
authored andcommitted
arm64: acpi: Move get_cpu_for_acpi_id() to a header
ACPI identifies CPUs by UID. get_cpu_for_acpi_id() maps the ACPI UID to the Linux CPU number. The helper to retrieve this mapping is only available in arm64's NUMA code. Move it to live next to get_acpi_id_for_cpu(). Signed-off-by: James Morse <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Reviewed-by: Gavin Shan <[email protected]> Tested-by: Miguel Luis <[email protected]> Tested-by: Vishnu Pajjuri <[email protected]> Tested-by: Jianyong Wu <[email protected]> Signed-off-by: Russell King (Oracle) <[email protected]> Acked-by: Hanjun Guo <[email protected]> Signed-off-by: Jonathan Cameron <[email protected]> Reviewed-by: Lorenzo Pieralisi <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 3b9d0a7 commit 8d34b6f

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

arch/arm64/include/asm/acpi.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,17 @@ static inline u32 get_acpi_id_for_cpu(unsigned int cpu)
119119
return acpi_cpu_get_madt_gicc(cpu)->uid;
120120
}
121121

122+
static inline int get_cpu_for_acpi_id(u32 uid)
123+
{
124+
int cpu;
125+
126+
for (cpu = 0; cpu < nr_cpu_ids; cpu++)
127+
if (uid == get_acpi_id_for_cpu(cpu))
128+
return cpu;
129+
130+
return -EINVAL;
131+
}
132+
122133
static inline void arch_fix_phys_package_id(int num, u32 slot) { }
123134
void __init acpi_init_cpus(void);
124135
int apei_claim_sea(struct pt_regs *regs);

arch/arm64/kernel/acpi_numa.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,6 @@ int __init acpi_numa_get_nid(unsigned int cpu)
3434
return acpi_early_node_map[cpu];
3535
}
3636

37-
static inline int get_cpu_for_acpi_id(u32 uid)
38-
{
39-
int cpu;
40-
41-
for (cpu = 0; cpu < nr_cpu_ids; cpu++)
42-
if (uid == get_acpi_id_for_cpu(cpu))
43-
return cpu;
44-
45-
return -EINVAL;
46-
}
47-
4837
static int __init acpi_parse_gicc_pxm(union acpi_subtable_headers *header,
4938
const unsigned long end)
5039
{

0 commit comments

Comments
 (0)