]> git.lizzy.rs Git - rust.git/blob - src/libstd/os/fortanix_sgx/mod.rs
SGX target: Expose thread id function in os module
[rust.git] / src / libstd / os / fortanix_sgx / mod.rs
1 //! Functionality specific to the `x86_64-fortanix-unknown-sgx` target.
2 //!
3 //! This includes functions to deal with memory isolation, usercalls, and the
4 //! SGX instruction set.
5
6 #![deny(missing_docs, missing_debug_implementations)]
7 #![unstable(feature = "sgx_platform", issue = "56975")]
8
9 /// Low-level interfaces to usercalls. See the [ABI documentation] for more
10 /// information.
11 ///
12 /// [ABI documentation]: https://docs.rs/fortanix-sgx-abi/
13 pub mod usercalls {
14     pub use crate::sys::abi::usercalls::*;
15
16     /// Primitives for allocating memory in userspace as well as copying data
17     /// to and from user memory.
18     pub mod alloc {
19         pub use crate::sys::abi::usercalls::alloc::*;
20     }
21
22     /// Lowest-level interfaces to usercalls and usercall ABI type definitions.
23     pub mod raw {
24         pub use crate::sys::abi::usercalls::raw::{do_usercall, Usercalls as UsercallNrs};
25         pub use crate::sys::abi::usercalls::raw::{accept_stream, alloc, async_queues, bind_stream,
26                                            close, connect_stream, exit, flush, free, insecure_time,
27                                            launch_thread, read, read_alloc, send, wait, write};
28
29         // fortanix-sgx-abi re-exports
30         pub use crate::sys::abi::usercalls::raw::{ByteBuffer, FifoDescriptor, Return, Usercall};
31         pub use crate::sys::abi::usercalls::raw::Error;
32         pub use crate::sys::abi::usercalls::raw::{EV_RETURNQ_NOT_EMPTY, EV_UNPARK,
33                                            EV_USERCALLQ_NOT_FULL, FD_STDERR, FD_STDIN, FD_STDOUT,
34                                            RESULT_SUCCESS, USERCALL_USER_DEFINED, WAIT_INDEFINITE,
35                                            WAIT_NO};
36         pub use crate::sys::abi::usercalls::raw::{Fd, Result, Tcs};
37     }
38 }
39
40 /// Functions for querying mapping information for pointers.
41 pub mod mem {
42     pub use crate::sys::abi::mem::*;
43 }
44
45 pub use crate::sys::ext::{io, arch, ffi};
46
47 /// Functions for querying thread-related information.
48 pub mod thread {
49     pub use crate::sys::abi::thread::current;
50 }