Skip to contentSkip to conversation

RFC [PATCH net-2.6 5/6] net: Added cpumask_parse

PATCH Tom Herbert 1 participant 1 message Mar 5, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

This patch adds the cpumask_parse function that allows parsing of a kernel buffer (analogous to bitmap_parse).

---

include/linux/cpumask.h +9 -0
diff -uprN -X /tmp/donts/cpumask net-2.6/include/linux/cpumask.h net-2.6.patch/include/linux/cpumask.h
@@ -49,6 +49,7 @@
  * unsigned long *cpus_addr(mask)	Array of unsigned long's in mask
  *
  * int cpumask_scnprintf(buf, len, mask) Format cpumask for printing
+ * int cpumask_parse(ubuf, ulen, mask)	Parse ascii string as cpumask
  * int cpumask_parse_user(ubuf, ulen, mask)	Parse ascii string as cpumask
  * int cpulist_scnprintf(buf, len, mask) Format cpumask as list for printing
  * int cpulist_parse(buf, map)		Parse ascii string as cpulist
@@ -273,6 +274,14 @@ static inline int __cpumask_scnprintf(ch
 	return bitmap_scnprintf(buf, len, srcp->bits, nbits);
 }
 
+#define cpumask_parse(ubuf, ulen, dst) \
+			__cpumask_parse((ubuf), (ulen), &(dst), NR_CPUS)
+static inline int __cpumask_parse(const char __user *buf, int len,
+					cpumask_t *dstp, int nbits)
+{
+	return bitmap_parse(buf, len, dstp->bits, nbits);
+}
+
 #define cpumask_parse_user(ubuf, ulen, dst) \
 			__cpumask_parse_user((ubuf), (ulen), &(dst), NR_CPUS)
 static inline int __cpumask_parse_user(const char __user *buf, int len,