Skip to content

Latest commit

 

History

History
113 lines (87 loc) · 3.15 KB

ext-base.adoc

File metadata and controls

113 lines (87 loc) · 3.15 KB

Base Extension (EID #0x10)

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.

Function: Get SBI specification version (FID #0)

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.

Function: Get SBI implementation ID (FID #1)

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.

Function: Get SBI implementation version (FID #2)

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.

Function: Probe SBI extension (FID #3)

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.

Function: Get machine vendor ID (FID #4)

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.

Function: Get machine architecture ID (FID #5)

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.

Function: Get machine implementation ID (FID #6)

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 Listing

Table 1. Base Function List
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

SBI Implementation IDs

Table 2. SBI Implementation IDs
Implementation ID Name

0

Berkeley Boot Loader (BBL)

1

OpenSBI

2

Xvisor

3

KVM

4

RustSBI

5

Diosix

6

Coffer

7

Xen Project

8

PolarFire Hart Software Services