]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/sys/sgx/mod.rs
SGX target: simplify usercall internals
[rust.git] / src / libstd / sys / sgx / mod.rs
index f38c69e90c7c46f73c92828aa40f46f9aac86978..4225ecbb206510d49f55c84a5dc1c876ccf0a928 100644 (file)
@@ -1,13 +1,3 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
 //! System bindings for the Fortanix SGX platform
 //!
 //! This module contains the facade (aka platform-specific) implementations of
@@ -18,6 +8,7 @@
 use sync::atomic::{AtomicBool, Ordering};
 
 pub mod abi;
+mod waitqueue;
 
 pub mod alloc;
 pub mod args;
@@ -26,6 +17,8 @@
 pub mod cmath;
 pub mod condvar;
 pub mod env;
+pub mod ext;
+pub mod fd;
 pub mod fs;
 pub mod memchr;
 pub mod mutex;
@@ -132,7 +125,7 @@ pub unsafe fn strlen(mut s: *const c_char) -> usize {
 }
 
 pub unsafe fn abort_internal() -> ! {
-    abi::panic::panic_exit()
+    abi::usercalls::exit(true)
 }
 
 pub fn hashmap_random_keys() -> (u64, u64) {
@@ -149,3 +142,9 @@ fn rdrand64() -> u64 {
     }
     (rdrand64(), rdrand64())
 }
+
+pub use sys_common::{AsInner, FromInner, IntoInner};
+
+pub trait TryIntoInner<Inner>: Sized {
+    fn try_into_inner(self) -> Result<Inner, Self>;
+}