diff options
| author | Yuki Okushi <jtitor@2k36.org> | 2021-06-22 07:37:42 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-22 07:37:42 +0900 |
| commit | d6e344d45d751c449fa59542a2aa1dc1f2c6a6e6 (patch) | |
| tree | 82c7ab0c0d9600804c5c1569d98ea6a5f0d02811 | |
| parent | 406d4a9cc3b9601cf98a07c6c83e0227d64f5d48 (diff) | |
| parent | 5bbf8cf331f9c6140117bb6c2ac385d2e451d26e (diff) | |
| download | rust-d6e344d45d751c449fa59542a2aa1dc1f2c6a6e6.tar.gz rust-d6e344d45d751c449fa59542a2aa1dc1f2c6a6e6.zip | |
Rollup merge of #85054 - jethrogb:jb/sgx-inline-asm, r=Amanieu
Revert SGX inline asm syntax This was erroneously changed in #83387
| -rw-r--r-- | library/std/src/os/fortanix_sgx/arch.rs | 12 | ||||
| -rw-r--r-- | library/std/src/sys/sgx/abi/mem.rs | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/library/std/src/os/fortanix_sgx/arch.rs b/library/std/src/os/fortanix_sgx/arch.rs index b0170e67446..4ce482e23cb 100644 --- a/library/std/src/os/fortanix_sgx/arch.rs +++ b/library/std/src/os/fortanix_sgx/arch.rs @@ -33,13 +33,13 @@ pub fn egetkey(request: &Align512<[u8; 512]>) -> Result<Align16<[u8; 16]>, u32> asm!( // rbx is reserved by LLVM - "xchg {0}, rbx", + "xchg %rbx, {0}", "enclu", - "mov rbx, {0}", + "mov {0}, %rbx", inout(reg) request => _, inlateout("eax") ENCLU_EGETKEY => error, in("rcx") out.as_mut_ptr(), - options(nostack), + options(att_syntax, nostack), ); match error { @@ -64,14 +64,14 @@ pub fn ereport( asm!( // rbx is reserved by LLVM - "xchg {0}, rbx", + "xchg %rbx, {0}", "enclu", - "mov rbx, {0}", + "mov {0}, %rbx", inout(reg) targetinfo => _, in("eax") ENCLU_EREPORT, in("rcx") reportdata, in("rdx") report.as_mut_ptr(), - options(preserves_flags, nostack), + options(att_syntax, preserves_flags, nostack), ); report.assume_init() diff --git a/library/std/src/sys/sgx/abi/mem.rs b/library/std/src/sys/sgx/abi/mem.rs index 1e743894a9f..52e8bec937c 100644 --- a/library/std/src/sys/sgx/abi/mem.rs +++ b/library/std/src/sys/sgx/abi/mem.rs @@ -36,9 +36,9 @@ pub fn image_base() -> u64 { let base: u64; unsafe { asm!( - "lea {}, qword ptr [rip + IMAGE_BASE]", + "lea IMAGE_BASE(%rip), {}", lateout(reg) base, - options(nostack, preserves_flags, nomem, pure), + options(att_syntax, nostack, preserves_flags, nomem, pure), ) }; base |
