add in aos_stress_test

pull/1/head
Able 2022-04-09 16:50:07 -05:00
parent d2102f35fe
commit 5f731a0a60
Signed by: able
GPG Key ID: D164AF5F5700BE51
8 changed files with 63 additions and 1 deletions

3
.gitignore vendored
View File

@ -1,2 +1,3 @@
/*/target
*/target
target
Cargo.lock

View File

@ -2,4 +2,5 @@
members = [
"libwasm",
"aos_wasm_stress_test",
]

View File

@ -0,0 +1,6 @@
[build]
target = "wasm32-unknown-unknown"
# [unstable]
# build-std = ["core", "compiler_builtins", "alloc"]
# build-std-features = ["compiler-builtins-mem"]

View File

@ -0,0 +1,10 @@
[package]
name = "aos_wasm_stress_test"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
libwasm = {path="../libwasm"}
# mice = "0.11.0"

3
aos_wasm_stress_test/build.sh Executable file
View File

@ -0,0 +1,3 @@
cargo build --release
wasm-strip target/wasm32-unknown-unknown/release/aos_wasm_stress_test.wasm
mv target/wasm32-unknown-unknown/release/aos_wasm_stress_test.wasm aos_wasm_stress_test.wasm

View File

@ -0,0 +1,4 @@
This is a stress test and simple program for ableOS.

View File

@ -0,0 +1,31 @@
#![no_std]
#![no_main]
use libwasm::driver::DriverExitCode;
#[no_mangle]
fn start() -> i32 {
let rand;
unsafe {
send_signal(PID(1), Signals::Quit);
rand = get_random();
}
rand as i32
}
#[no_mangle]
fn driver_entry() {}
#[no_mangle]
fn driver_exit() -> DriverExitCode {
DriverExitCode::Success
}
use {
libwasm::get_random,
libwasm::process::{signals::Signals, PID},
libwasm::syscalls::send_signal,
};
mod panic;

View File

@ -0,0 +1,6 @@
#[panic_handler]
fn panic(_info: &PanicInfo) -> ! {
loop {}
}
use core::panic::PanicInfo;