diff options
Diffstat (limited to 'include/linux/cpumask.h')
| -rw-r--r-- | include/linux/cpumask.h | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 8d3125c493b2..75b565194437 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
| @@ -131,6 +131,11 @@ static inline unsigned int cpumask_first(const struct cpumask *srcp) | |||
| 131 | return 0; | 131 | return 0; |
| 132 | } | 132 | } |
| 133 | 133 | ||
| 134 | static inline unsigned int cpumask_last(const struct cpumask *srcp) | ||
| 135 | { | ||
| 136 | return 0; | ||
| 137 | } | ||
| 138 | |||
| 134 | /* Valid inputs for n are -1 and 0. */ | 139 | /* Valid inputs for n are -1 and 0. */ |
| 135 | static inline unsigned int cpumask_next(int n, const struct cpumask *srcp) | 140 | static inline unsigned int cpumask_next(int n, const struct cpumask *srcp) |
| 136 | { | 141 | { |
| @@ -179,6 +184,17 @@ static inline unsigned int cpumask_first(const struct cpumask *srcp) | |||
| 179 | return find_first_bit(cpumask_bits(srcp), nr_cpumask_bits); | 184 | return find_first_bit(cpumask_bits(srcp), nr_cpumask_bits); |
| 180 | } | 185 | } |
| 181 | 186 | ||
| 187 | /** | ||
| 188 | * cpumask_last - get the last CPU in a cpumask | ||
| 189 | * @srcp: - the cpumask pointer | ||
| 190 | * | ||
| 191 | * Returns >= nr_cpumask_bits if no CPUs set. | ||
| 192 | */ | ||
| 193 | static inline unsigned int cpumask_last(const struct cpumask *srcp) | ||
| 194 | { | ||
| 195 | return find_last_bit(cpumask_bits(srcp), nr_cpumask_bits); | ||
| 196 | } | ||
| 197 | |||
| 182 | unsigned int cpumask_next(int n, const struct cpumask *srcp); | 198 | unsigned int cpumask_next(int n, const struct cpumask *srcp); |
| 183 | 199 | ||
| 184 | /** | 200 | /** |
