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_clear_cpu(int cpu, struct cpumask *dstp) 11 { 12 cpumask_clear_cpu(cpu, dstp); 13 } 14 15 void rust_helper_cpumask_setall(struct cpumask *dstp) 16 { 17 cpumask_setall(dstp); 18 } 19 20 unsigned int rust_helper_cpumask_weight(struct cpumask *srcp) 21 { 22 return cpumask_weight(srcp); 23 } 24 25 void rust_helper_cpumask_copy(struct cpumask *dstp, const struct cpumask *srcp) 26 { 27 cpumask_copy(dstp, srcp); 28 } 29 30 bool rust_helper_alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags) 31 { 32 return alloc_cpumask_var(mask, flags); 33 } 34 35 bool rust_helper_zalloc_cpumask_var(cpumask_var_t *mask, gfp_t flags) 36 { 37 return zalloc_cpumask_var(mask, flags); 38 } 39 40 #ifndef CONFIG_CPUMASK_OFFSTACK 41 void rust_helper_free_cpumask_var(cpumask_var_t mask) 42 { 43 free_cpumask_var(mask); 44 } 45 #endif 46