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.
Unified · Split
| @@ -893,13 +893,13 @@ static int _acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu) · 892 unmodified lines | ||
| 893 | 893 | } |
| 894 | 894 | |
| 895 | 895 | /* 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) | |
| 897 | 897 | { |
| 898 | 898 | return _acpi_map_lsapic(handle, physid, pcpu); |
| 899 | 899 | } |
| 900 | −EXPORT_SYMBOL(acpi_map_lsapic); | |
| 900 | +EXPORT_SYMBOL(acpi_map_cpu); | |
| 901 | 901 | |
| 902 | −int acpi_unmap_lsapic(int cpu) | |
| 902 | +int acpi_unmap_cpu(int cpu) | |
| 903 | 903 | { |
| 904 | 904 | ia64_cpu_to_sapicid[cpu] = -1; |
| 905 | 905 | set_cpu_present(cpu, false); |
| @@ -910,8 +910,7 @@ int acpi_unmap_lsapic(int cpu) · 4 unmodified lines | ||
| 910 | 910 | |
| 911 | 911 | return (0); |
| 912 | 912 | } |
| 913 | − | |
| 914 | −EXPORT_SYMBOL(acpi_unmap_lsapic); | |
| 913 | +EXPORT_SYMBOL(acpi_unmap_cpu); | |
| 915 | 914 | #endif /* CONFIG_ACPI_HOTPLUG_CPU */ |
| 916 | 915 | |
| 917 | 916 | #ifdef CONFIG_ACPI_NUMA |
| @@ -750,13 +750,13 @@ static int _acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu) · 749 unmodified lines | ||
| 750 | 750 | } |
| 751 | 751 | |
| 752 | 752 | /* 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) | |
| 754 | 754 | { |
| 755 | 755 | return _acpi_map_lsapic(handle, physid, pcpu); |
| 756 | 756 | } |
| 757 | −EXPORT_SYMBOL(acpi_map_lsapic); | |
| 757 | +EXPORT_SYMBOL(acpi_map_cpu); | |
| 758 | 758 | |
| 759 | −int acpi_unmap_lsapic(int cpu) | |
| 759 | +int acpi_unmap_cpu(int cpu) | |
| 760 | 760 | { |
| 761 | 761 | #ifdef CONFIG_ACPI_NUMA |
| 762 | 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 | 769 | return (0); |
| 770 | 770 | } |
| 771 | − | |
| 772 | −EXPORT_SYMBOL(acpi_unmap_lsapic); | |
| 771 | +EXPORT_SYMBOL(acpi_unmap_cpu); | |
| 773 | 772 | #endif /* CONFIG_ACPI_HOTPLUG_CPU */ |
| 774 | 773 | |
| 775 | 774 | int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base) |
| @@ -180,13 +180,13 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr) · 179 unmodified lines | ||
| 180 | 180 | cpu_maps_update_begin(); |
| 181 | 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 | 184 | if (ret) |
| 185 | 185 | goto out; |
| 186 | 186 | |
| 187 | 187 | ret = arch_register_cpu(pr->id); |
| 188 | 188 | if (ret) { |
| 189 | − acpi_unmap_lsapic(pr->id); | |
| 189 | + acpi_unmap_cpu(pr->id); | |
| 190 | 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 | 462 | /* Remove the CPU. */ |
| 463 | 463 | arch_unregister_cpu(pr->id); |
| 464 | − acpi_unmap_lsapic(pr->id); | |
| 464 | + acpi_unmap_cpu(pr->id); | |
| 465 | 465 | |
| 466 | 466 | cpu_hotplug_done(); |
| 467 | 467 | cpu_maps_update_done(); |
| @@ -147,8 +147,8 @@ void acpi_numa_arch_fixup(void); · 146 unmodified lines | ||
| 147 | 147 | |
| 148 | 148 | #ifdef CONFIG_ACPI_HOTPLUG_CPU |
| 149 | 149 | /* 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); | |
| 152 | 152 | #endif /* CONFIG_ACPI_HOTPLUG_CPU */ |
| 153 | 153 | |
| 154 | 154 | int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base); |