Struct percpu::EXAMPLE_PERCPU_DATA_WRAPPER
source · pub struct EXAMPLE_PERCPU_DATA_WRAPPER {}
Expand description
Wrapper struct for the per-CPU data EXAMPLE_PERCPU_DATA
Implementations§
source§impl EXAMPLE_PERCPU_DATA_WRAPPER
impl EXAMPLE_PERCPU_DATA_WRAPPER
sourcepub fn offset(&self) -> usize
pub fn offset(&self) -> usize
Returns the offset relative to the per-CPU data area base on the current CPU.
sourcepub unsafe fn current_ptr(&self) -> *const usize
pub unsafe fn current_ptr(&self) -> *const usize
Returns the raw pointer of this per-CPU data on the current CPU.
Safety
Caller must ensure that preemption is disabled on the current CPU.
sourcepub unsafe fn current_ref_raw(&self) -> &usize
pub unsafe fn current_ref_raw(&self) -> &usize
Returns the reference of the per-CPU data on the current CPU.
Safety
Caller must ensure that preemption is disabled on the current CPU.
sourcepub unsafe fn current_ref_mut_raw(&self) -> &mut usize
pub unsafe fn current_ref_mut_raw(&self) -> &mut usize
Returns the mutable reference of the per-CPU data on the current CPU.
Safety
Caller must ensure that preemption is disabled on the current CPU.
sourcepub fn with_current<F, T>(&self, f: F) -> T
pub fn with_current<F, T>(&self, f: F) -> T
Manipulate the per-CPU data on the current CPU in the given closure. Preemption will be disabled during the call.
sourcepub unsafe fn read_current_raw(&self) -> usize
pub unsafe fn read_current_raw(&self) -> usize
Returns the value of the per-CPU data on the current CPU.
Safety
Caller must ensure that preemption is disabled on the current CPU.
sourcepub unsafe fn write_current_raw(&self, val: usize)
pub unsafe fn write_current_raw(&self, val: usize)
Set the value of the per-CPU data on the current CPU.
Safety
Caller must ensure that preemption is disabled on the current CPU.
sourcepub fn read_current(&self) -> usize
pub fn read_current(&self) -> usize
Returns the value of the per-CPU data on the current CPU. Preemption will be disabled during the call.
sourcepub fn write_current(&self, val: usize)
pub fn write_current(&self, val: usize)
Set the value of the per-CPU data on the current CPU. Preemption will be disabled during the call.