Skip to main content

std/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/
13pub 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            ByteBuffer, Cancel, EV_RETURNQ_NOT_EMPTY, EV_UNPARK, EV_USERCALLQ_NOT_FULL, Error,
26            FD_STDERR, FD_STDIN, FD_STDOUT, Fd, FifoDescriptor, RESULT_SUCCESS, Register,
27            RegisterArgument, Result, Return, ReturnValue, Tcs, USERCALL_USER_DEFINED, Usercall,
28            Usercalls as UsercallNrs, WAIT_INDEFINITE, WAIT_NO, accept_stream, alloc, async_queues,
29            bind_stream, close, connect_stream, do_usercall, exit, flush, free, insecure_time,
30            launch_thread, read, read_alloc, send, wait, write,
31        };
32    }
33}
34
35/// Functions for querying mapping information for pointers.
36pub mod mem {
37    pub use crate::sys::abi::mem::*;
38}
39
40pub mod arch;
41pub mod ffi;
42pub mod io;
43
44/// Functions for querying thread-related information.
45pub mod thread {
46    pub use crate::sys::abi::thread::current;
47}