add in aos_stress_test

This commit is contained in:
Able 2022-04-09 16:50:07 -05:00
parent 0ffd50df94
commit 31207b2550
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;