]> git.karo-electronics.de Git - linux-beck.git/blobdiff - include/linux/cpumask.h
Merge branches 'pm-cpufreq' and 'pm-cpuidle'
[linux-beck.git] / include / linux / cpumask.h
index 0a9a6da21e74fdde326f9dc04685dc1ea6e481c3..b950e9d6008b1e611f0092117160d92c88ed76d4 100644 (file)
@@ -803,6 +803,23 @@ static inline const struct cpumask *get_cpu_mask(unsigned int cpu)
 }
 #endif /* NR_CPUS > BITS_PER_LONG */
 
+/**
+ * cpumap_print_to_pagebuf  - copies the cpumask into the buffer either
+ *     as comma-separated list of cpus or hex values of cpumask
+ * @list: indicates whether the cpumap must be list
+ * @mask: the cpumask to copy
+ * @buf: the buffer to copy into
+ *
+ * Returns the length of the (null-terminated) @buf string, zero if
+ * nothing is copied.
+ */
+static inline ssize_t
+cpumap_print_to_pagebuf(bool list, char *buf, const struct cpumask *mask)
+{
+       return bitmap_print_to_pagebuf(list, buf, cpumask_bits(mask),
+                                     nr_cpumask_bits);
+}
+
 /*
  *
  * From here down, all obsolete.  Use cpumask_ variants!