std: move time implementations to sys (small platforms)
Let's start with the easy ones: * Motor just reexports its platform library * The SGX code is just a trivial move * Trusty, WASM and ZKVM are unsupported, this is very trivial. And we can get rid of some `#[path = ...]`s, yay!
This commit is contained in:
parent
814d902c50
commit
29b16c0a55
12 changed files with 16 additions and 12 deletions
|
|
@ -1,7 +1,6 @@
|
|||
#![allow(unsafe_op_in_unsafe_fn)]
|
||||
|
||||
pub mod os;
|
||||
pub mod time;
|
||||
|
||||
pub use moto_rt::futex;
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +0,0 @@
|
|||
pub use moto_rt::time::{Instant, SystemTime, UNIX_EPOCH};
|
||||
|
|
@ -12,7 +12,6 @@ pub mod abi;
|
|||
mod libunwind_integration;
|
||||
pub mod os;
|
||||
pub mod thread_parking;
|
||||
pub mod time;
|
||||
pub mod waitqueue;
|
||||
|
||||
// SAFETY: must be called only once during runtime initialization.
|
||||
|
|
|
|||
|
|
@ -5,7 +5,5 @@
|
|||
mod common;
|
||||
#[path = "../unsupported/os.rs"]
|
||||
pub mod os;
|
||||
#[path = "../unsupported/time.rs"]
|
||||
pub mod time;
|
||||
|
||||
pub use common::*;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
#![deny(unsafe_op_in_unsafe_fn)]
|
||||
|
||||
pub mod os;
|
||||
pub mod time;
|
||||
|
||||
mod common;
|
||||
pub use common::*;
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@
|
|||
|
||||
#[path = "../unsupported/os.rs"]
|
||||
pub mod os;
|
||||
#[path = "../unsupported/time.rs"]
|
||||
pub mod time;
|
||||
|
||||
#[cfg(target_feature = "atomics")]
|
||||
#[path = "atomics/futex.rs"]
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
#![forbid(unsafe_op_in_unsafe_fn)]
|
||||
|
||||
pub mod os;
|
||||
pub mod time;
|
||||
|
||||
#[path = "../unsupported/common.rs"]
|
||||
mod common;
|
||||
|
|
|
|||
|
|
@ -12,8 +12,6 @@ pub const WORD_SIZE: usize = size_of::<u32>();
|
|||
|
||||
pub mod abi;
|
||||
pub mod os;
|
||||
#[path = "../unsupported/time.rs"]
|
||||
pub mod time;
|
||||
|
||||
use crate::io as std_io;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,19 @@
|
|||
cfg_select! {
|
||||
target_os = "motor" => {
|
||||
use moto_rt::time as imp;
|
||||
}
|
||||
all(target_vendor = "fortanix", target_env = "sgx") => {
|
||||
mod sgx;
|
||||
use sgx as imp;
|
||||
}
|
||||
target_os = "xous" => {
|
||||
mod xous;
|
||||
use xous as imp;
|
||||
}
|
||||
_ => {
|
||||
mod unsupported;
|
||||
use unsupported as imp;
|
||||
}
|
||||
}
|
||||
|
||||
pub use imp::{Instant, SystemTime, UNIX_EPOCH};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use super::abi::usercalls;
|
||||
use crate::sys::pal::abi::usercalls;
|
||||
use crate::time::Duration;
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)]
|
||||
Loading…
Add table
Add a link
Reference in a new issue