#[repr(C)]pub struct PerCpuData {
pub kernel_rsp: u64,
pub user_rsp: u64,
}Expand description
Per-CPU data accessed via GS segment register during syscall entry/exit.
The syscall_entry naked asm reads kernel_rsp from gs:[0x0] and saves
user_rsp to gs:[0x8]. This struct must be #[repr(C)] to guarantee
field layout matches the assembly offsets.
Fields§
§kernel_rsp: u64Kernel stack pointer (offset 0x0) – loaded into RSP on syscall entry
user_rsp: u64User stack pointer (offset 0x8) – saved from RSP on syscall entry