Cleaned up ecall asm volatile

This commit is contained in:
Thomas Muller 2022-04-09 14:02:41 -04:00
parent b78b3f5763
commit 9023bb8d60
Signed by: thomas
GPG key ID: AF006EB730564952

View file

@ -20,11 +20,11 @@ namespace opensbi {
register sbiword_t r_a3 asm("a3") = a3;
register sbiword_t r_a4 asm("a4") = a4;
register sbiword_t r_a5 asm("a5") = a5;
asm volatile("ecall" : // Instruction
"=r"(r_a0), "=r"(r_a1) : // Inputs
"r"(r_a7), "r"(r_a6), // Outputs
"r"(r_a0), "r"(r_a1), "r"(r_a2),
"r"(r_a3), "r"(r_a4), "r"(r_a5));
asm volatile(
"ecall" :
"=r"(r_a0), "=r"(r_a1) :
"r"(r_a0), "r"(r_a1), "r"(r_a2), "r"(r_a3),
"r"(r_a4), "r"(r_a5), "r"(r_a7), "r"(r_a6));
return {.error = r_a0, .value = r_a1};
}