mirror of
https://github.com/saymrwulf/xous-core.git
synced 2026-11-20 09:03:28 +00:00
xous-rs: use target_os and target_arch cfgs
Look at `target_os` to determine whether to enter "hosted" mode or not. If `target_os` is "xous", then the Xous standard library should default to using builtin Rust libstd features. If it is "xous", then we should instead use our arch-specific implementations. This enables third-party programs to directly use the `xous` crate without specifying feature flags. Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
parent
fd42770ee0
commit
6066619906
2 changed files with 6 additions and 14 deletions
|
|
@ -1,20 +1,16 @@
|
||||||
#[cfg(any(feature="precursor", feature="renode"))]
|
#[cfg(all(target_os = "xous", target_arch = "riscv32"))]
|
||||||
pub mod riscv;
|
pub mod riscv;
|
||||||
#[cfg(any(feature="precursor", feature="renode"))]
|
#[cfg(all(target_os = "xous", target_arch = "riscv32"))]
|
||||||
pub use riscv::*;
|
pub use riscv::*;
|
||||||
|
|
||||||
#[cfg(all(
|
#[cfg(all(
|
||||||
not(feature="processes-as-threads"),
|
not(feature="processes-as-threads"),
|
||||||
any(feature="hosted",
|
not(target_os = "xous")
|
||||||
not(any(feature="precursor", feature="renode"))
|
|
||||||
)
|
|
||||||
))]
|
))]
|
||||||
pub mod hosted;
|
pub mod hosted;
|
||||||
#[cfg(all(
|
#[cfg(all(
|
||||||
not(feature="processes-as-threads"),
|
not(feature="processes-as-threads"),
|
||||||
any(feature="hosted",
|
not(target_os = "xous")
|
||||||
not(any(feature="precursor", feature="renode"))
|
|
||||||
)
|
|
||||||
))]
|
))]
|
||||||
pub use hosted::*;
|
pub use hosted::*;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -55,9 +55,7 @@ pub const BASE_QUANTA_MS: u32 = 10;
|
||||||
pub const BOOKEND_START: &'static str = "_|TT|_";
|
pub const BOOKEND_START: &'static str = "_|TT|_";
|
||||||
pub const BOOKEND_END: &'static str = "_|TE|_";
|
pub const BOOKEND_END: &'static str = "_|TE|_";
|
||||||
|
|
||||||
#[cfg(any(feature="hosted",
|
#[cfg(not(target_os = "xous"))]
|
||||||
not(any(feature="precursor", feature="renode"))
|
|
||||||
))]
|
|
||||||
use core::sync::atomic::AtomicU64;
|
use core::sync::atomic::AtomicU64;
|
||||||
|
|
||||||
// Secretly, you can change this by setting the XOUS_SEED environment variable.
|
// Secretly, you can change this by setting the XOUS_SEED environment variable.
|
||||||
|
|
@ -66,9 +64,7 @@ use core::sync::atomic::AtomicU64;
|
||||||
// The code that reads the varable this is all the way over in xous-rs\src\arch\hosted\mod.rs#29, and
|
// The code that reads the varable this is all the way over in xous-rs\src\arch\hosted\mod.rs#29, and
|
||||||
// it's glommed onto some other static process initialization code because I don't fully understand
|
// it's glommed onto some other static process initialization code because I don't fully understand
|
||||||
// what's going on over there.
|
// what's going on over there.
|
||||||
#[cfg(any(feature="hosted",
|
#[cfg(not(target_os = "xous"))]
|
||||||
not(any(feature="precursor", feature="renode"))
|
|
||||||
))]
|
|
||||||
pub static TESTING_RNG_SEED: AtomicU64 = AtomicU64::new(0);
|
pub static TESTING_RNG_SEED: AtomicU64 = AtomicU64::new(0);
|
||||||
|
|
||||||
pub mod exceptions;
|
pub mod exceptions;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue