diff options
Diffstat (limited to 'library/std/src/sys')
| -rw-r--r-- | library/std/src/sys/thread_local/key/trusty.rs | 30 | ||||
| -rw-r--r-- | library/std/src/sys/thread_local/mod.rs | 11 |
2 files changed, 2 insertions, 39 deletions
diff --git a/library/std/src/sys/thread_local/key/trusty.rs b/library/std/src/sys/thread_local/key/trusty.rs deleted file mode 100644 index 894091d2d81..00000000000 --- a/library/std/src/sys/thread_local/key/trusty.rs +++ /dev/null @@ -1,30 +0,0 @@ -use crate::ptr; - -pub type Key = usize; -type Dtor = unsafe extern "C" fn(*mut u8); - -static mut STORAGE: crate::vec::Vec<(*mut u8, Option<Dtor>)> = Vec::new(); - -#[inline] -pub fn create(dtor: Option<Dtor>) -> Key { - unsafe { - #[allow(static_mut_refs)] - let key = STORAGE.len(); - #[allow(static_mut_refs)] - STORAGE.push((ptr::null_mut(), dtor)); - key - } -} - -#[inline] -pub unsafe fn set(key: Key, value: *mut u8) { - unsafe { STORAGE[key].0 = value }; -} - -#[inline] -pub unsafe fn get(key: Key) -> *mut u8 { - unsafe { STORAGE[key].0 } -} - -#[inline] -pub fn destroy(_key: Key) {} diff --git a/library/std/src/sys/thread_local/mod.rs b/library/std/src/sys/thread_local/mod.rs index 827f464e860..1ff13154b7b 100644 --- a/library/std/src/sys/thread_local/mod.rs +++ b/library/std/src/sys/thread_local/mod.rs @@ -28,6 +28,7 @@ cfg_if::cfg_if! { all(target_family = "wasm", not(target_feature = "atomics")), target_os = "uefi", target_os = "zkvm", + target_os = "trusty", ))] { mod statik; pub use statik::{EagerStorage, LazyStorage, thread_local_inner}; @@ -91,6 +92,7 @@ pub(crate) mod guard { )), target_os = "uefi", target_os = "zkvm", + target_os = "trusty", ))] { pub(crate) fn enable() { // FIXME: Right now there is no concept of "thread exit" on @@ -170,15 +172,6 @@ pub(crate) mod key { pub(crate) use xous::destroy_tls; pub(super) use xous::{Key, get, set}; use xous::{create, destroy}; - } else if #[cfg(target_os = "trusty")] { - #[allow(unused_unsafe)] - mod racy; - #[cfg(test)] - mod tests; - mod trusty; - pub(super) use racy::LazyKey; - pub(super) use trusty::{Key, get, set}; - use trusty::{create, destroy}; } } } |
