Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
sbi.h File Reference

RISC-V Supervisor Binary Interface (SBI) definitions. More...

Go to the source code of this file.

Macros

#define SBI_EXT_TIME   0x54494D45
 SBI extension ID for the Timer extension (TIME).
#define SBI_FUNC_SET_TIMER   0
 SBI_EXT_TIME function ID: set the next timer deadline.
#define SBI_EXT_SRST   0x53525354
 SBI extension ID for the System Reset extension (SRST).
#define SBI_FUNC_SYSTEM_RESET   0
 SBI_EXT_SRST function ID: reset or power off the system.
#define SBI_SRST_RESET_TYPE_SHUTDOWN   0
 SBI_EXT_SRST reset type: clean shutdown (power off).
#define SBI_SRST_RESET_TYPE_COLD_REBOOT   1
 SBI_EXT_SRST reset type: cold reboot.
#define SBI_SRST_RESET_TYPE_WARM_REBOOT   2
 SBI_EXT_SRST reset type: warm reboot.
#define SBI_SRST_RESET_REASON_NONE   0
 SBI_EXT_SRST reset reason: no specific reason.
#define SBI_SUCCESS   0
 SBI return code: call completed successfully.
#define SBI_ERR_NOT_SUPPORTED   -1
 SBI return code: requested extension/function is not available.

Detailed Description

RISC-V Supervisor Binary Interface (SBI) definitions.

Defines SBI extension IDs, function IDs, and error codes used by S-mode code to request M-mode firmware services via the ecall instruction. The subset defined here covers only the extensions used by Zephyr's in-tree minimal SBI runtime (arch/riscv/core/sbi.S).

References: RISC-V SBI Specification v2.0 (https://github.com/riscv-non-isa/riscv-sbi-doc)

Macro Definition Documentation

◆ SBI_ERR_NOT_SUPPORTED

#define SBI_ERR_NOT_SUPPORTED   -1

SBI return code: requested extension/function is not available.

◆ SBI_EXT_SRST

#define SBI_EXT_SRST   0x53525354

SBI extension ID for the System Reset extension (SRST).

◆ SBI_EXT_TIME

#define SBI_EXT_TIME   0x54494D45

SBI extension ID for the Timer extension (TIME).

◆ SBI_FUNC_SET_TIMER

#define SBI_FUNC_SET_TIMER   0

SBI_EXT_TIME function ID: set the next timer deadline.

◆ SBI_FUNC_SYSTEM_RESET

#define SBI_FUNC_SYSTEM_RESET   0

SBI_EXT_SRST function ID: reset or power off the system.

◆ SBI_SRST_RESET_REASON_NONE

#define SBI_SRST_RESET_REASON_NONE   0

SBI_EXT_SRST reset reason: no specific reason.

◆ SBI_SRST_RESET_TYPE_COLD_REBOOT

#define SBI_SRST_RESET_TYPE_COLD_REBOOT   1

SBI_EXT_SRST reset type: cold reboot.

◆ SBI_SRST_RESET_TYPE_SHUTDOWN

#define SBI_SRST_RESET_TYPE_SHUTDOWN   0

SBI_EXT_SRST reset type: clean shutdown (power off).

◆ SBI_SRST_RESET_TYPE_WARM_REBOOT

#define SBI_SRST_RESET_TYPE_WARM_REBOOT   2

SBI_EXT_SRST reset type: warm reboot.

◆ SBI_SUCCESS

#define SBI_SUCCESS   0

SBI return code: call completed successfully.