Fix build on aarch64

This commit is contained in:
Jeremy Soller
2022-08-28 10:09:45 -06:00
parent ccf01b6f39
commit d9959bb3f5
2 changed files with 8 additions and 5 deletions

View File

@@ -7,6 +7,8 @@ edition = "2018"
[dependencies] [dependencies]
libc = "0.2" libc = "0.2"
redox_syscall = { git = "https://gitlab.redox-os.org/redox-os/syscall.git" } redox_syscall = { git = "https://gitlab.redox-os.org/redox-os/syscall.git" }
strace = { git = "https://gitlab.redox-os.org/redox-os/strace-redox", default-features = false } #strace = { git = "https://gitlab.redox-os.org/redox-os/strace-redox", default-features = false }
x86 = "0.47.0"
#strace = { path = "../../strace/source", default-features = false } #strace = { path = "../../strace/source", default-features = false }
[target.'cfg(target_arch = "x86_64")'.dependencies]
x86 = "0.47.0"

View File

@@ -3,6 +3,8 @@
mod clone_grant_using_fmap; mod clone_grant_using_fmap;
const PAGE_SIZE: usize = 4096;
fn e<T, E: ToString>(error: Result<T, E>) -> Result<T, String> { fn e<T, E: ToString>(error: Result<T, E>) -> Result<T, String> {
error.map_err(|e| e.to_string()) error.map_err(|e| e.to_string())
} }
@@ -45,9 +47,6 @@ fn create_test() -> Result<(), String> {
Ok(()) Ok(())
} }
#[cfg(target_arch = "x86_64")]
const PAGE_SIZE: usize = 4096;
fn page_fault_test() -> Result<(), String> { fn page_fault_test() -> Result<(), String> {
use std::sync::atomic::{AtomicUsize, compiler_fence, Ordering}; use std::sync::atomic::{AtomicUsize, compiler_fence, Ordering};
@@ -114,6 +113,7 @@ fn page_fault_test() -> Result<(), String> {
Ok(()) Ok(())
} }
#[cfg(target_arch = "x86_64")]
fn switch_test() -> Result<(), String> { fn switch_test() -> Result<(), String> {
use std::thread; use std::thread;
use x86::time::rdtscp; use x86::time::rdtscp;
@@ -246,6 +246,7 @@ fn main() {
let mut tests: BTreeMap<&'static str, fn() -> Result<(), String>> = BTreeMap::new(); let mut tests: BTreeMap<&'static str, fn() -> Result<(), String>> = BTreeMap::new();
tests.insert("create_test", create_test); tests.insert("create_test", create_test);
tests.insert("page_fault", page_fault_test); tests.insert("page_fault", page_fault_test);
#[cfg(target_arch = "x86_64")]
tests.insert("switch", switch_test); tests.insert("switch", switch_test);
tests.insert("tcp_fin", tcp_fin_test); tests.insert("tcp_fin", tcp_fin_test);
tests.insert("thread", thread_test); tests.insert("thread", thread_test);