16#ifndef RISCV_SBI_LIB_H_
17#define RISCV_SBI_LIB_H_
22#define SBI_EXT_0_1_CONSOLE_PUTCHAR 0x1
23#define SBI_EXT_0_1_CONSOLE_GETCHAR 0x2
24#define SBI_EXT_BASE 0x10
25#define SBI_EXT_DBCN 0x4442434E
26#define SBI_EXT_TIME 0x54494D45
27#define SBI_EXT_SRST 0x53525354
30#define SBI_EXT_BASE_SPEC_VERSION 0x0
31#define SBI_EXT_BASE_IMPL_ID 0x1
32#define SBI_EXT_BASE_IMPL_VERSION 0x2
33#define SBI_EXT_BASE_PROBE_EXT 0x3
34#define SBI_EXT_BASE_GET_MVENDORID 0x4
35#define SBI_EXT_BASE_GET_MARCHID 0x5
36#define SBI_EXT_BASE_GET_MIMPID 0x6
39#define SBI_EXT_DBCN_WRITE 0x0
40#define SBI_EXT_DBCN_READ 0x1
41#define SBI_EXT_DBCN_WRITE_BYTE 0x2
44#define SBI_EXT_TIME_SET_TIMER 0x0
47#define SBI_EXT_SRST_RESET 0x0
49#define SBI_SRST_RESET_TYPE_SHUTDOWN 0x0
50#define SBI_SRST_RESET_TYPE_COLD_REBOOT 0x1
51#define SBI_SRST_RESET_TYPE_WARM_REBOOT 0x2
53#define SBI_SRST_RESET_REASON_NONE 0x0
54#define SBI_SRST_RESET_REASON_SYSFAIL 0x1
58#define SBI_ERR_FAILED -1
59#define SBI_ERR_NOT_SUPPORTED -2
60#define SBI_ERR_INVALID_PARAM -3
61#define SBI_ERR_DENIED -4
62#define SBI_ERR_INVALID_ADDRESS -5
63#define SBI_ERR_ALREADY_AVAILABLE -6
64#define SBI_ERR_ALREADY_STARTED -7
65#define SBI_ERR_ALREADY_STOPPED -8
67#define SBI_LAST_ERR SBI_ERR_ALREADY_STOPPED
71 VOID *PeiServiceTable;
73 UINT64 FlattenedDeviceTree;
EFI_STATUS EFIAPI SbiSystemReset(IN UINTN ResetType, IN UINTN ResetReason)
VOID EFIAPI SetFirmwareContextPointer(IN EFI_RISCV_FIRMWARE_CONTEXT *FirmwareContextPtr)
VOID EFIAPI SbiSetTimer(IN UINT64 Time)
VOID EFIAPI SetFirmwareContext(IN EFI_RISCV_FIRMWARE_CONTEXT *FirmwareContext)
VOID EFIAPI RiscVSbiEcall(IN OUT UINTN *Arg0, IN OUT UINTN *Arg1, IN UINTN Arg2, IN UINTN Arg3, IN UINTN Arg4, IN UINTN Arg5, IN UINTN Fid, IN UINTN Ext)
VOID EFIAPI GetFirmwareContext(OUT EFI_RISCV_FIRMWARE_CONTEXT **FirmwareContext)
VOID EFIAPI GetFirmwareContextPointer(IN OUT EFI_RISCV_FIRMWARE_CONTEXT **FirmwareContextPtr)
SBI_RET EFIAPI SbiCall(IN UINTN ExtId, IN UINTN FuncId, IN UINTN NumArgs,...)
EFI_STATUS EFIAPI TranslateError(IN UINTN SbiError)
UINTN Error
SBI status code.
UINTN Value
Value returned.