diff --git a/bin/chainboot/src/boot.rs b/bin/chainboot/src/boot.rs index 63a0069..854f44b 100644 --- a/bin/chainboot/src/boot.rs +++ b/bin/chainboot/src/boot.rs @@ -62,6 +62,7 @@ pub unsafe extern "C" fn _start() -> ! { /// /// The function is called from the assembly `_start` function, keep it to support "asm" feature. #[no_mangle] +#[inline(always)] pub unsafe fn _start_rust(max_kernel_size: u64) -> ! { crate::kernel_init(max_kernel_size) } diff --git a/bin/chainboot/src/main.rs b/bin/chainboot/src/main.rs index 641800c..5a2b3cd 100644 --- a/bin/chainboot/src/main.rs +++ b/bin/chainboot/src/main.rs @@ -25,6 +25,7 @@ mod boot; /// /// - Only a single core must be active and running this function. /// - The init calls in this function must appear in the correct order. +#[inline(always)] unsafe fn kernel_init(max_kernel_size: u64) -> ! { #[cfg(feature = "jtag")] machine::arch::jtag::wait_debugger(); @@ -66,6 +67,7 @@ fn read_u64() -> u64 { } /// The main function running after the early init. +#[inline(always)] fn kernel_main(max_kernel_size: u64) -> ! { #[cfg(test)] test_main(); diff --git a/machine/src/arch/aarch64/boot.rs b/machine/src/arch/aarch64/boot.rs index e4adba4..e089101 100644 --- a/machine/src/arch/aarch64/boot.rs +++ b/machine/src/arch/aarch64/boot.rs @@ -24,6 +24,7 @@ macro_rules! entry { /// # Safety /// Only type-checks! #[export_name = "main"] + #[inline(always)] pub unsafe fn __main() -> ! { // type check the given path let f: fn() -> ! = $path;