Added SBI functions

This commit is contained in:
vhaudiquet 2023-10-19 16:18:05 +02:00
parent b1a327cccf
commit 5727356559

View File

@ -6,6 +6,25 @@ void sbi_call(rv32_cpu_t* cpu, uint32_t extension_id, uint32_t func_id)
{ {
switch(extension_id) switch(extension_id)
{ {
case SBI_EXTENSION_BASE:
{
switch(func_id)
{
case SBI_FUNCTION_GET_MVENDOR_ID:
cpu->regs.a0 = 0;
break;
case SBI_FUNCTION_GET_MARCH_ID:
cpu->regs.a0 = 0;
break;
case SBI_FUNCTION_GET_MIMPL_ID:
cpu->regs.a0 = 0;
break;
default:
fprintf(stderr, "sbi_call: unknown function id 0x%x for base extension\n", func_id);
break;
}
break;
}
case SBI_EXTENSION_LEGACY_CONSOLE_PUTCHAR: case SBI_EXTENSION_LEGACY_CONSOLE_PUTCHAR:
{ {
printf("%c", cpu->regs.a0); printf("%c", cpu->regs.a0);