refactor: 📦 Rearrange kernel_main
This commit is contained in:
parent
d78bc67d8f
commit
45e18de842
|
@ -40,6 +40,28 @@ use {
|
|||
|
||||
entry!(kernel_main);
|
||||
|
||||
/// Kernel entry point.
|
||||
/// `arch` crate is responsible for calling it.
|
||||
// #[inline]
|
||||
pub fn kernel_main() -> ! {
|
||||
#[cfg(feature = "jtag")]
|
||||
machine::arch::jtag::wait_debugger();
|
||||
|
||||
init_exception_traps();
|
||||
|
||||
#[cfg(not(feature = "noserial"))]
|
||||
init_uart_serial();
|
||||
|
||||
init_mmu();
|
||||
|
||||
#[cfg(test)]
|
||||
test_main();
|
||||
|
||||
command_prompt();
|
||||
|
||||
reboot()
|
||||
}
|
||||
|
||||
#[cfg(not(test))]
|
||||
#[panic_handler]
|
||||
fn panicked(info: &PanicInfo) -> ! {
|
||||
|
@ -117,28 +139,6 @@ fn init_uart_serial() {
|
|||
}
|
||||
}
|
||||
|
||||
/// Kernel entry point.
|
||||
/// `arch` crate is responsible for calling it.
|
||||
// #[inline]
|
||||
pub fn kernel_main() -> ! {
|
||||
#[cfg(feature = "jtag")]
|
||||
machine::arch::jtag::wait_debugger();
|
||||
|
||||
init_exception_traps();
|
||||
|
||||
#[cfg(not(feature = "noserial"))]
|
||||
init_uart_serial();
|
||||
|
||||
init_mmu();
|
||||
|
||||
#[cfg(test)]
|
||||
test_main();
|
||||
|
||||
command_prompt();
|
||||
|
||||
reboot()
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
// Start a command prompt
|
||||
//------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue