Merge branch 'linus' into cpumask-for-linus
[sfrench/cifs-2.6.git] / arch / x86 / kernel / process.c
index 156f87582c6cd5e0fcb677b7c685d92c68443d72..25e28087a3ee628e31569206868de49e183360d3 100644 (file)
@@ -325,7 +325,7 @@ void stop_this_cpu(void *dummy)
        /*
         * Remove this CPU:
         */
-       cpu_clear(smp_processor_id(), cpu_online_map);
+       set_cpu_online(smp_processor_id(), false);
        disable_local_APIC();
 
        for (;;) {
@@ -475,12 +475,13 @@ static int __cpuinit check_c1e_idle(const struct cpuinfo_x86 *c)
        return 1;
 }
 
-static cpumask_t c1e_mask = CPU_MASK_NONE;
+static cpumask_var_t c1e_mask;
 static int c1e_detected;
 
 void c1e_remove_cpu(int cpu)
 {
-       cpu_clear(cpu, c1e_mask);
+       if (c1e_mask != NULL)
+               cpumask_clear_cpu(cpu, c1e_mask);
 }
 
 /*
@@ -509,8 +510,8 @@ static void c1e_idle(void)
        if (c1e_detected) {
                int cpu = smp_processor_id();
 
-               if (!cpu_isset(cpu, c1e_mask)) {
-                       cpu_set(cpu, c1e_mask);
+               if (!cpumask_test_cpu(cpu, c1e_mask)) {
+                       cpumask_set_cpu(cpu, c1e_mask);
                        /*
                         * Force broadcast so ACPI can not interfere. Needs
                         * to run with interrupts enabled as it uses
@@ -562,6 +563,15 @@ void __cpuinit select_idle_routine(const struct cpuinfo_x86 *c)
                pm_idle = default_idle;
 }
 
+void __init init_c1e_mask(void)
+{
+       /* If we're using c1e_idle, we need to allocate c1e_mask. */
+       if (pm_idle == c1e_idle) {
+               alloc_cpumask_var(&c1e_mask, GFP_KERNEL);
+               cpumask_clear(c1e_mask);
+       }
+}
+
 static int __init idle_setup(char *str)
 {
        if (!str)