This commit is contained in:
Able 2022-04-09 23:27:16 -05:00
parent 00e0ee6a2e
commit f02eb25ca3
2 changed files with 7 additions and 3 deletions

View file

@ -1,17 +1,21 @@
#![no_std] #![no_std]
#![no_main] #![no_main]
use libwasm::driver::DriverExitCode; use libwasm::{driver::DriverExitCode, get_input};
#[no_mangle] #[no_mangle]
fn start() -> i32 { fn start() -> i32 {
let rand; let rand;
let ret;
unsafe { unsafe {
send_signal(PID(1), Signals::Quit); send_signal(PID(1), Signals::Quit);
rand = get_random(); rand = get_random();
ret = get_input();
} }
rand as i32 // rand as i32
ret as i32
} }
#[no_mangle] #[no_mangle]

View file

@ -9,7 +9,7 @@ pub mod syscalls;
pub use core::*; pub use core::*;
extern "C" { extern "C" {
pub fn get_random() -> u32; pub fn get_random() -> u32;
pub fn get_input() -> u32;
} }