summaryrefslogtreecommitdiff
path: root/rust/kernel/processor.rs
blob: 85b49b3614dd2d72273b372920403261b77afd51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
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() }
}