Rollup merge of #85054 - jethrogb:jb/sgx-inline-asm, r=Amanieu
Revert SGX inline asm syntax This was erroneously changed in #83387
This commit is contained in:
commit
d6e344d45d
2 changed files with 8 additions and 8 deletions
|
@ -33,13 +33,13 @@ pub fn egetkey(request: &Align512<[u8; 512]>) -> Result<Align16<[u8; 16]>, u32>
|
||||||
|
|
||||||
asm!(
|
asm!(
|
||||||
// rbx is reserved by LLVM
|
// rbx is reserved by LLVM
|
||||||
"xchg {0}, rbx",
|
"xchg %rbx, {0}",
|
||||||
"enclu",
|
"enclu",
|
||||||
"mov rbx, {0}",
|
"mov {0}, %rbx",
|
||||||
inout(reg) request => _,
|
inout(reg) request => _,
|
||||||
inlateout("eax") ENCLU_EGETKEY => error,
|
inlateout("eax") ENCLU_EGETKEY => error,
|
||||||
in("rcx") out.as_mut_ptr(),
|
in("rcx") out.as_mut_ptr(),
|
||||||
options(nostack),
|
options(att_syntax, nostack),
|
||||||
);
|
);
|
||||||
|
|
||||||
match error {
|
match error {
|
||||||
|
@ -64,14 +64,14 @@ pub fn ereport(
|
||||||
|
|
||||||
asm!(
|
asm!(
|
||||||
// rbx is reserved by LLVM
|
// rbx is reserved by LLVM
|
||||||
"xchg {0}, rbx",
|
"xchg %rbx, {0}",
|
||||||
"enclu",
|
"enclu",
|
||||||
"mov rbx, {0}",
|
"mov {0}, %rbx",
|
||||||
inout(reg) targetinfo => _,
|
inout(reg) targetinfo => _,
|
||||||
in("eax") ENCLU_EREPORT,
|
in("eax") ENCLU_EREPORT,
|
||||||
in("rcx") reportdata,
|
in("rcx") reportdata,
|
||||||
in("rdx") report.as_mut_ptr(),
|
in("rdx") report.as_mut_ptr(),
|
||||||
options(preserves_flags, nostack),
|
options(att_syntax, preserves_flags, nostack),
|
||||||
);
|
);
|
||||||
|
|
||||||
report.assume_init()
|
report.assume_init()
|
||||||
|
|
|
@ -36,9 +36,9 @@ pub fn image_base() -> u64 {
|
||||||
let base: u64;
|
let base: u64;
|
||||||
unsafe {
|
unsafe {
|
||||||
asm!(
|
asm!(
|
||||||
"lea {}, qword ptr [rip + IMAGE_BASE]",
|
"lea IMAGE_BASE(%rip), {}",
|
||||||
lateout(reg) base,
|
lateout(reg) base,
|
||||||
options(nostack, preserves_flags, nomem, pure),
|
options(att_syntax, nostack, preserves_flags, nomem, pure),
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
base
|
base
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue