Struct InterruptStackFrameValue
#[repr(C)]pub struct InterruptStackFrameValue {
pub instruction_pointer: VirtAddr,
pub code_segment: SegmentSelector,
_reserved1: [u8; 6],
pub cpu_flags: RFlags,
pub stack_pointer: VirtAddr,
pub stack_segment: SegmentSelector,
_reserved2: [u8; 6],
}Expand description
Represents the interrupt stack frame pushed by the CPU on interrupt or exception entry.
Fields§
§instruction_pointer: VirtAddrThis value points to the instruction that should be executed when the interrupt
handler returns. For most interrupts, this value points to the instruction immediately
following the last executed instruction. However, for some exceptions (e.g., page faults),
this value points to the faulting instruction, so that the instruction is restarted on
return. See the documentation of the InterruptDescriptorTable fields for more details.
code_segment: SegmentSelectorThe code segment selector at the time of the interrupt.
_reserved1: [u8; 6]§cpu_flags: RFlagsThe flags register before the interrupt handler was invoked.
stack_pointer: VirtAddrThe stack pointer at the time of the interrupt.
stack_segment: SegmentSelectorThe stack segment descriptor at the time of the interrupt (often zero in 64-bit mode).
_reserved2: [u8; 6]Implementations§
§impl InterruptStackFrameValue
impl InterruptStackFrameValue
pub fn new(
instruction_pointer: VirtAddr,
code_segment: SegmentSelector,
cpu_flags: RFlags,
stack_pointer: VirtAddr,
stack_segment: SegmentSelector,
) -> InterruptStackFrameValue
pub fn new( instruction_pointer: VirtAddr, code_segment: SegmentSelector, cpu_flags: RFlags, stack_pointer: VirtAddr, stack_segment: SegmentSelector, ) -> InterruptStackFrameValue
Creates a new interrupt stack frame with the given values.
pub unsafe fn iretq(&self) -> !
pub unsafe fn iretq(&self) -> !
Call the iretq (interrupt return) instruction.
This function doesn’t have to be called in an interrupt handler.
By manually construction a new InterruptStackFrameValue it’s possible to transition
from a higher privilege level to a lower one.
§Safety
Calling iretq is unsafe because setting the instruction pointer, stack pointer, RFlags,
CS and SS register can all cause undefined behaviour when done incorrectly.
Trait Implementations§
§impl Clone for InterruptStackFrameValue
impl Clone for InterruptStackFrameValue
§fn clone(&self) -> InterruptStackFrameValue
fn clone(&self) -> InterruptStackFrameValue
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for InterruptStackFrameValue
Auto Trait Implementations§
impl Freeze for InterruptStackFrameValue
impl RefUnwindSafe for InterruptStackFrameValue
impl Send for InterruptStackFrameValue
impl Sync for InterruptStackFrameValue
impl Unpin for InterruptStackFrameValue
impl UnsafeUnpin for InterruptStackFrameValue
impl UnwindSafe for InterruptStackFrameValue
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more