diff options
Diffstat (limited to 'arch/ia64/kernel/acpi.c')
-rw-r--r-- | arch/ia64/kernel/acpi.c | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index d2702c419cf8..ecd44bdc8394 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c | |||
@@ -761,6 +761,59 @@ int acpi_map_cpu2node(acpi_handle handle, int cpu, long physid) | |||
761 | return (0); | 761 | return (0); |
762 | } | 762 | } |
763 | 763 | ||
764 | int additional_cpus __initdata = -1; | ||
765 | |||
766 | static __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 | |||
774 | early_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 | |||
798 | if (additional_cpus == -1) { | ||
799 | if (disabled_cpus > 0) | ||
800 | additional_cpus = disabled_cpus; | ||
801 | else | ||
802 | additional_cpus = 0; | ||
803 | } | ||
804 | |||
805 | possible = available_cpus + additional_cpus; | ||
806 | |||
807 | if (possible > NR_CPUS) | ||
808 | possible = NR_CPUS; | ||
809 | |||
810 | printk(KERN_INFO "SMP: Allowing %d CPUs, %d hotplug CPUs\n", | ||
811 | possible, max((possible - available_cpus), 0)); | ||
812 | |||
813 | for (i = 0; i < possible; i++) | ||
814 | cpu_set(i, cpu_possible_map); | ||
815 | } | ||
816 | |||
764 | int acpi_map_lsapic(acpi_handle handle, int *pcpu) | 817 | int acpi_map_lsapic(acpi_handle handle, int *pcpu) |
765 | { | 818 | { |
766 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; | 819 | struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; |