|
|
@ -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: |
|
|
|
case SBI_FUNCTION_GET_SPEC_VERSION: |
|
|
|
// Format: [31(reserved,0) 7 bits(major) 24 bits(minor)]
|
|
|
|
// Format: [31(reserved,0) 7 bits(major) 24 bits(minor)]
|
|
|
|
// Version 2.0
|
|
|
|
// Version 2.0
|
|
|
|
cpu->regs.a0 = 0x2000000; |
|
|
|
cpu->regs.a0 = 0; |
|
|
|
|
|
|
|
cpu->regs.a1 = 0x2000000; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case SBI_FUNCTION_GET_MVENDOR_ID: |
|
|
|
case SBI_FUNCTION_GET_MVENDOR_ID: |
|
|
|
cpu->regs.a0 = 0; |
|
|
|
cpu->regs.a0 = 0; |
|
|
|
|
|
|
|
cpu->regs.a1 = 0; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case SBI_FUNCTION_GET_MARCH_ID: |
|
|
|
case SBI_FUNCTION_GET_MARCH_ID: |
|
|
|
cpu->regs.a0 = 0; |
|
|
|
cpu->regs.a0 = 0; |
|
|
|
|
|
|
|
cpu->regs.a1 = 0; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case SBI_FUNCTION_GET_MIMPL_ID: |
|
|
|
case SBI_FUNCTION_GET_MIMPL_ID: |
|
|
|
cpu->regs.a0 = 0; |
|
|
|
cpu->regs.a0 = 0; |
|
|
|
|
|
|
|
cpu->regs.a1 = 0; |
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
fprintf(stderr, "sbi_call: unknown function id 0x%x for base extension\n", func_id); |
|
|
|
fprintf(stderr, "sbi_call: unknown function id 0x%x for base extension\n", func_id); |
|
|
|