]> err.no Git - linux-2.6/blobdiff - lib/cpumask.c
ath5k: Restore saved initval after POST
[linux-2.6] / lib / cpumask.c
index 1560d97390ddd06b5137c154060db3adf9125ea9..5f97dc25ef9c925fb68b83fecec5a7c0114ab339 100644 (file)
@@ -9,3 +9,29 @@ int __first_cpu(const cpumask_t *srcp)
 }
 EXPORT_SYMBOL(__first_cpu);
 
+int __next_cpu(int n, const cpumask_t *srcp)
+{
+       return min_t(int, NR_CPUS, find_next_bit(srcp->bits, NR_CPUS, n+1));
+}
+EXPORT_SYMBOL(__next_cpu);
+
+#if NR_CPUS > 64
+int __next_cpu_nr(int n, const cpumask_t *srcp)
+{
+       return min_t(int, nr_cpu_ids,
+                               find_next_bit(srcp->bits, nr_cpu_ids, n+1));
+}
+EXPORT_SYMBOL(__next_cpu_nr);
+#endif
+
+int __any_online_cpu(const cpumask_t *mask)
+{
+       int cpu;
+
+       for_each_cpu_mask(cpu, *mask) {
+               if (cpu_online(cpu))
+                       break;
+       }
+       return cpu;
+}
+EXPORT_SYMBOL(__any_online_cpu);