|
|
|
@ -16,6 +16,19 @@ void sbi_call(rv32_cpu_t* cpu, uint32_t extension_id, uint32_t func_id) |
|
|
|
|
cpu->regs.a0 = 0; |
|
|
|
|
cpu->regs.a1 = 0x2000000; |
|
|
|
|
break; |
|
|
|
|
case SBI_FUNCTION_GET_IMPL_ID: |
|
|
|
|
cpu->regs.a0 = 0; |
|
|
|
|
cpu->regs.a1 = 0; |
|
|
|
|
break; |
|
|
|
|
case SBI_FUNCTION_GET_IMPL_VERSION: |
|
|
|
|
cpu->regs.a0 = 0; |
|
|
|
|
cpu->regs.a1 = 0; |
|
|
|
|
break; |
|
|
|
|
case SBI_FUNCTION_PROBE_EXTENSION: |
|
|
|
|
// For now, we say that everything is available
|
|
|
|
|
cpu->regs.a0 = 0; |
|
|
|
|
cpu->regs.a1 = 1; |
|
|
|
|
break; |
|
|
|
|
case SBI_FUNCTION_GET_MVENDOR_ID: |
|
|
|
|
cpu->regs.a0 = 0; |
|
|
|
|
cpu->regs.a1 = 0; |
|
|
|
@ -34,6 +47,19 @@ void sbi_call(rv32_cpu_t* cpu, uint32_t extension_id, uint32_t func_id) |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
case SBI_EXTENSION_TIMER: |
|
|
|
|
{ |
|
|
|
|
switch(func_id) |
|
|
|
|
{ |
|
|
|
|
case SBI_FUNCTION_SET_TIMER: |
|
|
|
|
cpu->regs.a0 = 0; |
|
|
|
|
cpu->regs.a1 = 0; |
|
|
|
|
break; |
|
|
|
|
default: |
|
|
|
|
fprintf(stderr, "sbi_call: unknown function id 0x%x for timer extension\n", func_id); |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
case SBI_EXTENSION_SET_TIMER: |
|
|
|
|
{ |
|
|
|
|
// TODO : Correctly implement that
|
|
|
|
|