2006-03-25 11:08:08 +00:00
|
|
|
#include <linux/kernel.h>
|
|
|
|
#include <linux/bitops.h>
|
|
|
|
#include <linux/cpumask.h>
|
|
|
|
#include <linux/module.h>
|
|
|
|
|
|
|
|
int __first_cpu(const cpumask_t *srcp)
|
|
|
|
{
|
|
|
|
return min_t(int, NR_CPUS, find_first_bit(srcp->bits, NR_CPUS));
|
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(__first_cpu);
|
|
|
|
|
2006-03-25 11:08:09 +00:00
|
|
|
int __next_cpu(int n, const cpumask_t *srcp)
|
|
|
|
{
|
|
|
|
return min_t(int, NR_CPUS, find_next_bit(srcp->bits, NR_CPUS, n+1));
|
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(__next_cpu);
|
2006-03-25 11:08:09 +00:00
|
|
|
|
2007-02-20 21:57:51 +00:00
|
|
|
int nr_cpu_ids;
|
|
|
|
EXPORT_SYMBOL(nr_cpu_ids);
|
2006-03-25 11:08:10 +00:00
|
|
|
|
|
|
|
int __any_online_cpu(const cpumask_t *mask)
|
|
|
|
{
|
|
|
|
int cpu;
|
|
|
|
|
|
|
|
for_each_cpu_mask(cpu, *mask) {
|
|
|
|
if (cpu_online(cpu))
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return cpu;
|
|
|
|
}
|
|
|
|
EXPORT_SYMBOL(__any_online_cpu);
|