This commit is contained in:
vandechat96
2023-03-31 15:38:14 +02:00
parent 14a2f3cd96
commit f97a3a5556
3 changed files with 20 additions and 3 deletions

3
Cargo.lock generated
View File

@@ -40,8 +40,7 @@ dependencies = [
[[package]]
name = "redox_syscall"
version = "0.3.2"
source = "git+https://gitlab.redox-os.org/redox-os/syscall.git#7eb24a17cef4e8f4617d20925a86a31dd1b777ea"
version = "0.3.5"
dependencies = [
"bitflags",
]

View File

@@ -6,7 +6,7 @@ edition = "2018"
[dependencies]
libc = "0.2"
redox_syscall = { git = "https://gitlab.redox-os.org/redox-os/syscall.git" }
redox_syscall = { path = "../../kernel/source/syscall" }
#strace = { git = "https://gitlab.redox-os.org/redox-os/strace-redox", default-features = false }
#strace = { path = "../../strace/source", default-features = false }

View File

@@ -1,6 +1,8 @@
//!Acid testing program
#![feature(array_chunks, core_intrinsics, thread_local)]
use syscall::TimeSpec;
const PAGE_SIZE: usize = 4096;
fn e<T, E: ToString>(error: Result<T, E>) -> Result<T, String> {
@@ -234,6 +236,21 @@ fn tls_test() -> Result<(), String> {
Ok(())
}
fn nmi_test() -> Result<(), String> {
let a = TimeSpec{
tv_nsec:0,
tv_sec:10,
};
let mut b = TimeSpec::default();
let r = syscall::call::nanosleep(&a,&mut b);
println!("{r:?}");
let r = syscall::call::nmi();
println!("{r:?}");
Ok(())
}
fn main() {
use std::collections::BTreeMap;
use std::{env, process};
@@ -247,6 +264,7 @@ fn main() {
tests.insert("tcp_fin", tcp_fin_test);
tests.insert("thread", thread_test);
tests.insert("tls", tls_test);
tests.insert("nmi", nmi_test);
let mut ran_test = false;
for arg in env::args().skip(1) {