Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
Return randomness from the a1 register and not a0
Browse files Browse the repository at this point in the history
  • Loading branch information
deepaksirone authored and dayeol committed Nov 20, 2022
1 parent 6958c3b commit 31da6e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ sbi_exit_enclave(uint64_t retval) {

uintptr_t
sbi_random() {
return SBI_CALL_0(SBI_EXT_EXPERIMENTAL_KEYSTONE_ENCLAVE, SBI_SM_RANDOM);
SBI_CALL_0(SBI_EXT_EXPERIMENTAL_KEYSTONE_ENCLAVE, SBI_SM_RANDOM);
register uintptr_t a1 __asm__("a1");
return a1;
}

uintptr_t
Expand Down

0 comments on commit 31da6e3

Please sign in to comment.