TianoCore EDK2 master
|
#include <Library/BaseLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/BaseRiscVSbiLib.h>
Go to the source code of this file.
Macros | |
#define | SBI_CALL_MAX_ARGS 6 |
Functions | |
SBI_RET EFIAPI | SbiCall (IN UINTN ExtId, IN UINTN FuncId, IN UINTN NumArgs,...) |
EFI_STATUS EFIAPI | TranslateError (IN UINTN SbiError) |
VOID EFIAPI | SbiSetTimer (IN UINT64 Time) |
EFI_STATUS EFIAPI | SbiSystemReset (IN UINTN ResetType, IN UINTN ResetReason) |
VOID EFIAPI | GetFirmwareContext (OUT EFI_RISCV_FIRMWARE_CONTEXT **FirmwareContext) |
VOID EFIAPI | SetFirmwareContext (IN EFI_RISCV_FIRMWARE_CONTEXT *FirmwareContext) |
VOID EFIAPI | GetFirmwareContextPointer (IN OUT EFI_RISCV_FIRMWARE_CONTEXT **FirmwareContextPtr) |
VOID EFIAPI | SetFirmwareContextPointer (IN EFI_RISCV_FIRMWARE_CONTEXT *FirmwareContextPtr) |
Instance of the SBI ecall library.
It allows calling an SBI function via an ecall from S-Mode.
Copyright (c) 2021-2022, Hewlett Packard Development LP. All rights reserved.
Copyright (c) 2023, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file BaseRiscVSbiLib.c.
#define SBI_CALL_MAX_ARGS 6 |
Definition at line 20 of file BaseRiscVSbiLib.c.
VOID EFIAPI GetFirmwareContext | ( | OUT EFI_RISCV_FIRMWARE_CONTEXT ** | FirmwareContext | ) |
Get firmware context of the calling hart.
[out] | FirmwareContext | The firmware context pointer. |
Definition at line 178 of file BaseRiscVSbiLib.c.
VOID EFIAPI GetFirmwareContextPointer | ( | IN OUT EFI_RISCV_FIRMWARE_CONTEXT ** | FirmwareContextPtr | ) |
Get pointer to OpenSBI Firmware Context
Get the pointer of firmware context through OpenSBI FW Extension SBI.
FirmwareContextPtr | Pointer to retrieve pointer to the Firmware Context. |
Definition at line 209 of file BaseRiscVSbiLib.c.
Call SBI call using ecall instruction.
Asserts when NumArgs exceeds SBI_CALL_MAX_ARGS.
[in] | ExtId | SBI extension ID. |
[in] | FuncId | SBI function ID. |
[in] | NumArgs | Number of arguments to pass to the ecall. |
[in] | ... | Argument list for the ecall. |
Returns | SBI_RET structure with value and error code. |
Definition at line 37 of file BaseRiscVSbiLib.c.
VOID EFIAPI SbiSetTimer | ( | IN UINT64 | Time | ) |
Clear pending timer interrupt bit and set timer for next event after Time.
To clear the timer without scheduling a timer event, set Time to a practically infinite value or mask the timer interrupt by clearing sie.STIE.
[in] | Time | The time offset to the next scheduled timer interrupt. |
Definition at line 138 of file BaseRiscVSbiLib.c.
EFI_STATUS EFIAPI SbiSystemReset | ( | IN UINTN | ResetType, |
IN UINTN | ResetReason | ||
) |
Reset the system using SRST SBI extenion
[in] | ResetType | The SRST System Reset Type. |
[in] | ResetReason | The SRST System Reset Reason. |
Definition at line 153 of file BaseRiscVSbiLib.c.
VOID EFIAPI SetFirmwareContext | ( | IN EFI_RISCV_FIRMWARE_CONTEXT * | FirmwareContext | ) |
Set firmware context of the calling hart.
[in] | FirmwareContext | The firmware context pointer. |
Definition at line 192 of file BaseRiscVSbiLib.c.
VOID EFIAPI SetFirmwareContextPointer | ( | IN EFI_RISCV_FIRMWARE_CONTEXT * | FirmwareContextPtr | ) |
Set the pointer to OpenSBI Firmware Context
Set the pointer of firmware context through OpenSBI FW Extension SBI.
FirmwareContextPtr | Pointer to Firmware Context. |
Definition at line 225 of file BaseRiscVSbiLib.c.
EFI_STATUS EFIAPI TranslateError | ( | IN UINTN | SbiError | ) |
Translate SBI error code to EFI status.
[in] | SbiError | SBI error code |
EFI_STATUS |
Definition at line 93 of file BaseRiscVSbiLib.c.