]> err.no Git - linux-2.6/blobdiff - arch/mips/kernel/gdb-stub.c
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
[linux-2.6] / arch / mips / kernel / gdb-stub.c
index c33f6f22d86a5651e503e001360ae379905e3cee..3191afa29ad8061404f1ba11b4aefd045acae5fa 100644 (file)
@@ -676,15 +676,18 @@ static void kgdb_wait(void *arg)
 static int kgdb_smp_call_kgdb_wait(void)
 {
 #ifdef CONFIG_SMP
+       cpumask_t mask = cpu_online_map;
        struct call_data_struct data;
-       int i, cpus = num_online_cpus() - 1;
        int cpu = smp_processor_id();
+       int cpus;
 
        /*
         * Can die spectacularly if this CPU isn't yet marked online
         */
        BUG_ON(!cpu_online(cpu));
 
+       cpu_clear(cpu, mask);
+       cpus = cpus_weight(mask);
        if (!cpus)
                return 0;
 
@@ -711,10 +714,7 @@ static int kgdb_smp_call_kgdb_wait(void)
        call_data = &data;
        mb();
 
-       /* Send a message to all other CPUs and wait for them to respond */
-       for (i = 0; i < NR_CPUS; i++)
-               if (cpu_online(i) && i != cpu)
-                       core_send_ipi(i, SMP_CALL_FUNCTION);
+       core_send_ipi_mask(mask, SMP_CALL_FUNCTION);
 
        /* Wait for response */
        /* FIXME: lock-up detection, backtrace on lock-up */
@@ -769,7 +769,7 @@ void handle_exception(struct gdb_regs *regs)
        /*
         * acquire the CPU spinlocks
         */
-       for (i = num_online_cpus()-1; i >= 0; i--)
+       for_each_online_cpu(i)
                if (__raw_spin_trylock(&kgdb_cpulock[i]) == 0)
                        panic("kgdb: couldn't get cpulock %d\n", i);
 
@@ -1044,7 +1044,7 @@ finish_kgdb:
 
 exit_kgdb_exception:
        /* release locks so other CPUs can go */
-       for (i = num_online_cpus()-1; i >= 0; i--)
+       for_each_online_cpu(i)
                __raw_spin_unlock(&kgdb_cpulock[i]);
        spin_unlock(&kgdb_lock);