about summary refs log tree commit diff
path: root/src/libstd/os
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-12-27 09:21:06 +0000
committerbors <bors@rust-lang.org>2018-12-27 09:21:06 +0000
commitd2986970adae36939d13c79e3af34ff6378fad68 (patch)
treeacdd7dc8ea3930b5a07c0b9ec6f3e6569037a1df /src/libstd/os
parent39bc8f5899d1106a785a62a1fcc103e999edf046 (diff)
parentbe565615dbed87a0d3fcdb7f62b2080b3dc288fa (diff)
downloadrust-d2986970adae36939d13c79e3af34ff6378fad68.tar.gz
rust-d2986970adae36939d13c79e3af34ff6378fad68.zip
Auto merge of #57119 - jethrogb:jb/sgx-os-mod2, r=joshtriplett
Add `io` and `arch` modules to `std::os::fortanix_sgx`

This PR adds two more (unstable) modules to `std::os::fortanix_sgx` for the `x86_64-fortanix-unknown-sgx` target.

### io
`io` allows conversion between raw file descriptors and Rust types, similar to `std::os::unix::io`.

### arch
`arch` exposes the `ENCLU[EREPORT]` and `ENCLU[EGETKEY]` instructions. The current functions are very likely not going to be the final form of these functions (see also https://github.com/fortanix/rust-sgx/issues/15), but this should be sufficient to enable experimentation in libraries. I tried using the actual types (from the [`sgx-isa` crate](https://crates.io/crates/sgx-isa)) instead of byte arrays, but that would make `std` dependent on the `bitflags` crate which I didn't want to do at this time.
Diffstat (limited to 'src/libstd/os')
-rw-r--r--src/libstd/os/fortanix_sgx/mod.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libstd/os/fortanix_sgx/mod.rs b/src/libstd/os/fortanix_sgx/mod.rs
index 84e8df14392..47c7b5dcbe6 100644
--- a/src/libstd/os/fortanix_sgx/mod.rs
+++ b/src/libstd/os/fortanix_sgx/mod.rs
@@ -55,3 +55,5 @@ pub mod usercalls {
 pub mod mem {
     pub use sys::abi::mem::*;
 }
+
+pub use sys::ext::{io, arch};