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