#[repr(C)]
pub struct InterruptStackFrame { /* private fields */ }
Expand description

Wrapper type for the interrupt stack frame pushed by the CPU.

This type derefs to an [InterruptStackFrameValue], which allows reading the actual values.

This wrapper type ensures that no accidental modification of the interrupt stack frame occurs, which can cause undefined behavior (see the as_mut method for more information).

Implementations§

§

impl InterruptStackFrame

pub unsafe fn as_mut( &mut self ) -> Volatile<&mut InterruptStackFrameValue, ReadWrite>

Gives mutable access to the contents of the interrupt stack frame.

The Volatile wrapper is used because LLVM optimizations remove non-volatile modifications of the interrupt stack frame.

Safety

This function is unsafe since modifying the content of the interrupt stack frame can easily lead to undefined behavior. For example, by writing an invalid value to the instruction pointer field, the CPU can jump to arbitrary code at the end of the interrupt.

Also, it is not fully clear yet whether modifications of the interrupt stack frame are officially supported by LLVM’s x86 interrupt calling convention.

Trait Implementations§

§

impl Debug for InterruptStackFrame

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Deref for InterruptStackFrame

§

type Target = InterruptStackFrameValue

The resulting type after dereferencing.
§

fn deref(&self) -> &<InterruptStackFrame as Deref>::Target

Dereferences the value.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.