Skip to main content

jar_test_halt/
main.rs

1//! Halt smoke fixture for the JAR minimum kernel.
2//!
3//! Issues `ecalli 0` (CALL the IPC slot = REPLY) immediately. At root level
4//! this halts the VM with `KernelResult::Halt(φ[7])`.
5
6#![cfg_attr(target_env = "javm", no_std)]
7#![cfg_attr(target_env = "javm", no_main)]
8
9#[cfg(target_env = "javm")]
10mod service {
11    use core::arch::global_asm;
12
13    global_asm!(
14        ".global _start",
15        ".type _start, @function",
16        "_start:",
17        "li t0, 0",
18        "ecall",
19        "unimp",
20    );
21
22    #[panic_handler]
23    fn panic(_: &core::panic::PanicInfo) -> ! {
24        loop {}
25    }
26}
27
28#[cfg(not(target_env = "javm"))]
29fn main() {}