Commit | Line | Data |
---|---|---|
74cc1f59 MJ |
1 | /* |
2 | * SPDX-License-Identifier: LGPL-2.1-only | |
3 | * | |
4 | * Copyright (C) 2011-2012 Mathieu Desnoyers <mathieu.desnoyers@efficios.com> | |
5 | */ | |
6 | ||
7 | #ifndef _UST_COMMON_SMP_H | |
8 | #define _UST_COMMON_SMP_H | |
9 | ||
10 | /* | |
11 | * Returns the total number of CPUs in the system. If the cache is not yet | |
12 | * initialized, get the value from the system through sysconf and cache it. | |
13 | * | |
14 | * If the sysconf call fails, don't populate the cache and return 0. | |
15 | */ | |
95fa2ba4 MJ |
16 | int num_possible_cpus(void) |
17 | __attribute__((visibility("hidden"))); | |
74cc1f59 MJ |
18 | |
19 | #define for_each_possible_cpu(cpu) \ | |
20 | for ((cpu) = 0; (cpu) < num_possible_cpus(); (cpu)++) | |
21 | ||
22 | #endif /* _UST_COMMON_SMP_H */ |