Avoid using rbx in SGX inline assembly since it is reserved
This commit is contained in:
parent
e6a731eb90
commit
09cfb248e7
1 changed files with 8 additions and 2 deletions
|
@ -32,9 +32,12 @@ pub fn egetkey(request: &Align512<[u8; 512]>) -> Result<Align16<[u8; 16]>, u32>
|
|||
let error;
|
||||
|
||||
asm!(
|
||||
// rbx is reserved by LLVM
|
||||
"xchg {}, rbx",
|
||||
"enclu",
|
||||
"mov rbx, {}",
|
||||
inout(reg) request => _,
|
||||
inlateout("eax") ENCLU_EGETKEY => error,
|
||||
in("rbx") request,
|
||||
in("rcx") out.as_mut_ptr(),
|
||||
options(nostack),
|
||||
);
|
||||
|
@ -60,9 +63,12 @@ pub fn ereport(
|
|||
let mut report = MaybeUninit::uninit();
|
||||
|
||||
asm!(
|
||||
// rbx is reserved by LLVM
|
||||
"xchg {}, rbx",
|
||||
"enclu",
|
||||
"mov rbx, {}",
|
||||
inout(reg) targetinfo => _,
|
||||
in("eax") ENCLU_EREPORT,
|
||||
in("rbx") targetinfo,
|
||||
in("rcx") reportdata,
|
||||
in("rdx") report.as_mut_ptr(),
|
||||
options(preserves_flags, nostack),
|
||||
|
|
Loading…
Add table
Reference in a new issue