diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-17 16:15:55 -0500 |
commit | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch) | |
tree | a8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /include/linux/cpumask.h | |
parent | 406089d01562f1e2bf9f089fd7637009ebaad589 (diff) |
Patched in Tegra support.
Diffstat (limited to 'include/linux/cpumask.h')
-rw-r--r-- | include/linux/cpumask.h | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 032560295fc..4f7a6323747 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -9,7 +9,6 @@ | |||
9 | #include <linux/kernel.h> | 9 | #include <linux/kernel.h> |
10 | #include <linux/threads.h> | 10 | #include <linux/threads.h> |
11 | #include <linux/bitmap.h> | 11 | #include <linux/bitmap.h> |
12 | #include <linux/bug.h> | ||
13 | 12 | ||
14 | typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t; | 13 | typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t; |
15 | 14 | ||
@@ -272,8 +271,6 @@ static inline void cpumask_clear_cpu(int cpu, struct cpumask *dstp) | |||
272 | * @cpu: cpu number (< nr_cpu_ids) | 271 | * @cpu: cpu number (< nr_cpu_ids) |
273 | * @cpumask: the cpumask pointer | 272 | * @cpumask: the cpumask pointer |
274 | * | 273 | * |
275 | * Returns 1 if @cpu is set in @cpumask, else returns 0 | ||
276 | * | ||
277 | * No static inline type checking - see Subtlety (1) above. | 274 | * No static inline type checking - see Subtlety (1) above. |
278 | */ | 275 | */ |
279 | #define cpumask_test_cpu(cpu, cpumask) \ | 276 | #define cpumask_test_cpu(cpu, cpumask) \ |
@@ -284,8 +281,6 @@ static inline void cpumask_clear_cpu(int cpu, struct cpumask *dstp) | |||
284 | * @cpu: cpu number (< nr_cpu_ids) | 281 | * @cpu: cpu number (< nr_cpu_ids) |
285 | * @cpumask: the cpumask pointer | 282 | * @cpumask: the cpumask pointer |
286 | * | 283 | * |
287 | * Returns 1 if @cpu is set in old bitmap of @cpumask, else returns 0 | ||
288 | * | ||
289 | * test_and_set_bit wrapper for cpumasks. | 284 | * test_and_set_bit wrapper for cpumasks. |
290 | */ | 285 | */ |
291 | static inline int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask) | 286 | static inline int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask) |
@@ -298,8 +293,6 @@ static inline int cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask) | |||
298 | * @cpu: cpu number (< nr_cpu_ids) | 293 | * @cpu: cpu number (< nr_cpu_ids) |
299 | * @cpumask: the cpumask pointer | 294 | * @cpumask: the cpumask pointer |
300 | * | 295 | * |
301 | * Returns 1 if @cpu is set in old bitmap of @cpumask, else returns 0 | ||
302 | * | ||
303 | * test_and_clear_bit wrapper for cpumasks. | 296 | * test_and_clear_bit wrapper for cpumasks. |
304 | */ | 297 | */ |
305 | static inline int cpumask_test_and_clear_cpu(int cpu, struct cpumask *cpumask) | 298 | static inline int cpumask_test_and_clear_cpu(int cpu, struct cpumask *cpumask) |
@@ -330,8 +323,6 @@ static inline void cpumask_clear(struct cpumask *dstp) | |||
330 | * @dstp: the cpumask result | 323 | * @dstp: the cpumask result |
331 | * @src1p: the first input | 324 | * @src1p: the first input |
332 | * @src2p: the second input | 325 | * @src2p: the second input |
333 | * | ||
334 | * If *@dstp is empty, returns 0, else returns 1 | ||
335 | */ | 326 | */ |
336 | static inline int cpumask_and(struct cpumask *dstp, | 327 | static inline int cpumask_and(struct cpumask *dstp, |
337 | const struct cpumask *src1p, | 328 | const struct cpumask *src1p, |
@@ -373,8 +364,6 @@ static inline void cpumask_xor(struct cpumask *dstp, | |||
373 | * @dstp: the cpumask result | 364 | * @dstp: the cpumask result |
374 | * @src1p: the first input | 365 | * @src1p: the first input |
375 | * @src2p: the second input | 366 | * @src2p: the second input |
376 | * | ||
377 | * If *@dstp is empty, returns 0, else returns 1 | ||
378 | */ | 367 | */ |
379 | static inline int cpumask_andnot(struct cpumask *dstp, | 368 | static inline int cpumask_andnot(struct cpumask *dstp, |
380 | const struct cpumask *src1p, | 369 | const struct cpumask *src1p, |
@@ -424,8 +413,6 @@ static inline bool cpumask_intersects(const struct cpumask *src1p, | |||
424 | * cpumask_subset - (*src1p & ~*src2p) == 0 | 413 | * cpumask_subset - (*src1p & ~*src2p) == 0 |
425 | * @src1p: the first input | 414 | * @src1p: the first input |
426 | * @src2p: the second input | 415 | * @src2p: the second input |
427 | * | ||
428 | * Returns 1 if *@src1p is a subset of *@src2p, else returns 0 | ||
429 | */ | 416 | */ |
430 | static inline int cpumask_subset(const struct cpumask *src1p, | 417 | static inline int cpumask_subset(const struct cpumask *src1p, |
431 | const struct cpumask *src2p) | 418 | const struct cpumask *src2p) |
@@ -591,8 +578,9 @@ static inline int cpulist_scnprintf(char *buf, int len, | |||
591 | } | 578 | } |
592 | 579 | ||
593 | /** | 580 | /** |
594 | * cpulist_parse - extract a cpumask from a user string of ranges | 581 | * cpulist_parse_user - extract a cpumask from a user string of ranges |
595 | * @buf: the buffer to extract from | 582 | * @buf: the buffer to extract from |
583 | * @len: the length of the buffer | ||
596 | * @dstp: the cpumask to set. | 584 | * @dstp: the cpumask to set. |
597 | * | 585 | * |
598 | * Returns -errno, or 0 for success. | 586 | * Returns -errno, or 0 for success. |
@@ -775,6 +763,12 @@ static inline const struct cpumask *get_cpu_mask(unsigned int cpu) | |||
775 | * | 763 | * |
776 | */ | 764 | */ |
777 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS | 765 | #ifndef CONFIG_DISABLE_OBSOLETE_CPUMASK_FUNCTIONS |
766 | /* These strip const, as traditionally they weren't const. */ | ||
767 | #define cpu_possible_map (*(cpumask_t *)cpu_possible_mask) | ||
768 | #define cpu_online_map (*(cpumask_t *)cpu_online_mask) | ||
769 | #define cpu_present_map (*(cpumask_t *)cpu_present_mask) | ||
770 | #define cpu_active_map (*(cpumask_t *)cpu_active_mask) | ||
771 | |||
778 | #define cpumask_of_cpu(cpu) (*get_cpu_mask(cpu)) | 772 | #define cpumask_of_cpu(cpu) (*get_cpu_mask(cpu)) |
779 | 773 | ||
780 | #define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS) | 774 | #define CPU_MASK_LAST_WORD BITMAP_LAST_WORD_MASK(NR_CPUS) |
@@ -815,10 +809,11 @@ static inline const struct cpumask *get_cpu_mask(unsigned int cpu) | |||
815 | #else /* NR_CPUS > 1 */ | 809 | #else /* NR_CPUS > 1 */ |
816 | int __first_cpu(const cpumask_t *srcp); | 810 | int __first_cpu(const cpumask_t *srcp); |
817 | int __next_cpu(int n, const cpumask_t *srcp); | 811 | int __next_cpu(int n, const cpumask_t *srcp); |
812 | int __any_online_cpu(const cpumask_t *mask); | ||
818 | 813 | ||
819 | #define first_cpu(src) __first_cpu(&(src)) | 814 | #define first_cpu(src) __first_cpu(&(src)) |
820 | #define next_cpu(n, src) __next_cpu((n), &(src)) | 815 | #define next_cpu(n, src) __next_cpu((n), &(src)) |
821 | #define any_online_cpu(mask) cpumask_any_and(&mask, cpu_online_mask) | 816 | #define any_online_cpu(mask) __any_online_cpu(&(mask)) |
822 | #define for_each_cpu_mask(cpu, mask) \ | 817 | #define for_each_cpu_mask(cpu, mask) \ |
823 | for ((cpu) = -1; \ | 818 | for ((cpu) = -1; \ |
824 | (cpu) = next_cpu((cpu), (mask)), \ | 819 | (cpu) = next_cpu((cpu), (mask)), \ |