ia64/linux-2.6.18-xen.hg

view lib/cpumask.c @ 847:ad4d307bf9ce

net sfc: Update sfc and sfc_resource driver to latest release

...and update sfc_netfront, sfc_netback, sfc_netutil for any API changes

sfc_netback: Fix asymmetric use of SFC buffer table alloc and free
sfc_netback: Clean up if no SFC accel device found
sfc_netback: Gracefully handle case where page grant fails
sfc_netback: Disable net acceleration if the physical link goes down
sfc_netfront: Less verbose error messages, more verbose counters for
rx discard errors
sfc_netfront: Gracefully handle case where SFC netfront fails during
initialisation

Signed-off-by: Kieran Mansley <kmansley@solarflare.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 31 11:59:10 2009 +0100 (2009-03-31)
parents 831230e53067
children
line source
1 #include <linux/kernel.h>
2 #include <linux/bitops.h>
3 #include <linux/cpumask.h>
4 #include <linux/module.h>
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);
12 int __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 }
16 EXPORT_SYMBOL(__next_cpu);
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 */
24 int highest_possible_processor_id(void)
25 {
26 unsigned int cpu;
27 unsigned highest = 0;
29 for_each_cpu_mask(cpu, cpu_possible_map)
30 highest = cpu;
31 return highest;
32 }
33 EXPORT_SYMBOL(highest_possible_processor_id);
35 int __any_online_cpu(const cpumask_t *mask)
36 {
37 int cpu;
39 for_each_cpu_mask(cpu, *mask) {
40 if (cpu_online(cpu))
41 break;
42 }
43 return cpu;
44 }
45 EXPORT_SYMBOL(__any_online_cpu);