Crate rustsbi[][src]

A minimal RISC-V's SBI implementation in Rust.

This library adapts to embedded Rust's embedded-hal crate to provide basical SBI features. When building for own platform, implement traits in this library and pass them to the functions begin with init. After that, you may call rustsbi::ecall in your own exception handler which would dispatch parameters from supervisor to the traits to execute SBI functions.

The library also implements useful functions which may help with platform specific binaries. The enter_privileged maybe used to enter the operating system after the initialization process is finished. The LOGO should be printed if necessary when the binary is initializing.

Note that this crate is a library which contains common building blocks in SBI implementation. It is not intended to be used directly; users should build own platforms with this library. RustSBI provides implementations on common platforms in separate platform crates.

Macros

print

Prints to the legacy debug console.

println

Prints to the legacy debug console, with a newline.

Structs

HartMask

Hart mask structure reference

SbiRet

Call result returned by SBI

Constants

LOGO

The rustsbi logo.

VERSION

RustSBI version as a string.

Traits

Hsm

Hart State Management Extension

Ipi

Inter-processor interrupt support

Reset

System Reset Extension

Timer

Timer programmer support

Functions

ecall

Supervisor environment call handler function

enter_privileged

Enter lower privilege from M code with given SBI parameters.