[][src]Enum sunrise_kernel::panic::PanicOrigin

pub enum PanicOrigin<'a> {
    KernelAssert {
        panic_message: Arguments<'a>,
    },
    KernelFault {
        exception_message: Arguments<'a>,
        kernel_hardware_context: UserspaceHardwareContext,
    },
    DoubleFault,
    UserspaceFault {
        exception_message: Arguments<'a>,
        userspace_hardware_context: UserspaceHardwareContext,
    },
}

Reason for a kernel panic. Must be passed to kernel_panic.

Variants

KernelAssert

The kernel failed an assertion.

This is a case when we make a call to panic!(), assert!(), make an out of bound access, etc.

Fields of KernelAssert

panic_message: Arguments<'a>

Formatted string passed to panic!().

KernelFault

CPU Exception occurred while we were in kernel, e.g. page fault.

This means there's a serious bug in the kernel.

Fields of KernelFault

exception_message: Arguments<'a>

Formatted string of the exception name, and optional cpu error code.

kernel_hardware_context: UserspaceHardwareContext

Kernel registers state before exception.

DoubleFault

Kernel Faulted, and then the fault handler faulted too.

You fucked up on some quality level.

Registers state before the second fault can be retrieved from the MAIN_TASK tss.

UserspaceFault

Userspace exception.

Normally this isn't a panic, the kernel should kill the faulty process, display an error message, and keep on going.

But if the feature panic-on-exception is enabled, we make the kernel panic to help debugging sessions.

Fields of UserspaceFault

exception_message: Arguments<'a>

Formatted string of the exception name, and optional cpu error code.

userspace_hardware_context: UserspaceHardwareContext

Userspace registers state before exception.

Auto Trait Implementations

impl<'a> !RefUnwindSafe for PanicOrigin<'a>

impl<'a> !Send for PanicOrigin<'a>

impl<'a> !Sync for PanicOrigin<'a>

impl<'a> Unpin for PanicOrigin<'a>

impl<'a> !UnwindSafe for PanicOrigin<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.