aboutsummaryrefslogtreecommitdiffstats
path: root/rust/helpers/helpers.c
diff options
context:
space:
mode:
authorAlice Ryhl <[email protected]>2024-09-15 14:31:28 +0000
committerChristian Brauner <[email protected]>2024-09-30 11:02:28 +0000
commit913f8cf4f376d21082c6c33d49c8c3aa9fb7e83a (patch)
treec3a0446209fa26fbd03af1d152c9d58ca072635d /rust/helpers/helpers.c
parentrust: types: add `NotThreadSafe` (diff)
downloadkernel-913f8cf4f376d21082c6c33d49c8c3aa9fb7e83a.tar.gz
kernel-913f8cf4f376d21082c6c33d49c8c3aa9fb7e83a.zip
rust: task: add `Task::current_raw`
Introduces a safe function for getting a raw pointer to the current task. When writing bindings that need to access the current task, it is often more convenient to call a method that directly returns a raw pointer than to use the existing `Task::current` method. However, the only way to do that is `bindings::get_current()` which is unsafe since it calls into C. By introducing `Task::current_raw()`, it becomes possible to obtain a pointer to the current task without using unsafe. Link: https://lore.kernel.org/all/CAH5fLgjT48X-zYtidv31mox3C4_Ogoo_2cBOCmX0Ang3tAgGHA@mail.gmail.com/ Reviewed-by: Benno Lossin <[email protected]> Reviewed-by: Martin Rodriguez Reboredo <[email protected]> Reviewed-by: Trevor Gross <[email protected]> Reviewed-by: Gary Guo <[email protected]> Signed-off-by: Alice Ryhl <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Christian Brauner <[email protected]>
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions