]> git.lizzy.rs Git - rust.git/blob - library/std/src/os/fortanix_sgx/mod.rs
Rollup merge of #91192 - r00ster91:futuredocs, r=GuillaumeGomez
[rust.git] / library / std / src / 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)]
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::{
25             accept_stream, alloc, async_queues, bind_stream, close, connect_stream, exit, flush,
26             free, insecure_time, launch_thread, read, read_alloc, send, wait, write,
27         };
28         pub use crate::sys::abi::usercalls::raw::{do_usercall, Usercalls as UsercallNrs};
29
30         // fortanix-sgx-abi re-exports
31         pub use crate::sys::abi::usercalls::raw::Error;
32         pub use crate::sys::abi::usercalls::raw::{ByteBuffer, FifoDescriptor, Return, Usercall};
33         pub use crate::sys::abi::usercalls::raw::{Fd, Result, Tcs};
34         pub use crate::sys::abi::usercalls::raw::{
35             EV_RETURNQ_NOT_EMPTY, EV_UNPARK, EV_USERCALLQ_NOT_FULL, FD_STDERR, FD_STDIN, FD_STDOUT,
36             RESULT_SUCCESS, USERCALL_USER_DEFINED, WAIT_INDEFINITE, WAIT_NO,
37         };
38     }
39 }
40
41 /// Functions for querying mapping information for pointers.
42 pub mod mem {
43     pub use crate::sys::abi::mem::*;
44 }
45
46 pub mod arch;
47 pub mod ffi;
48 pub mod io;
49
50 /// Functions for querying thread-related information.
51 pub mod thread {
52     pub use crate::sys::abi::thread::current;
53 }