diff options
| author | Thomas Zimmermann <tzimmermann@suse.de> | 2025-10-14 10:59:58 +0200 |
|---|---|---|
| committer | Thomas Zimmermann <tzimmermann@suse.de> | 2025-10-14 10:59:58 +0200 |
| commit | 48a710760e10a4f36e11233a21860796ba204b1e (patch) | |
| tree | 16310f153edd77adc24a4f4474697a87147416a6 /rust/kernel/processor.rs | |
| parent | 7f38a1487555604bc4e210fa7cc9b1bce981c40e (diff) | |
| parent | 3a8660878839faadb4f1a6dd72c3179c1df56787 (diff) | |
Merge drm/drm-fixes into drm-misc-fixes
Updating drm-misc-fixes to the state of v6.18-rc1.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Diffstat (limited to 'rust/kernel/processor.rs')
| -rw-r--r-- | rust/kernel/processor.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/rust/kernel/processor.rs b/rust/kernel/processor.rs new file mode 100644 index 000000000000..85b49b3614dd --- /dev/null +++ b/rust/kernel/processor.rs @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0 + +//! Processor related primitives. +//! +//! C header: [`include/linux/processor.h`](srctree/include/linux/processor.h) + +/// Lower CPU power consumption or yield to a hyperthreaded twin processor. +/// +/// It also happens to serve as a compiler barrier. +#[inline] +pub fn cpu_relax() { + // SAFETY: Always safe to call. + unsafe { bindings::cpu_relax() } +} |
