pub unsafe fn load_kernel_fn(
        &mut self,
        ptr: unsafe extern "C" fn (usize) -> i32,
        arg: usize
    ) {
        assert_eq!(self.state, State::Loading);

        // Safety: hwstate exclusive ownership due to Loading state
        //
        // Contract as defined by the unsafety of this function, for
        // set_instruction_pointer and set_argument
        let kstate = self.hw_state_mut().kernel_mut();

        kstate.set_instruction_pointer(process_hw_enter_kernel as usize);
        kstate.push_stack(arg);
        kstate.push_stack(ptr);
    }
/// Setup the process to start executing an arbitrary kernel function.
///
/// The function will receive exactly one argument, which can be passed
/// here.
///
/// If creating kernel threads to run Rust code, see
/// [process::spawn_kthread].
///
/// # Unsafety
///
/// An arbitrary C function may be executed by scheduling this process after
/// calling this, which may have unsafe behavior.
Setup the process to start executing an arbitrary kernel function.
The function will receive exactly one argument, which can be passed
here.

If creating kernel threads to run Rust code, see
[process::spawn_kthread].
Setup the process to start executing an arbitrary kernel function . The function will receive exactly one argument which can be passed here . If creating kernel threads to run Rust code see [ process :: spawn_kthread ] .
pub unsafe fn load_kernel_fn(
        &mut self,
        ptr: unsafe extern "C" fn (usize) -> i32,
        arg: usize
    ) {
        assert_eq!(self.state, State::Loading);
        // Safety: hwstate exclusive ownership due to Loading state
        //
        // Contract as defined by the unsafety of this function, for
        // set_instruction_pointer and set_argument
        let kstate = self.hw_state_mut().kernel_mut();
        kstate.set_instruction_pointer(process_hw_enter_kernel as usize);
        kstate.push_stack(arg);
        kstate.push_stack(ptr);
    }
pub unsafe fn load_kernel_fn ( & mut self , ptr : unsafe extern " " fn ( usize ) -> i32 , arg : usize ) { assert_eq ! ( self state State Loading ) ; // Safety: hwstate exclusive ownership due to Loading state // // Contract as defined by the unsafety of this function, for // set_instruction_pointer and set_argument let kstate = self . hw_state_mut ( ) . kernel_mut ( ) ; kstate . set_instruction_pointer ( process_hw_enter_kernel as usize ) ; kstate . push_stack ( arg ) ; kstate . push_stack ( ptr ) ; }
Setup the process to start executing an arbitrary kernel function.
Setup the process to start executing an arbitrary kernel function .
&mut self
ptr
unsafe extern "C" fn (usize) -> i32
arg
usize
unsafety
An arbitrary C function may be executed by scheduling this process after
calling this, which may have unsafe behavior.
An arbitrary C function may be executed by scheduling this process after calling this which may have unsafe behavior .