]> git.lizzy.rs Git - rust.git/blob - library/std/src/os/fortanix_sgx/mod.rs
Rollup merge of #103701 - WaffleLapkin:__points-at-implementation__--this-can-be...
[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         pub use crate::sys::abi::usercalls::raw::{Register, RegisterArgument, ReturnValue};
30
31         // fortanix-sgx-abi re-exports
32         pub use crate::sys::abi::usercalls::raw::Error;
33         pub use crate::sys::abi::usercalls::raw::{
34             ByteBuffer, Cancel, FifoDescriptor, Return, Usercall,
35         };
36         pub use crate::sys::abi::usercalls::raw::{Fd, Result, Tcs};
37         pub use crate::sys::abi::usercalls::raw::{
38             EV_RETURNQ_NOT_EMPTY, EV_UNPARK, EV_USERCALLQ_NOT_FULL, FD_STDERR, FD_STDIN, FD_STDOUT,
39             RESULT_SUCCESS, USERCALL_USER_DEFINED, WAIT_INDEFINITE, WAIT_NO,
40         };
41     }
42 }
43
44 /// Functions for querying mapping information for pointers.
45 pub mod mem {
46     pub use crate::sys::abi::mem::*;
47 }
48
49 pub mod arch;
50 pub mod ffi;
51 pub mod io;
52
53 /// Functions for querying thread-related information.
54 pub mod thread {
55     pub use crate::sys::abi::thread::current;
56 }