Skip to main content

percore

Attribute Macro percore 

Source
#[percore]
Expand description

Marks the variable as percore, creating an instance for each core.

This replaces the static with a percore::derive::LinkedPerCore of the same name and places it in the percore linker section. The static’s symbol is the base address of the per-core variable and can be used to access it from assembly.

§Example

use percore::{ExceptionLock, derive::percore};
use core::cell::RefCell;

#[percore]
static VARIABLE: ExceptionLock<RefCell<u64>> = ExceptionLock::new(RefCell::new(1));