[PATCH] cpumask: uninline highest_possible_processor_id()
[linux-block.git] / lib / cpumask.c
CommitLineData
ccb46000
AM
1#include <linux/kernel.h>
2#include <linux/bitops.h>
3#include <linux/cpumask.h>
4#include <linux/module.h>
5
6int __first_cpu(const cpumask_t *srcp)
7{
8 return min_t(int, NR_CPUS, find_first_bit(srcp->bits, NR_CPUS));
9}
10EXPORT_SYMBOL(__first_cpu);
11
3d18bd74
AM
12int __next_cpu(int n, const cpumask_t *srcp)
13{
14 return min_t(int, NR_CPUS, find_next_bit(srcp->bits, NR_CPUS, n+1));
15}
16EXPORT_SYMBOL(__next_cpu);
86302820
AM
17
18/*
19 * Find the highest possible smp_processor_id()
20 *
21 * Note: if we're prepared to assume that cpu_possible_map never changes
22 * (reasonable) then this function should cache its return value.
23 */
24int highest_possible_processor_id(void)
25{
26 unsigned int cpu;
27 unsigned highest = 0;
28
29 for_each_cpu_mask(cpu, cpu_possible_map)
30 highest = cpu;
31 return highest;
32}
33EXPORT_SYMBOL(highest_possible_processor_id);