diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Makefile | 2 | ||||
-rw-r--r-- | lib/cpumask.c | 11 |
2 files changed, 13 insertions, 0 deletions
diff --git a/lib/Makefile b/lib/Makefile index 648b2c1242fd..f827e3c24ec0 100644 --- a/lib/Makefile +++ b/lib/Makefile | |||
@@ -7,6 +7,8 @@ lib-y := errno.o ctype.o string.o vsprintf.o cmdline.o \ | |||
7 | idr.o div64.o int_sqrt.o bitmap.o extable.o prio_tree.o \ | 7 | idr.o div64.o int_sqrt.o bitmap.o extable.o prio_tree.o \ |
8 | sha1.o | 8 | sha1.o |
9 | 9 | ||
10 | lib-$(CONFIG_SMP) += cpumask.o | ||
11 | |||
10 | lib-y += kobject.o kref.o kobject_uevent.o klist.o | 12 | lib-y += kobject.o kref.o kobject_uevent.o klist.o |
11 | 13 | ||
12 | obj-y += sort.o parser.o halfmd4.o iomap_copy.o | 14 | obj-y += sort.o parser.o halfmd4.o iomap_copy.o |
diff --git a/lib/cpumask.c b/lib/cpumask.c new file mode 100644 index 000000000000..1560d97390dd --- /dev/null +++ b/lib/cpumask.c | |||
@@ -0,0 +1,11 @@ | |||
1 | #include <linux/kernel.h> | ||
2 | #include <linux/bitops.h> | ||
3 | #include <linux/cpumask.h> | ||
4 | #include <linux/module.h> | ||
5 | |||
6 | int __first_cpu(const cpumask_t *srcp) | ||
7 | { | ||
8 | return min_t(int, NR_CPUS, find_first_bit(srcp->bits, NR_CPUS)); | ||
9 | } | ||
10 | EXPORT_SYMBOL(__first_cpu); | ||
11 | |||