summaryrefslogtreecommitdiff
path: root/rust/helpers/cpumask.c
diff options
context:
space:
mode:
authorThomas Hellström <thomas.hellstrom@linux.intel.com>2025-04-24 13:34:55 +0200
committerThomas Hellström <thomas.hellstrom@linux.intel.com>2025-04-24 13:34:55 +0200
commit3ab7ae8e07f888f223027f0ef84d33e43919ad55 (patch)
tree298aa9f969b1342b5ea242f84e9a3c16ed20bd44 /rust/helpers/cpumask.c
parent4ea512714c42c69828b4a2647d206bf404043ad5 (diff)
parentb60301774a8fe6c30b14a95104ec099290a2e904 (diff)
Merge drm/drm-next into drm-xe-next
Backmerge to bring in linux 6.15-rc. Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Diffstat (limited to 'rust/helpers/cpumask.c')
-rw-r--r--rust/helpers/cpumask.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/rust/helpers/cpumask.c b/rust/helpers/cpumask.c
new file mode 100644
index 000000000000..2d380a86c34a
--- /dev/null
+++ b/rust/helpers/cpumask.c
@@ -0,0 +1,45 @@
+// SPDX-License-Identifier: GPL-2.0
+
+#include <linux/cpumask.h>
+
+void rust_helper_cpumask_set_cpu(unsigned int cpu, struct cpumask *dstp)
+{
+ cpumask_set_cpu(cpu, dstp);
+}
+
+void rust_helper_cpumask_clear_cpu(int cpu, struct cpumask *dstp)
+{
+ cpumask_clear_cpu(cpu, dstp);
+}
+
+void rust_helper_cpumask_setall(struct cpumask *dstp)
+{
+ cpumask_setall(dstp);
+}
+
+unsigned int rust_helper_cpumask_weight(struct cpumask *srcp)
+{
+ return cpumask_weight(srcp);
+}
+
+void rust_helper_cpumask_copy(struct cpumask *dstp, const struct cpumask *srcp)
+{
+ cpumask_copy(dstp, srcp);
+}
+
+bool rust_helper_alloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
+{
+ return alloc_cpumask_var(mask, flags);
+}
+
+bool rust_helper_zalloc_cpumask_var(cpumask_var_t *mask, gfp_t flags)
+{
+ return zalloc_cpumask_var(mask, flags);
+}
+
+#ifndef CONFIG_CPUMASK_OFFSTACK
+void rust_helper_free_cpumask_var(cpumask_var_t mask)
+{
+ free_cpumask_var(mask);
+}
+#endif