diff options
Diffstat (limited to 'rust/helpers/task.c')
-rw-r--r-- | rust/helpers/task.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/rust/helpers/task.c b/rust/helpers/task.c new file mode 100644 index 000000000000..b176c347f0d4 --- /dev/null +++ b/rust/helpers/task.c @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-2.0 + +#include <linux/export.h> +#include <linux/sched/task.h> + +struct task_struct *rust_helper_get_current(void) +{ + return current; +} +EXPORT_SYMBOL_GPL(rust_helper_get_current); + +void rust_helper_get_task_struct(struct task_struct *t) +{ + get_task_struct(t); +} +EXPORT_SYMBOL_GPL(rust_helper_get_task_struct); + +void rust_helper_put_task_struct(struct task_struct *t) +{ + put_task_struct(t); +} +EXPORT_SYMBOL_GPL(rust_helper_put_task_struct); |