refactor: 📦 Rearrange kernel_main

This commit is contained in:
Berkus Decker 2023-07-11 02:29:40 +03:00 committed by Berkus Decker
parent d78bc67d8f
commit 45e18de842
1 changed files with 22 additions and 22 deletions

View File

@ -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
//------------------------------------------------------------