aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel/acpi.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64/kernel/acpi.c')
-rw-r--r--arch/ia64/kernel/acpi.c56
1 files changed, 56 insertions, 0 deletions
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c
index d2702c419cf8..34795ede72e0 100644
--- a/arch/ia64/kernel/acpi.c
+++ b/arch/ia64/kernel/acpi.c
@@ -761,6 +761,62 @@ int acpi_map_cpu2node(acpi_handle handle, int cpu, long physid)
761 return (0); 761 return (0);
762} 762}
763 763
764int additional_cpus __initdata = -1;
765
766static __init int setup_additional_cpus(char *s)
767{
768 if (s)
769 additional_cpus = simple_strtol(s, NULL, 0);
770
771 return 0;
772}
773
774early_param("additional_cpus", setup_additional_cpus);
775
776/*
777 * cpu_possible_map should be static, it cannot change as cpu's
778 * are onlined, or offlined. The reason is per-cpu data-structures
779 * are allocated by some modules at init time, and dont expect to
780 * do this dynamically on cpu arrival/departure.
781 * cpu_present_map on the other hand can change dynamically.
782 * In case when cpu_hotplug is not compiled, then we resort to current
783 * behaviour, which is cpu_possible == cpu_present.
784 * - Ashok Raj
785 *
786 * Three ways to find out the number of additional hotplug CPUs:
787 * - If the BIOS specified disabled CPUs in ACPI/mptables use that.
788 * - The user can overwrite it with additional_cpus=NUM
789 * - Otherwise don't reserve additional CPUs.
790 */
791__init void prefill_possible_map(void)
792{
793 int i;
794 int possible, disabled_cpus;
795
796 disabled_cpus = total_cpus - available_cpus;
797 if (additional_cpus == -1) {
798 if (disabled_cpus > 0) {
799 possible = total_cpus;
800 additional_cpus = disabled_cpus;
801 }
802 else {
803 possible = available_cpus;
804 additional_cpus = 0;
805 }
806 } else {
807 possible = available_cpus + additional_cpus;
808 }
809 if (possible > NR_CPUS)
810 possible = NR_CPUS;
811
812 printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n",
813 possible,
814 max_t(int, additional_cpus, 0));
815
816 for (i = 0; i < possible; i++)
817 cpu_set(i, cpu_possible_map);
818}
819
764int acpi_map_lsapic(acpi_handle handle, int *pcpu) 820int acpi_map_lsapic(acpi_handle handle, int *pcpu)
765{ 821{
766 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 822 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL };