diff options
Diffstat (limited to 'include/linux/cpumask.h')
-rw-r--r-- | include/linux/cpumask.h | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 259c8051155d..9650806fe2ea 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -14,6 +14,8 @@ | |||
14 | * bitmap_scnlistprintf() and bitmap_parselist(), also in bitmap.c. | 14 | * bitmap_scnlistprintf() and bitmap_parselist(), also in bitmap.c. |
15 | * For details of cpu_remap(), see bitmap_bitremap in lib/bitmap.c | 15 | * For details of cpu_remap(), see bitmap_bitremap in lib/bitmap.c |
16 | * For details of cpus_remap(), see bitmap_remap in lib/bitmap.c. | 16 | * For details of cpus_remap(), see bitmap_remap in lib/bitmap.c. |
17 | * For details of cpus_onto(), see bitmap_onto in lib/bitmap.c. | ||
18 | * For details of cpus_fold(), see bitmap_fold in lib/bitmap.c. | ||
17 | * | 19 | * |
18 | * The available cpumask operations are: | 20 | * The available cpumask operations are: |
19 | * | 21 | * |
@@ -53,7 +55,9 @@ | |||
53 | * int cpulist_scnprintf(buf, len, mask) Format cpumask as list for printing | 55 | * int cpulist_scnprintf(buf, len, mask) Format cpumask as list for printing |
54 | * int cpulist_parse(buf, map) Parse ascii string as cpulist | 56 | * int cpulist_parse(buf, map) Parse ascii string as cpulist |
55 | * int cpu_remap(oldbit, old, new) newbit = map(old, new)(oldbit) | 57 | * int cpu_remap(oldbit, old, new) newbit = map(old, new)(oldbit) |
56 | * int cpus_remap(dst, src, old, new) *dst = map(old, new)(src) | 58 | * void cpus_remap(dst, src, old, new) *dst = map(old, new)(src) |
59 | * void cpus_onto(dst, orig, relmap) *dst = orig relative to relmap | ||
60 | * void cpus_fold(dst, orig, sz) dst bits = orig bits mod sz | ||
57 | * | 61 | * |
58 | * for_each_cpu_mask(cpu, mask) for-loop cpu over mask | 62 | * for_each_cpu_mask(cpu, mask) for-loop cpu over mask |
59 | * | 63 | * |
@@ -330,6 +334,22 @@ static inline void __cpus_remap(cpumask_t *dstp, const cpumask_t *srcp, | |||
330 | bitmap_remap(dstp->bits, srcp->bits, oldp->bits, newp->bits, nbits); | 334 | bitmap_remap(dstp->bits, srcp->bits, oldp->bits, newp->bits, nbits); |
331 | } | 335 | } |
332 | 336 | ||
337 | #define cpus_onto(dst, orig, relmap) \ | ||
338 | __cpus_onto(&(dst), &(orig), &(relmap), NR_CPUS) | ||
339 | static inline void __cpus_onto(cpumask_t *dstp, const cpumask_t *origp, | ||
340 | const cpumask_t *relmapp, int nbits) | ||
341 | { | ||
342 | bitmap_onto(dstp->bits, origp->bits, relmapp->bits, nbits); | ||
343 | } | ||
344 | |||
345 | #define cpus_fold(dst, orig, sz) \ | ||
346 | __cpus_fold(&(dst), &(orig), sz, NR_CPUS) | ||
347 | static inline void __cpus_fold(cpumask_t *dstp, const cpumask_t *origp, | ||
348 | int sz, int nbits) | ||
349 | { | ||
350 | bitmap_fold(dstp->bits, origp->bits, sz, nbits); | ||
351 | } | ||
352 | |||
333 | #if NR_CPUS > 1 | 353 | #if NR_CPUS > 1 |
334 | #define for_each_cpu_mask(cpu, mask) \ | 354 | #define for_each_cpu_mask(cpu, mask) \ |
335 | for ((cpu) = first_cpu(mask); \ | 355 | for ((cpu) = first_cpu(mask); \ |