The base extension is designed to be as small as possible. As such, it only contains functionality for probing which SBI extensions are available and for querying the version of the SBI. All functions in the base extension must be supported by all SBI implementations, so there are no error returns defined.
struct sbiret sbi_get_spec_version(void);
Returns the current SBI specification version. This function must always succeed. The minor number of the SBI specification is encoded in the low 24 bits, with the major number encoded in the next 7 bits. Bit 31 must be 0 and is reserved for future expansion.
struct sbiret sbi_get_impl_id(void);
Returns the current SBI implementation ID, which is different for every SBI implementation. It is intended that this implementation ID allows software to probe for SBI implementation quirks.
struct sbiret sbi_get_impl_version(void);
Returns the current SBI implementation version. The encoding of this version number is specific to the SBI implementation.
struct sbiret sbi_probe_extension(long extension_id);
Returns 0 if the given SBI extension ID (EID) is not available, or 1 if it is available unless defined as any other non-zero value by the implementation.
struct sbiret sbi_get_mvendorid(void);
Return a value that is legal for the mvendorid
CSR and 0 is always a legal
value for this CSR.
struct sbiret sbi_get_marchid(void);
Return a value that is legal for the marchid
CSR and 0 is always a legal
value for this CSR.
struct sbiret sbi_get_mimpid(void);
Return a value that is legal for the mimpid
CSR and 0 is always a legal
value for this CSR.
Function Name | SBI Version | FID | EID |
---|---|---|---|
sbi_get_spec_version |
0.2 |
0 |
0x10 |
sbi_get_impl_id |
0.2 |
1 |
0x10 |
sbi_get_impl_version |
0.2 |
2 |
0x10 |
sbi_probe_extension |
0.2 |
3 |
0x10 |
sbi_get_mvendorid |
0.2 |
4 |
0x10 |
sbi_get_marchid |
0.2 |
5 |
0x10 |
sbi_get_mimpid |
0.2 |
6 |
0x10 |