|
|
|
@ -10,6 +10,11 @@ void sbi_call(rv32_cpu_t* cpu, uint32_t extension_id, uint32_t func_id) |
|
|
|
|
{ |
|
|
|
|
switch(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; |
|
|
|
|
break; |
|
|
|
|
case SBI_FUNCTION_GET_MVENDOR_ID: |
|
|
|
|
cpu->regs.a0 = 0; |
|
|
|
|
break; |
|
|
|
@ -25,6 +30,12 @@ void sbi_call(rv32_cpu_t* cpu, uint32_t extension_id, uint32_t func_id) |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
case SBI_EXTENSION_SET_TIMER: |
|
|
|
|
{ |
|
|
|
|
// TODO : Correctly implement that
|
|
|
|
|
cpu->regs.a0 = 0; |
|
|
|
|
break; |
|
|
|
|
} |
|
|
|
|
case SBI_EXTENSION_LEGACY_CONSOLE_PUTCHAR: |
|
|
|
|
{ |
|
|
|
|
printf("%c", cpu->regs.a0); |
|
|
|
|