OP-TEE / optee_os

Trusted side of the TEE
Other
1.56k stars 1.05k forks source link

RISC-V: Fix initial value of a0 in "detect_csr" assembly macro #7009

Closed gagachang closed 1 month ago

gagachang commented 1 month ago

We want to set value of the register a0 to 1 here. To set initial value of the register a0 to 1, the assembly code should be "li a0, 1" instead of "addi a0, a0, 1". Otherwise, a0 will be any value greater than 1.