diff options
author | Mike Travis <travis@sgi.com> | 2008-10-27 11:03:13 +1100 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2008-10-27 11:03:13 +1100 |
commit | c9b5ffeab815f452746b71f92489df544669a6e5 (patch) | |
tree | 6e3b52c168648f5c00c3ec746214d18586149578 /include | |
parent | 8e3f284dc458399455f3dcce3b79a17656bf357a (diff) |
cpumask:cpumask_size
Dynamic allocation of cpumasks requires the size.
Signed-off-by: Mike Travis <travis@sgi.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/cpumask.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 9f5d5ed895ba..62060fdec6cc 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h @@ -64,6 +64,7 @@ * int next_cpu(cpu, mask) Next cpu past 'cpu', or NR_CPUS * int next_cpu_nr(cpu, mask) Next cpu past 'cpu', or nr_cpu_ids * + * size_t cpumask_size() Length of cpumask in bytes. * cpumask_t cpumask_of_cpu(cpu) Return cpumask with bit 'cpu' set * (can be used as an lvalue) * CPU_MASK_ALL Initializer - all bits set @@ -147,6 +148,8 @@ struct cpumask { }; #define cpumask_bits(maskp) ((maskp)->bits) +#define cpumask_size() (BITS_TO_LONGS(NR_CPUS) * sizeof(long)) + /* Deprecated. */ typedef struct cpumask cpumask_t; extern cpumask_t _unused_cpumask_arg_; |