diff options
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/sys/sgx/abi/entry.S | 10 | ||||
| -rw-r--r-- | src/libstd/sys/sgx/time.rs | 8 | ||||
| -rw-r--r-- | src/libstd/sys/sgx/waitqueue.rs | 1 |
3 files changed, 19 insertions, 0 deletions
diff --git a/src/libstd/sys/sgx/abi/entry.S b/src/libstd/sys/sgx/abi/entry.S index 8dad6ee976f..ac7f95d4eae 100644 --- a/src/libstd/sys/sgx/abi/entry.S +++ b/src/libstd/sys/sgx/abi/entry.S @@ -4,6 +4,16 @@ .global IMAGE_BASE IMAGE_BASE: +.section ".note.x86_64-fortanix-unknown-sgx", "", @note + .align 4 + .long 1f - 0f /* name length (not including padding) */ + .long 3f - 2f /* desc length (not including padding) */ + .long 1 /* type = NT_VERSION */ +0: .asciz "toolchain-version" /* name */ +1: .align 4 +2: .long 0 /* desc - toolchain version number, 32-bit LE */ +3: .align 4 + .section .rodata /* The XSAVE area needs to be a large chunk of readable memory, but since we are */ /* going to restore everything to its initial state (XSTATE_BV=0), only certain */ diff --git a/src/libstd/sys/sgx/time.rs b/src/libstd/sys/sgx/time.rs index 10fe72d5f68..407fe72b0e6 100644 --- a/src/libstd/sys/sgx/time.rs +++ b/src/libstd/sys/sgx/time.rs @@ -25,6 +25,14 @@ impl Instant { pub fn checked_sub_duration(&self, other: &Duration) -> Option<Instant> { Some(Instant(self.0.checked_sub(*other)?)) } + + pub fn actually_monotonic() -> bool { + false + } + + pub const fn zero() -> Instant { + Instant(Duration::from_secs(0)) + } } impl SystemTime { diff --git a/src/libstd/sys/sgx/waitqueue.rs b/src/libstd/sys/sgx/waitqueue.rs index a4738208778..51c00a1433e 100644 --- a/src/libstd/sys/sgx/waitqueue.rs +++ b/src/libstd/sys/sgx/waitqueue.rs @@ -456,6 +456,7 @@ mod spin_mutex { } } + /// Lock the Mutex or return false. pub macro try_lock_or_false { ($e:expr) => { if let Some(v) = $e.try_lock() { |
