diff options
Diffstat (limited to 'include/linux/cpumask.h')
| -rw-r--r-- | include/linux/cpumask.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index d77b54733c5b..dbcee7647d9a 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
| @@ -143,6 +143,8 @@ static inline unsigned int cpumask_any_but(const struct cpumask *mask, | |||
| 143 | 143 | ||
| 144 | #define for_each_cpu(cpu, mask) \ | 144 | #define for_each_cpu(cpu, mask) \ |
| 145 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) | 145 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) |
| 146 | #define for_each_cpu_not(cpu, mask) \ | ||
| 147 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) | ||
| 146 | #define for_each_cpu_and(cpu, mask, and) \ | 148 | #define for_each_cpu_and(cpu, mask, and) \ |
| 147 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)and) | 149 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)and) |
| 148 | #else | 150 | #else |
| @@ -203,6 +205,18 @@ int cpumask_any_but(const struct cpumask *mask, unsigned int cpu); | |||
| 203 | (cpu) < nr_cpu_ids;) | 205 | (cpu) < nr_cpu_ids;) |
| 204 | 206 | ||
| 205 | /** | 207 | /** |
| 208 | * for_each_cpu_not - iterate over every cpu in a complemented mask | ||
| 209 | * @cpu: the (optionally unsigned) integer iterator | ||
| 210 | * @mask: the cpumask pointer | ||
| 211 | * | ||
| 212 | * After the loop, cpu is >= nr_cpu_ids. | ||
| 213 | */ | ||
| 214 | #define for_each_cpu_not(cpu, mask) \ | ||
| 215 | for ((cpu) = -1; \ | ||
| 216 | (cpu) = cpumask_next_zero((cpu), (mask)), \ | ||
| 217 | (cpu) < nr_cpu_ids;) | ||
| 218 | |||
| 219 | /** | ||
| 206 | * for_each_cpu_and - iterate over every cpu in both masks | 220 | * for_each_cpu_and - iterate over every cpu in both masks |
| 207 | * @cpu: the (optionally unsigned) integer iterator | 221 | * @cpu: the (optionally unsigned) integer iterator |
| 208 | * @mask: the first cpumask pointer | 222 | * @mask: the first cpumask pointer |
