nihpod/ibugger_rt/src/lib.rs

29 lines
598 B
Rust

#![no_std]
use core::panic::PanicInfo;
#[macro_export]
macro_rules! entry {
($path:path) => {
extern "C" {
static _stack: u8;
}
fn _typecheck() -> ! {
let f: fn() -> ! = $path;
f()
}
#[link_section = ".ibugger_header.entrypoint"]
#[no_mangle]
#[naked]
pub unsafe extern "C" fn Entrypoint() -> ! {
asm!(
"ldr sp, ={}",
"b {}",
sym _stack,
sym $path,
options(noreturn)
);
}
}
}