Fixed SBI base extension implementation

This commit is contained in:
vhaudiquet 2023-10-20 11:14:38 +02:00
parent dcdebcd8e4
commit bdc091aab2

View File

@ -13,16 +13,20 @@ void sbi_call(rv32_cpu_t* cpu, uint32_t extension_id, uint32_t func_id)
case SBI_FUNCTION_GET_SPEC_VERSION:
// Format: [31(reserved,0) 7 bits(major) 24 bits(minor)]
// Version 2.0
cpu->regs.a0 = 0x2000000;
cpu->regs.a0 = 0;
cpu->regs.a1 = 0x2000000;
break;
case SBI_FUNCTION_GET_MVENDOR_ID:
cpu->regs.a0 = 0;
cpu->regs.a1 = 0;
break;
case SBI_FUNCTION_GET_MARCH_ID:
cpu->regs.a0 = 0;
cpu->regs.a1 = 0;
break;
case SBI_FUNCTION_GET_MIMPL_ID:
cpu->regs.a0 = 0;
cpu->regs.a1 = 0;
break;
default:
fprintf(stderr, "sbi_call: unknown function id 0x%x for base extension\n", func_id);