Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23599
b: refs/heads/master
c: 96a9b4d
h: refs/heads/master
i:
  23597: 9ec1a10
  23595: 13be319
  23591: 6373379
  23583: 6d67170
v: v3
  • Loading branch information
Andrew Morton authored and Linus Torvalds committed Mar 25, 2006
1 parent 51ad3ad commit afe2333
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8630282070b4a52b12cfa514ba8558e2f3d56360
refs/heads/master: 96a9b4d31eba4722ba7aad2cc15118a7799f499f
13 changes: 3 additions & 10 deletions trunk/include/linux/cpumask.h
Original file line number Diff line number Diff line change
Expand Up @@ -398,22 +398,15 @@ extern cpumask_t cpu_present_map;

#ifdef CONFIG_SMP
int highest_possible_processor_id(void);
#define any_online_cpu(mask) __any_online_cpu(&(mask))
int __any_online_cpu(const cpumask_t *mask);
#else
#define highest_possible_processor_id() 0
#define any_online_cpu(mask) 0
#endif

#define any_online_cpu(mask) \
({ \
int cpu; \
for_each_cpu_mask(cpu, (mask)) \
if (cpu_online(cpu)) \
break; \
cpu; \
})

#define for_each_cpu(cpu) for_each_cpu_mask((cpu), cpu_possible_map)
#define for_each_online_cpu(cpu) for_each_cpu_mask((cpu), cpu_online_map)
#define for_each_present_cpu(cpu) for_each_cpu_mask((cpu), cpu_present_map)


#endif /* __LINUX_CPUMASK_H */
12 changes: 12 additions & 0 deletions trunk/lib/cpumask.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,15 @@ int highest_possible_processor_id(void)
return highest;
}
EXPORT_SYMBOL(highest_possible_processor_id);

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

0 comments on commit afe2333

Please sign in to comment.