diff --git a/rust/src/bin/float.rs b/rust/src/bin/float.rs new file mode 100644 index 0000000..578ba8e --- /dev/null +++ b/rust/src/bin/float.rs @@ -0,0 +1,29 @@ +#![no_std] +#![no_main] +#![feature(asm)] + +#[macro_use] +extern crate rcore_user; + +use rcore_user::syscall::*; + + +// IMPORTANT: Must define main() like this +#[no_mangle] +pub fn main() { + println!("Going to test floating point arithmetics"); + println!("And see if it works with context switch"); + sys_vfork(); + sys_vfork(); + let pid = sys_getpid(); + for i in 0..10 { + let a = pid as f32; + let b = 1.0_f32; + let c_1 = a + b; + sys_sleep(1); + let c_2 = (pid + 1) as f32; + if c_1 - c_2 < 1e-4 && c_1 - c_2 > -1e-4 { + println!("pid {} time {}: working", pid, i); + } + } +} diff --git a/rust/src/bin/iperf.rs b/rust/src/bin/iperf.rs index f210885..75ff989 100644 --- a/rust/src/bin/iperf.rs +++ b/rust/src/bin/iperf.rs @@ -244,9 +244,6 @@ pub fn main() { } } } - if !socket.is_open() { - - } } { diff --git a/rust/targets/x86_64-rcore.json b/rust/targets/x86_64-rcore.json index 6510efa..3ba7450 100644 --- a/rust/targets/x86_64-rcore.json +++ b/rust/targets/x86_64-rcore.json @@ -11,5 +11,5 @@ "linker-flavor": "ld.lld", "panic-strategy": "abort", "disable-redzone": true, - "features": "-mmx,-sse,+soft-float" + "features": "" }