seL4
seL4 copied to clipboard
risc-v: remove K constraint in fcsr access wrapper
The 'K' constraint is for 5-bit unsigned integer immediate operands only in both GCC and LLVM. It does not apply to the value written.
See manuals:
- https://llvm.org/docs/LangRef.html#supported-constraint-code-list
- https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html
In the Linux kernel there is this the commit https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/arch/riscv/include/asm/csr.h?id=5d8544e2d0075a5f3c9a2cf27152354d54360da1 that adds the 'K' constraint, which might explain the origin. Even if this has never been change, I still think this is incorrect usage.