[BACK]Return to cpumask.c CVS log [TXT][DIR] Up to [Development] / linux-2.6-xfs / lib

File: [Development] / linux-2.6-xfs / lib / cpumask.c (download)

Revision 1.3, Thu May 24 16:41:45 2007 UTC (10 years, 5 months ago) by tes.longdrop.melbourne.sgi.com
Branch: MAIN
Changes since 1.2: +0 -3 lines

Merge up to 2.6.22-rc2
Merge of 2.6.x-xfs-melb:linux:28675b by kenmcd.

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