upgrade the sigcheck boot routine to pass kernel arguments

all other boot modes would get an a0 with the address that the
kernel is "supposed" to be located. this is neither security
sensitive or problematic.
This commit is contained in:
bunnie 2025-10-01 23:36:14 +08:00
parent ec9aed29dd
commit 07e7197517

View file

@ -127,10 +127,16 @@ fn erase_secrets() {
}
pub fn jump_to(target: usize) -> ! {
// loader expects a0 to have the address of the kernel image pre-loaded
let kernel_loc = bao1x_api::offsets::KERNEL_START;
unsafe {
core::arch::asm!(
"jr {0}",
in(reg) target,
"mv t0, {target}",
"mv a0, {kernel_loc}",
"mv a1, x0",
"jr t0",
target = in(reg) target,
kernel_loc = in(reg) kernel_loc,
options(noreturn)
);
}