2018-12-19 17:26:17 +05:30
|
|
|
//! Functionality specific to the `x86_64-fortanix-unknown-sgx` target.
|
|
|
|
//!
|
|
|
|
//! This includes functions to deal with memory isolation, usercalls, and the
|
|
|
|
//! SGX instruction set.
|
|
|
|
|
2021-03-04 15:45:27 +01:00
|
|
|
#![deny(missing_docs)]
|
2018-12-19 17:26:17 +05:30
|
|
|
#![unstable(feature = "sgx_platform", issue = "56975")]
|
|
|
|
|
|
|
|
/// Low-level interfaces to usercalls. See the [ABI documentation] for more
|
|
|
|
/// information.
|
|
|
|
///
|
|
|
|
/// [ABI documentation]: https://docs.rs/fortanix-sgx-abi/
|
|
|
|
pub mod usercalls {
|
2019-02-11 04:23:21 +09:00
|
|
|
pub use crate::sys::abi::usercalls::*;
|
2018-12-19 17:26:17 +05:30
|
|
|
|
|
|
|
/// Primitives for allocating memory in userspace as well as copying data
|
|
|
|
/// to and from user memory.
|
|
|
|
pub mod alloc {
|
2019-02-11 04:23:21 +09:00
|
|
|
pub use crate::sys::abi::usercalls::alloc::*;
|
2018-12-19 17:26:17 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
/// Lowest-level interfaces to usercalls and usercall ABI type definitions.
|
|
|
|
pub mod raw {
|
2019-11-27 10:28:21 -08:00
|
|
|
pub use crate::sys::abi::usercalls::raw::{
|
|
|
|
accept_stream, alloc, async_queues, bind_stream, close, connect_stream, exit, flush,
|
|
|
|
free, insecure_time, launch_thread, read, read_alloc, send, wait, write,
|
|
|
|
};
|
2019-02-11 04:23:21 +09:00
|
|
|
pub use crate::sys::abi::usercalls::raw::{do_usercall, Usercalls as UsercallNrs};
|
2022-08-15 16:02:49 -07:00
|
|
|
pub use crate::sys::abi::usercalls::raw::{Register, RegisterArgument, ReturnValue};
|
2018-12-19 17:26:17 +05:30
|
|
|
|
|
|
|
// fortanix-sgx-abi re-exports
|
2019-02-11 04:23:21 +09:00
|
|
|
pub use crate::sys::abi::usercalls::raw::Error;
|
2019-11-27 10:28:21 -08:00
|
|
|
pub use crate::sys::abi::usercalls::raw::{ByteBuffer, FifoDescriptor, Return, Usercall};
|
2019-02-11 04:23:21 +09:00
|
|
|
pub use crate::sys::abi::usercalls::raw::{Fd, Result, Tcs};
|
2019-11-27 10:28:21 -08:00
|
|
|
pub use crate::sys::abi::usercalls::raw::{
|
|
|
|
EV_RETURNQ_NOT_EMPTY, EV_UNPARK, EV_USERCALLQ_NOT_FULL, FD_STDERR, FD_STDIN, FD_STDOUT,
|
|
|
|
RESULT_SUCCESS, USERCALL_USER_DEFINED, WAIT_INDEFINITE, WAIT_NO,
|
|
|
|
};
|
2018-12-19 17:26:17 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Functions for querying mapping information for pointers.
|
|
|
|
pub mod mem {
|
2019-02-11 04:23:21 +09:00
|
|
|
pub use crate::sys::abi::mem::*;
|
2018-12-19 17:26:17 +05:30
|
|
|
}
|
2018-12-25 13:11:04 +05:30
|
|
|
|
2021-03-04 15:45:27 +01:00
|
|
|
pub mod arch;
|
|
|
|
pub mod ffi;
|
|
|
|
pub mod io;
|
2019-03-05 13:32:41 -08:00
|
|
|
|
|
|
|
/// Functions for querying thread-related information.
|
|
|
|
pub mod thread {
|
|
|
|
pub use crate::sys::abi::thread::current;
|
|
|
|
}
|