mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-05 22:48:02 +00:00
Avoid using rbx in SGX inline assembly since it is reserved
This commit is contained in:
parent
e6a731eb90
commit
09cfb248e7
@ -32,9 +32,12 @@ pub fn egetkey(request: &Align512<[u8; 512]>) -> Result<Align16<[u8; 16]>, u32>
|
|||||||
let error;
|
let error;
|
||||||
|
|
||||||
asm!(
|
asm!(
|
||||||
|
// rbx is reserved by LLVM
|
||||||
|
"xchg {}, rbx",
|
||||||
"enclu",
|
"enclu",
|
||||||
|
"mov rbx, {}",
|
||||||
|
inout(reg) request => _,
|
||||||
inlateout("eax") ENCLU_EGETKEY => error,
|
inlateout("eax") ENCLU_EGETKEY => error,
|
||||||
in("rbx") request,
|
|
||||||
in("rcx") out.as_mut_ptr(),
|
in("rcx") out.as_mut_ptr(),
|
||||||
options(nostack),
|
options(nostack),
|
||||||
);
|
);
|
||||||
@ -60,9 +63,12 @@ pub fn ereport(
|
|||||||
let mut report = MaybeUninit::uninit();
|
let mut report = MaybeUninit::uninit();
|
||||||
|
|
||||||
asm!(
|
asm!(
|
||||||
|
// rbx is reserved by LLVM
|
||||||
|
"xchg {}, rbx",
|
||||||
"enclu",
|
"enclu",
|
||||||
|
"mov rbx, {}",
|
||||||
|
inout(reg) targetinfo => _,
|
||||||
in("eax") ENCLU_EREPORT,
|
in("eax") ENCLU_EREPORT,
|
||||||
in("rbx") targetinfo,
|
|
||||||
in("rcx") reportdata,
|
in("rcx") reportdata,
|
||||||
in("rdx") report.as_mut_ptr(),
|
in("rdx") report.as_mut_ptr(),
|
||||||
options(preserves_flags, nostack),
|
options(preserves_flags, nostack),
|
||||||
|
Loading…
Reference in New Issue
Block a user