Skip to content

Commit d02dc27

Browse files
Hanjun Guorafaeljw
Hanjun Guo
authored andcommitted
ACPI / processor: Rename acpi_(un)map_lsapic() to acpi_(un)map_cpu()
acpi_map_lsapic() will allocate a logical CPU number and map it to physical CPU id (such as APIC id) for the hot-added CPU, it will also do some mapping for NUMA node id and etc, acpi_unmap_lsapic() will do the reverse. We can see that the name of the function is a little bit confusing and arch (IA64) dependent so rename them as acpi_(un)map_cpu() to make arch agnostic and explicit. Signed-off-by: Hanjun Guo <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent af8f3f5 commit d02dc27

File tree

4 files changed

+13
-15
lines changed

4 files changed

+13
-15
lines changed

arch/ia64/kernel/acpi.c

+4-5
Original file line numberDiff line numberDiff line change
@@ -893,13 +893,13 @@ static int _acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu)
893893
}
894894

895895
/* wrapper to silence section mismatch warning */
896-
int __ref acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu)
896+
int __ref acpi_map_cpu(acpi_handle handle, int physid, int *pcpu)
897897
{
898898
return _acpi_map_lsapic(handle, physid, pcpu);
899899
}
900-
EXPORT_SYMBOL(acpi_map_lsapic);
900+
EXPORT_SYMBOL(acpi_map_cpu);
901901

902-
int acpi_unmap_lsapic(int cpu)
902+
int acpi_unmap_cpu(int cpu)
903903
{
904904
ia64_cpu_to_sapicid[cpu] = -1;
905905
set_cpu_present(cpu, false);
@@ -910,8 +910,7 @@ int acpi_unmap_lsapic(int cpu)
910910

911911
return (0);
912912
}
913-
914-
EXPORT_SYMBOL(acpi_unmap_lsapic);
913+
EXPORT_SYMBOL(acpi_unmap_cpu);
915914
#endif /* CONFIG_ACPI_HOTPLUG_CPU */
916915

917916
#ifdef CONFIG_ACPI_NUMA

arch/x86/kernel/acpi/boot.c

+4-5
Original file line numberDiff line numberDiff line change
@@ -750,13 +750,13 @@ static int _acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu)
750750
}
751751

752752
/* wrapper to silence section mismatch warning */
753-
int __ref acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu)
753+
int __ref acpi_map_cpu(acpi_handle handle, int physid, int *pcpu)
754754
{
755755
return _acpi_map_lsapic(handle, physid, pcpu);
756756
}
757-
EXPORT_SYMBOL(acpi_map_lsapic);
757+
EXPORT_SYMBOL(acpi_map_cpu);
758758

759-
int acpi_unmap_lsapic(int cpu)
759+
int acpi_unmap_cpu(int cpu)
760760
{
761761
#ifdef CONFIG_ACPI_NUMA
762762
set_apicid_to_node(per_cpu(x86_cpu_to_apicid, cpu), NUMA_NO_NODE);
@@ -768,8 +768,7 @@ int acpi_unmap_lsapic(int cpu)
768768

769769
return (0);
770770
}
771-
772-
EXPORT_SYMBOL(acpi_unmap_lsapic);
771+
EXPORT_SYMBOL(acpi_unmap_cpu);
773772
#endif /* CONFIG_ACPI_HOTPLUG_CPU */
774773

775774
int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base)

drivers/acpi/acpi_processor.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -180,13 +180,13 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr)
180180
cpu_maps_update_begin();
181181
cpu_hotplug_begin();
182182

183-
ret = acpi_map_lsapic(pr->handle, pr->phys_id, &pr->id);
183+
ret = acpi_map_cpu(pr->handle, pr->phys_id, &pr->id);
184184
if (ret)
185185
goto out;
186186

187187
ret = arch_register_cpu(pr->id);
188188
if (ret) {
189-
acpi_unmap_lsapic(pr->id);
189+
acpi_unmap_cpu(pr->id);
190190
goto out;
191191
}
192192

@@ -461,7 +461,7 @@ static void acpi_processor_remove(struct acpi_device *device)
461461

462462
/* Remove the CPU. */
463463
arch_unregister_cpu(pr->id);
464-
acpi_unmap_lsapic(pr->id);
464+
acpi_unmap_cpu(pr->id);
465465

466466
cpu_hotplug_done();
467467
cpu_maps_update_done();

include/linux/acpi.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ void acpi_numa_arch_fixup(void);
147147

148148
#ifdef CONFIG_ACPI_HOTPLUG_CPU
149149
/* Arch dependent functions for cpu hotplug support */
150-
int acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu);
151-
int acpi_unmap_lsapic(int cpu);
150+
int acpi_map_cpu(acpi_handle handle, int physid, int *pcpu);
151+
int acpi_unmap_cpu(int cpu);
152152
#endif /* CONFIG_ACPI_HOTPLUG_CPU */
153153

154154
int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base);

0 commit comments

Comments
 (0)