OP-TEE / optee_os

Trusted side of the TEE
Other
1.59k stars 1.07k forks source link

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

Closed gagachang closed 2 months ago

gagachang commented 2 months 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.