ableos/userland/aos_wasm_stress_test/src/main.rs

37 lines
621 B
Rust
Raw Normal View History

2022-01-13 08:54:33 -06:00
#![no_std]
#![no_main]
#[no_mangle]
fn start() -> i32 {
let ret = unsafe { add(1, 2) };
2022-02-26 07:35:36 -06:00
unsafe {
send_signal(PID(1), Signals::Quit);
}
ret as i32
}
2022-01-13 08:54:33 -06:00
2022-02-26 07:35:36 -06:00
extern "C" {
/// Send a signal to a process
///
/// # Arguments
///
/// * `pid` - The PID of the process to send the signal to
/// * `signal` - The signal to send
pub fn send_signal(pid: PID, signal: Signals) -> bool;
}
use {
libwasm::process::{signals::Signals, PID},
libwasm::syscalls::add,
};
use libwasm::*;
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
loop {}
}
use core::panic::PanicInfo;