Skip to content

Commit b4f1ffd

Browse files
DarksonnYuryNorov
authored andcommitted
rust: cpumask: add __rust_helper to helpers
This is needed to inline these helpers into Rust code. Reviewed-by: Boqun Feng <boqun.feng@gmail.com> Reviewed-by: Gary Guo <gary@garyguo.net> Signed-off-by: Alice Ryhl <aliceryhl@google.com> Signed-off-by: Yury Norov (NVIDIA) <yury.norov@gmail.com>
1 parent 8618307 commit b4f1ffd

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

rust/helpers/cpumask.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,67 +2,80 @@
22

33
#include <linux/cpumask.h>
44

5+
__rust_helper
56
void rust_helper_cpumask_set_cpu(unsigned int cpu, struct cpumask *dstp)
67
{
78
cpumask_set_cpu(cpu, dstp);
89
}
910

11+
__rust_helper
1012
void rust_helper___cpumask_set_cpu(unsigned int cpu, struct cpumask *dstp)
1113
{
1214
__cpumask_set_cpu(cpu, dstp);
1315
}
1416

17+
__rust_helper
1518
void rust_helper_cpumask_clear_cpu(int cpu, struct cpumask *dstp)
1619
{
1720
cpumask_clear_cpu(cpu, dstp);
1821
}
1922

23+
__rust_helper
2024
void rust_helper___cpumask_clear_cpu(int cpu, struct cpumask *dstp)
2125
{
2226
__cpumask_clear_cpu(cpu, dstp);
2327
}
2428

29+
__rust_helper
2530
bool rust_helper_cpumask_test_cpu(int cpu, struct cpumask *srcp)
2631
{
2732
return cpumask_test_cpu(cpu, srcp);
2833
}
2934

35+
__rust_helper
3036
void rust_helper_cpumask_setall(struct cpumask *dstp)
3137
{
3238
cpumask_setall(dstp);
3339
}
3440

41+
__rust_helper
3542
bool rust_helper_cpumask_empty(struct cpumask *srcp)
3643
{
3744
return cpumask_empty(srcp);
3845
}
3946

47+
__rust_helper
4048
bool rust_helper_cpumask_full(struct cpumask *srcp)
4149
{
4250
return cpumask_full(srcp);
4351
}
4452

53+
__rust_helper
4554
unsigned int rust_helper_cpumask_weight(struct cpumask *srcp)
4655
{
4756
return cpumask_weight(srcp);
4857
}
4958

59+
__rust_helper
5060
void rust_helper_cpumask_copy(struct cpumask *dstp, const struct cpumask *srcp)
5161
{
5262
cpumask_copy(dstp, srcp);
5363
}
5464

65+
__rust_helper
5566
bool rust_helper_alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
5667
{
5768
return alloc_cpumask_var(mask, flags);
5869
}
5970

71+
__rust_helper
6072
bool rust_helper_zalloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
6173
{
6274
return zalloc_cpumask_var(mask, flags);
6375
}
6476

6577
#ifndef CONFIG_CPUMASK_OFFSTACK
78+
__rust_helper
6679
void rust_helper_free_cpumask_var(cpumask_var_t mask)
6780
{
6881
free_cpumask_var(mask);

0 commit comments

Comments
 (0)