History

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.

Hanjun Guo committed 11 years ago

Commit d02dc271 parent af8f3f54 files · +13 −15Browse files

Unified · Split

4 files
  1. arch/ia64/kernel/acpi.c +4 −5
  2. arch/x86/kernel/acpi/boot.c +4 −5
  3. drivers/acpi/acpi_processor.c +3 −3
  4. include/linux/acpi.h +2 −2
arch/ia64/kernel/acpi.c+4−5
@@ -893,13 +893,13 @@ static int _acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu) · 892 unmodified lines
893}893}
894 894
895/* wrapper to silence section mismatch warning */895/* wrapper to silence section mismatch warning */
896int __ref acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu)896int __ref acpi_map_cpu(acpi_handle handle, int physid, int *pcpu)
897{897{
898 return _acpi_map_lsapic(handle, physid, pcpu);898 return _acpi_map_lsapic(handle, physid, pcpu);
899}899}
900EXPORT_SYMBOL(acpi_map_lsapic);900EXPORT_SYMBOL(acpi_map_cpu);
901 901
902int acpi_unmap_lsapic(int cpu)902int acpi_unmap_cpu(int cpu)
903{903{
904 ia64_cpu_to_sapicid[cpu] = -1;904 ia64_cpu_to_sapicid[cpu] = -1;
905 set_cpu_present(cpu, false);905 set_cpu_present(cpu, false);
@@ -910,8 +910,7 @@ int acpi_unmap_lsapic(int cpu) · 4 unmodified lines
910 910
911 return (0);911 return (0);
912}912}
913 913EXPORT_SYMBOL(acpi_unmap_cpu);
914EXPORT_SYMBOL(acpi_unmap_lsapic);
915#endif /* CONFIG_ACPI_HOTPLUG_CPU */914#endif /* CONFIG_ACPI_HOTPLUG_CPU */
916 915
917#ifdef CONFIG_ACPI_NUMA916#ifdef CONFIG_ACPI_NUMA
arch/x86/kernel/acpi/boot.c+4−5
@@ -750,13 +750,13 @@ static int _acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu) · 749 unmodified lines
750}750}
751 751
752/* wrapper to silence section mismatch warning */752/* wrapper to silence section mismatch warning */
753int __ref acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu)753int __ref acpi_map_cpu(acpi_handle handle, int physid, int *pcpu)
754{754{
755 return _acpi_map_lsapic(handle, physid, pcpu);755 return _acpi_map_lsapic(handle, physid, pcpu);
756}756}
757EXPORT_SYMBOL(acpi_map_lsapic);757EXPORT_SYMBOL(acpi_map_cpu);
758 758
759int acpi_unmap_lsapic(int cpu)759int acpi_unmap_cpu(int cpu)
760{760{
761#ifdef CONFIG_ACPI_NUMA761#ifdef CONFIG_ACPI_NUMA
762 set_apicid_to_node(per_cpu(x86_cpu_to_apicid, cpu), NUMA_NO_NODE);762 set_apicid_to_node(per_cpu(x86_cpu_to_apicid, cpu), NUMA_NO_NODE);
@@ -768,8 +768,7 @@ int acpi_unmap_lsapic(int cpu) · 5 unmodified lines
768 768
769 return (0);769 return (0);
770}770}
771 771EXPORT_SYMBOL(acpi_unmap_cpu);
772EXPORT_SYMBOL(acpi_unmap_lsapic);
773#endif /* CONFIG_ACPI_HOTPLUG_CPU */772#endif /* CONFIG_ACPI_HOTPLUG_CPU */
774 773
775int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base)774int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base)
drivers/acpi/acpi_processor.c+3−3
@@ -180,13 +180,13 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr) · 179 unmodified lines
180 cpu_maps_update_begin();180 cpu_maps_update_begin();
181 cpu_hotplug_begin();181 cpu_hotplug_begin();
182 182
183 ret = acpi_map_lsapic(pr->handle, pr->phys_id, &pr->id);183 ret = acpi_map_cpu(pr->handle, pr->phys_id, &pr->id);
184 if (ret)184 if (ret)
185 goto out;185 goto out;
186 186
187 ret = arch_register_cpu(pr->id);187 ret = arch_register_cpu(pr->id);
188 if (ret) {188 if (ret) {
189 acpi_unmap_lsapic(pr->id);189 acpi_unmap_cpu(pr->id);
190 goto out;190 goto out;
191 }191 }
192 192
@@ -461,7 +461,7 @@ static void acpi_processor_remove(struct acpi_device *device) · 268 unmodified lines
461 461
462 /* Remove the CPU. */462 /* Remove the CPU. */
463 arch_unregister_cpu(pr->id);463 arch_unregister_cpu(pr->id);
464 acpi_unmap_lsapic(pr->id);464 acpi_unmap_cpu(pr->id);
465 465
466 cpu_hotplug_done();466 cpu_hotplug_done();
467 cpu_maps_update_done();467 cpu_maps_update_done();
include/linux/acpi.h+2−2
@@ -147,8 +147,8 @@ void acpi_numa_arch_fixup(void); · 146 unmodified lines
147 147
148#ifdef CONFIG_ACPI_HOTPLUG_CPU148#ifdef CONFIG_ACPI_HOTPLUG_CPU
149/* Arch dependent functions for cpu hotplug support */149/* Arch dependent functions for cpu hotplug support */
150int acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu);150int acpi_map_cpu(acpi_handle handle, int physid, int *pcpu);
151int acpi_unmap_lsapic(int cpu);151int acpi_unmap_cpu(int cpu);
152#endif /* CONFIG_ACPI_HOTPLUG_CPU */152#endif /* CONFIG_ACPI_HOTPLUG_CPU */
153 153
154int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base);154int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t