Lines Matching refs:cpumask

20 typedef struct cpumask { DECLARE_BITMAP(bits, NR_CPUS); } cpumask_t;
23 * cpumask_bits - get the bits in a cpumask
24 * @maskp: the struct cpumask *
32 * cpumask_pr_args - printf args to output a cpumask
33 * @maskp: cpumask to be printed
35 * Can be used to provide arguments for '%*pb[l]' when printing a cpumask.
55 * We have several different "preferred sizes" for the cpumask
73 * least as big as 'nr_cpu_ids' itself is, and all our cpumask
126 extern struct cpumask __cpu_possible_mask;
127 extern struct cpumask __cpu_online_mask;
128 extern struct cpumask __cpu_present_mask;
129 extern struct cpumask __cpu_active_mask;
130 extern struct cpumask __cpu_dying_mask;
131 #define cpu_possible_mask ((const struct cpumask *)&__cpu_possible_mask)
132 #define cpu_online_mask ((const struct cpumask *)&__cpu_online_mask)
133 #define cpu_present_mask ((const struct cpumask *)&__cpu_present_mask)
134 #define cpu_active_mask ((const struct cpumask *)&__cpu_active_mask)
135 #define cpu_dying_mask ((const struct cpumask *)&__cpu_dying_mask)
156 * cpumask_first - get the first cpu in a cpumask
157 * @srcp: the cpumask pointer
161 static inline unsigned int cpumask_first(const struct cpumask *srcp)
167 * cpumask_first_zero - get the first unset cpu in a cpumask
168 * @srcp: the cpumask pointer
172 static inline unsigned int cpumask_first_zero(const struct cpumask *srcp)
185 unsigned int cpumask_first_and(const struct cpumask *srcp1, const struct cpumask *srcp2)
191 * cpumask_last - get the last CPU in a cpumask
192 * @srcp: - the cpumask pointer
196 static inline unsigned int cpumask_last(const struct cpumask *srcp)
202 * cpumask_next - get the next cpu in a cpumask
204 * @srcp: the cpumask pointer
209 unsigned int cpumask_next(int n, const struct cpumask *srcp)
218 * cpumask_next_zero - get the next unset cpu in a cpumask
220 * @srcp: the cpumask pointer
224 static inline unsigned int cpumask_next_zero(int n, const struct cpumask *srcp)
239 static inline unsigned int cpumask_any_and_distribute(const struct cpumask *src1p,
240 const struct cpumask *src2p)
245 static inline unsigned int cpumask_any_distribute(const struct cpumask *srcp)
251 unsigned int cpumask_any_and_distribute(const struct cpumask *src1p,
252 const struct cpumask *src2p);
253 unsigned int cpumask_any_distribute(const struct cpumask *srcp);
259 * @src1p: the first cpumask pointer
260 * @src2p: the second cpumask pointer
265 unsigned int cpumask_next_and(int n, const struct cpumask *src1p,
266 const struct cpumask *src2p)
278 * @mask: the cpumask pointer
287 unsigned int cpumask_next_wrap(int n, const struct cpumask *mask, int start, bool wrap)
303 unsigned int __pure cpumask_next_wrap(int n, const struct cpumask *mask, int start, bool wrap);
309 * @mask: the cpumask pointer
322 * @mask1: the first cpumask pointer
323 * @mask2: the second cpumask pointer
326 * struct cpumask tmp;
340 * @mask1: the first cpumask pointer
341 * @mask2: the second cpumask pointer
344 * struct cpumask tmp;
357 * @mask1: the first cpumask pointer
358 * @mask2: the second cpumask pointer
361 * struct cpumask tmp;
372 * cpumask_any_but - return a "random" in a cpumask, but not this one.
373 * @mask: the cpumask to search
380 unsigned int cpumask_any_but(const struct cpumask *mask, unsigned int cpu)
392 * cpumask_nth - get the Nth cpu in a cpumask
393 * @srcp: the cpumask pointer
398 static inline unsigned int cpumask_nth(unsigned int cpu, const struct cpumask *srcp)
405 * @srcp1: the cpumask pointer
406 * @srcp2: the cpumask pointer
412 unsigned int cpumask_nth_and(unsigned int cpu, const struct cpumask *srcp1,
413 const struct cpumask *srcp2)
420 * cpumask_nth_andnot - get the Nth cpu set in 1st cpumask, and clear in 2nd.
421 * @srcp1: the cpumask pointer
422 * @srcp2: the cpumask pointer
428 unsigned int cpumask_nth_andnot(unsigned int cpu, const struct cpumask *srcp1,
429 const struct cpumask *srcp2)
436 * cpumask_nth_and_andnot - get the Nth cpu set in 1st and 2nd cpumask, and clear in 3rd.
437 * @srcp1: the cpumask pointer
438 * @srcp2: the cpumask pointer
439 * @srcp3: the cpumask pointer
445 unsigned int cpumask_nth_and_andnot(unsigned int cpu, const struct cpumask *srcp1,
446 const struct cpumask *srcp2,
447 const struct cpumask *srcp3)
466 * cpumask_set_cpu - set a cpu in a cpumask
468 * @dstp: the cpumask pointer
470 static __always_inline void cpumask_set_cpu(unsigned int cpu, struct cpumask *dstp)
475 static __always_inline void __cpumask_set_cpu(unsigned int cpu, struct cpumask *dstp)
482 * cpumask_clear_cpu - clear a cpu in a cpumask
484 * @dstp: the cpumask pointer
486 static __always_inline void cpumask_clear_cpu(int cpu, struct cpumask *dstp)
491 static __always_inline void __cpumask_clear_cpu(int cpu, struct cpumask *dstp)
497 * cpumask_test_cpu - test for a cpu in a cpumask
499 * @cpumask: the cpumask pointer
501 * Return: true if @cpu is set in @cpumask, else returns false
503 static __always_inline bool cpumask_test_cpu(int cpu, const struct cpumask *cpumask)
505 return test_bit(cpumask_check(cpu), cpumask_bits((cpumask)));
509 * cpumask_test_and_set_cpu - atomically test and set a cpu in a cpumask
511 * @cpumask: the cpumask pointer
515 * Return: true if @cpu is set in old bitmap of @cpumask, else returns false
517 static __always_inline bool cpumask_test_and_set_cpu(int cpu, struct cpumask *cpumask)
519 return test_and_set_bit(cpumask_check(cpu), cpumask_bits(cpumask));
523 * cpumask_test_and_clear_cpu - atomically test and clear a cpu in a cpumask
525 * @cpumask: the cpumask pointer
529 * Return: true if @cpu is set in old bitmap of @cpumask, else returns false
531 static __always_inline bool cpumask_test_and_clear_cpu(int cpu, struct cpumask *cpumask)
533 return test_and_clear_bit(cpumask_check(cpu), cpumask_bits(cpumask));
537 * cpumask_setall - set all cpus (< nr_cpu_ids) in a cpumask
538 * @dstp: the cpumask pointer
540 static inline void cpumask_setall(struct cpumask *dstp)
550 * cpumask_clear - clear all cpus (< nr_cpu_ids) in a cpumask
551 * @dstp: the cpumask pointer
553 static inline void cpumask_clear(struct cpumask *dstp)
560 * @dstp: the cpumask result
566 static inline bool cpumask_and(struct cpumask *dstp,
567 const struct cpumask *src1p,
568 const struct cpumask *src2p)
576 * @dstp: the cpumask result
580 static inline void cpumask_or(struct cpumask *dstp, const struct cpumask *src1p,
581 const struct cpumask *src2p)
589 * @dstp: the cpumask result
593 static inline void cpumask_xor(struct cpumask *dstp,
594 const struct cpumask *src1p,
595 const struct cpumask *src2p)
603 * @dstp: the cpumask result
609 static inline bool cpumask_andnot(struct cpumask *dstp,
610 const struct cpumask *src1p,
611 const struct cpumask *src2p)
624 static inline bool cpumask_equal(const struct cpumask *src1p,
625 const struct cpumask *src2p)
637 * Return: true if first cpumask ORed with second cpumask == third cpumask,
640 static inline bool cpumask_or_equal(const struct cpumask *src1p,
641 const struct cpumask *src2p,
642 const struct cpumask *src3p)
653 * Return: true if first cpumask ANDed with second cpumask is non-empty,
656 static inline bool cpumask_intersects(const struct cpumask *src1p,
657 const struct cpumask *src2p)
670 static inline bool cpumask_subset(const struct cpumask *src1p,
671 const struct cpumask *src2p)
679 * @srcp: the cpumask to that all cpus < nr_cpu_ids are clear.
683 static inline bool cpumask_empty(const struct cpumask *srcp)
690 * @srcp: the cpumask to that all cpus < nr_cpu_ids are set.
694 static inline bool cpumask_full(const struct cpumask *srcp)
701 * @srcp: the cpumask to count bits (< nr_cpu_ids) in.
705 static inline unsigned int cpumask_weight(const struct cpumask *srcp)
712 * @srcp1: the cpumask to count bits (< nr_cpu_ids) in.
713 * @srcp2: the cpumask to count bits (< nr_cpu_ids) in.
717 static inline unsigned int cpumask_weight_and(const struct cpumask *srcp1,
718 const struct cpumask *srcp2)
725 * @srcp1: the cpumask to count bits (< nr_cpu_ids) in.
726 * @srcp2: the cpumask to count bits (< nr_cpu_ids) in.
730 static inline unsigned int cpumask_weight_andnot(const struct cpumask *srcp1,
731 const struct cpumask *srcp2)
738 * @dstp: the cpumask result
742 static inline void cpumask_shift_right(struct cpumask *dstp,
743 const struct cpumask *srcp, int n)
751 * @dstp: the cpumask result
755 static inline void cpumask_shift_left(struct cpumask *dstp,
756 const struct cpumask *srcp, int n)
765 * @srcp: the input cpumask
767 static inline void cpumask_copy(struct cpumask *dstp,
768 const struct cpumask *srcp)
775 * @srcp: the input cpumask
783 * @mask1: the first input cpumask
784 * @mask2: the second input cpumask
791 * cpumask_of - the cpumask containing just a given cpu
797 * cpumask_parse_user - extract a cpumask from a user string
800 * @dstp: the cpumask to set.
805 struct cpumask *dstp)
811 * cpumask_parselist_user - extract a cpumask from a user string
814 * @dstp: the cpumask to set.
819 struct cpumask *dstp)
826 * cpumask_parse - extract a cpumask from a string
828 * @dstp: the cpumask to set.
832 static inline int cpumask_parse(const char *buf, struct cpumask *dstp)
838 * cpulist_parse - extract a cpumask from a user string of ranges
840 * @dstp: the cpumask to set.
844 static inline int cpulist_parse(const char *buf, struct cpumask *dstp)
850 * cpumask_size - calculate size to allocate for a 'struct cpumask' in bytes
852 * Return: size to allocate for a &struct cpumask in bytes
860 * cpumask_var_t: struct cpumask for stack usage.
871 * ... use 'tmpmask' like a normal struct cpumask * ...
890 * as a percpu variable then the way to obtain the address of the cpumask
900 typedef struct cpumask *cpumask_var_t;
914 * alloc_cpumask_var - allocate a struct cpumask
915 * @mask: pointer to cpumask_var_t where the cpumask is returned
919 * a nop returning a constant 1 (in <linux/cpumask.h>).
947 typedef struct cpumask cpumask_var_t[1];
994 DEFINE_FREE(free_cpumask_var, struct cpumask *, if (_T) free_cpumask_var(_T));
1016 void init_cpu_present(const struct cpumask *src);
1017 void init_cpu_possible(const struct cpumask *src);
1018 void init_cpu_online(const struct cpumask *src);
1064 * to_cpumask - convert a NR_CPUS bitmap to a struct cpumask *
1069 * expose the definition of 'struct cpumask'.
1074 ((struct cpumask *)(1 ? (bitmap) \
1092 static inline const struct cpumask *get_cpu_mask(unsigned int cpu)
1195 * cpumap_print_to_pagebuf - copies the cpumask into the buffer either
1196 * as comma-separated list of cpus or hex values of cpumask
1198 * @mask: the cpumask to copy
1205 cpumap_print_to_pagebuf(bool list, char *buf, const struct cpumask *mask)
1212 * cpumap_print_bitmask_to_buf - copies the cpumask into the buffer as
1213 * hex values of cpumask
1216 * @mask: the cpumask to copy
1220 * The function prints the cpumask into the buffer as hex values of
1221 * cpumask; Typically used by bin_attribute to export cpumask bitmask
1228 cpumap_print_bitmask_to_buf(char *buf, const struct cpumask *mask,
1236 * cpumap_print_list_to_buf - copies the cpumask into the buffer as
1239 * @mask: the cpumask to copy
1250 cpumap_print_list_to_buf(char *buf, const struct cpumask *mask,