axcpu 0.3.1

Privileged instruction and structure abstractions for various CPU architectures
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Helper functions to initialize the CPU states on systems bootstrapping.

/// Initializes trap handling on the current CPU.
///
/// In detail, it initializes the trap vector on RISC-V platforms.
pub fn init_trap() {
    unsafe extern "C" {
        fn trap_vector_base();
    }
    unsafe {
        crate::asm::write_trap_vector_base(trap_vector_base as *const () as usize);
    }
}