Andrew Morton | ccb4600 | 2006-03-25 03:08:08 -0800 | [diff] [blame] | 1 | #include <linux/kernel.h> |
| 2 | #include <linux/bitops.h> |
| 3 | #include <linux/cpumask.h> |
| 4 | #include <linux/module.h> |
| 5 | |
| 6 | int __first_cpu(const cpumask_t *srcp) |
| 7 | { |
| 8 | return min_t(int, NR_CPUS, find_first_bit(srcp->bits, NR_CPUS)); |
| 9 | } |
| 10 | EXPORT_SYMBOL(__first_cpu); |
| 11 | |
Andrew Morton | 3d18bd7 | 2006-03-25 03:08:09 -0800 | [diff] [blame] | 12 | int __next_cpu(int n, const cpumask_t *srcp) |
| 13 | { |
| 14 | return min_t(int, NR_CPUS, find_next_bit(srcp->bits, NR_CPUS, n+1)); |
| 15 | } |
| 16 | EXPORT_SYMBOL(__next_cpu); |
Andrew Morton | 8630282 | 2006-03-25 03:08:09 -0800 | [diff] [blame] | 17 | |
Christoph Lameter | 53b8a31 | 2007-02-20 13:57:51 -0800 | [diff] [blame] | 18 | int nr_cpu_ids; |
| 19 | EXPORT_SYMBOL(nr_cpu_ids); |
Andrew Morton | 96a9b4d | 2006-03-25 03:08:10 -0800 | [diff] [blame] | 20 | |
| 21 | int __any_online_cpu(const cpumask_t *mask) |
| 22 | { |
| 23 | int cpu; |
| 24 | |
| 25 | for_each_cpu_mask(cpu, *mask) { |
| 26 | if (cpu_online(cpu)) |
| 27 | break; |
| 28 | } |
| 29 | return cpu; |
| 30 | } |
| 31 | EXPORT_SYMBOL(__any_online_cpu); |