diff options
author | Hanjun Guo <hanjun.guo@linaro.com> | 2015-01-04 05:55:03 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-01-05 17:34:26 -0500 |
commit | d02dc27db0dc74683efc4a2b36f55f5594451f38 (patch) | |
tree | cbf8a9b0e16897d157c9fe641da7a00d4f587044 | |
parent | af8f3f514d193eb353f9b6cea503c55d074e6153 (diff) |
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 <hanjun.guo@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r-- | arch/ia64/kernel/acpi.c | 9 | ||||
-rw-r--r-- | arch/x86/kernel/acpi/boot.c | 9 | ||||
-rw-r--r-- | drivers/acpi/acpi_processor.c | 6 | ||||
-rw-r--r-- | include/linux/acpi.h | 4 |
4 files changed, 13 insertions, 15 deletions
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index 615ef81def49..e795cb848154 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c | |||
@@ -893,13 +893,13 @@ static int _acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu) | |||
893 | } | 893 | } |
894 | 894 | ||
895 | /* wrapper to silence section mismatch warning */ | 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 | return _acpi_map_lsapic(handle, physid, pcpu); | 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 | 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) | |||
910 | 910 | ||
911 | return (0); | 911 | return (0); |
912 | } | 912 | } |
913 | 913 | EXPORT_SYMBOL(acpi_unmap_cpu); | |
914 | EXPORT_SYMBOL(acpi_unmap_lsapic); | ||
915 | #endif /* CONFIG_ACPI_HOTPLUG_CPU */ | 914 | #endif /* CONFIG_ACPI_HOTPLUG_CPU */ |
916 | 915 | ||
917 | #ifdef CONFIG_ACPI_NUMA | 916 | #ifdef CONFIG_ACPI_NUMA |
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 4433a4be8171..d1626364a28a 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
@@ -750,13 +750,13 @@ static int _acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu) | |||
750 | } | 750 | } |
751 | 751 | ||
752 | /* wrapper to silence section mismatch warning */ | 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 | return _acpi_map_lsapic(handle, physid, pcpu); | 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 | #ifdef CONFIG_ACPI_NUMA | 761 | #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) | |||
768 | 768 | ||
769 | return (0); | 769 | return (0); |
770 | } | 770 | } |
771 | 771 | EXPORT_SYMBOL(acpi_unmap_cpu); | |
772 | EXPORT_SYMBOL(acpi_unmap_lsapic); | ||
773 | #endif /* CONFIG_ACPI_HOTPLUG_CPU */ | 772 | #endif /* CONFIG_ACPI_HOTPLUG_CPU */ |
774 | 773 | ||
775 | int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base) | 774 | int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base) |
diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index f02b29eb0fda..1020b1b53a17 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c | |||
@@ -180,13 +180,13 @@ static int acpi_processor_hotadd_init(struct acpi_processor *pr) | |||
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) | |||
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(); |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 856d381b1d5b..d459cd17b477 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -147,8 +147,8 @@ void acpi_numa_arch_fixup(void); | |||
147 | 147 | ||
148 | #ifdef CONFIG_ACPI_HOTPLUG_CPU | 148 | #ifdef CONFIG_ACPI_HOTPLUG_CPU |
149 | /* Arch dependent functions for cpu hotplug support */ | 149 | /* Arch dependent functions for cpu hotplug support */ |
150 | int acpi_map_lsapic(acpi_handle handle, int physid, int *pcpu); | 150 | int acpi_map_cpu(acpi_handle handle, int physid, int *pcpu); |
151 | int acpi_unmap_lsapic(int cpu); | 151 | int acpi_unmap_cpu(int cpu); |
152 | #endif /* CONFIG_ACPI_HOTPLUG_CPU */ | 152 | #endif /* CONFIG_ACPI_HOTPLUG_CPU */ |
153 | 153 | ||
154 | int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base); | 154 | int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base); |