xref: /linux/rust/helpers/cpumask.c (revision 69050f8d6d075dc01af7a5f2f550a8067510366f)
1 // SPDX-License-Identifier: GPL-2.0
2 
3 #include <linux/cpumask.h>
4 
5 __rust_helper
6 void rust_helper_cpumask_set_cpu(unsigned int cpu, struct cpumask *dstp)
7 {
8 	cpumask_set_cpu(cpu, dstp);
9 }
10 
11 __rust_helper
12 void rust_helper___cpumask_set_cpu(unsigned int cpu, struct cpumask *dstp)
13 {
14 	__cpumask_set_cpu(cpu, dstp);
15 }
16 
17 __rust_helper
18 void rust_helper_cpumask_clear_cpu(int cpu, struct cpumask *dstp)
19 {
20 	cpumask_clear_cpu(cpu, dstp);
21 }
22 
23 __rust_helper
24 void rust_helper___cpumask_clear_cpu(int cpu, struct cpumask *dstp)
25 {
26 	__cpumask_clear_cpu(cpu, dstp);
27 }
28 
29 __rust_helper
30 bool rust_helper_cpumask_test_cpu(int cpu, struct cpumask *srcp)
31 {
32 	return cpumask_test_cpu(cpu, srcp);
33 }
34 
35 __rust_helper
36 void rust_helper_cpumask_setall(struct cpumask *dstp)
37 {
38 	cpumask_setall(dstp);
39 }
40 
41 __rust_helper
42 bool rust_helper_cpumask_empty(struct cpumask *srcp)
43 {
44 	return cpumask_empty(srcp);
45 }
46 
47 __rust_helper
48 bool rust_helper_cpumask_full(struct cpumask *srcp)
49 {
50 	return cpumask_full(srcp);
51 }
52 
53 __rust_helper
54 unsigned int rust_helper_cpumask_weight(struct cpumask *srcp)
55 {
56 	return cpumask_weight(srcp);
57 }
58 
59 __rust_helper
60 void rust_helper_cpumask_copy(struct cpumask *dstp, const struct cpumask *srcp)
61 {
62 	cpumask_copy(dstp, srcp);
63 }
64 
65 __rust_helper
66 bool rust_helper_alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
67 {
68 	return alloc_cpumask_var(mask, flags);
69 }
70 
71 __rust_helper
72 bool rust_helper_zalloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
73 {
74 	return zalloc_cpumask_var(mask, flags);
75 }
76 
77 #ifndef CONFIG_CPUMASK_OFFSTACK
78 __rust_helper
79 void rust_helper_free_cpumask_var(cpumask_var_t mask)
80 {
81 	free_cpumask_var(mask);
82 }
83 #endif
84