mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-08-24 15:31:22 +01:00
lib: sbi: fix missing high 32bits when sbi_cppc_write on rv32
sbi_cppc_write was writing to the a1 register only, which under rv32 would cause the high 32 bits to always be 0. This patch fixes that. Closes: https://github.com/riscv-software-src/opensbi/issues/334 Signed-off-by: Xiang W <wxjstz@126.com> Reported-by: Wesley Norris <repnop@outlook.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
@@ -32,7 +32,13 @@ static int sbi_ecall_cppc_handler(unsigned long extid, unsigned long funcid,
|
||||
#endif
|
||||
break;
|
||||
case SBI_EXT_CPPC_WRITE:
|
||||
ret = sbi_cppc_write(regs->a0, regs->a1);
|
||||
#if __riscv_xlen == 32
|
||||
temp = regs->a2;
|
||||
temp = (temp << 32) | regs->a1;
|
||||
#else
|
||||
temp = regs->a1;
|
||||
#endif
|
||||
ret = sbi_cppc_write(regs->a0, temp);
|
||||
break;
|
||||
case SBI_EXT_CPPC_PROBE:
|
||||
ret = sbi_cppc_probe(regs->a0);
|
||||
|
Reference in New Issue
Block a user