//! Minimal ABI for native EL0 feature programs: `svc #0` with the call number //! in x8, arguments in x0..x2 and the result in x0. The kernel restores every //! other general-purpose and SIMD register. #![no_std] pub const EXIT: u64 = 1; #[inline(always)] pub fn call(number: u64, a: u64, b: u64, c: u64) -> u64 { let result; unsafe { core::arch::asm!("svc #0", inlateout("x0") a => result, in("x1") b, in("x2") c, in("x8") number, options(nostack)) }; result } pub fn exit(code: u64) -> ! { loop { call(EXIT, code, 0, 0); } } #[panic_handler] fn panic(_: &core::panic::PanicInfo) -> ! { exit(0xff) }