https://github.com/torvalds/linux
Revision 189548642c5962e60c3667bdb3a703fe0bed12a6 authored by Linus Torvalds on 24 June 2007, 23:21:48 UTC, committed by Linus Torvalds on 24 June 2007, 23:21:48 UTC
1 parent a06381f
Raw File
Tip revision: 189548642c5962e60c3667bdb3a703fe0bed12a6 authored by Linus Torvalds on 24 June 2007, 23:21:48 UTC
Linus 2.6.22-rc6
Tip revision: 1895486
cpumask.c
#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);

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);

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);
back to top