MdePkg/BaseLib: RISC-V: Add few more helper functions

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4076

Few of the basic helper functions required for any
RISC-V CPU were added in edk2-platforms. To support
qemu virt, they need to be added in BaseLib.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Daniel Schaefer <git@danielschaefer.me>
Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
Acked-by: Abner Chang <abner.chang@amd.com>
Reviewed-by: Andrei Warkentin <andrei.warkentin@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
This commit is contained in:
Sunil V L
2022-09-06 10:48:12 +05:30
committed by mergify[bot]
parent 8aeb405466
commit 550f196e82
6 changed files with 179 additions and 4 deletions

View File

@@ -151,6 +151,56 @@ typedef struct {
#define BASE_LIBRARY_JUMP_BUFFER_ALIGNMENT 8
VOID
RiscVSetSupervisorScratch (
IN UINT64
);
UINT64
RiscVGetSupervisorScratch (
VOID
);
VOID
RiscVSetSupervisorStvec (
IN UINT64
);
UINT64
RiscVGetSupervisorStvec (
VOID
);
UINT64
RiscVGetSupervisorTrapCause (
VOID
);
VOID
RiscVSetSupervisorAddressTranslationRegister (
IN UINT64
);
UINT64
RiscVReadTimer (
VOID
);
VOID
RiscVEnableTimerInterrupt (
VOID
);
VOID
RiscVDisableTimerInterrupt (
VOID
);
VOID
RiscVClearPendingTimerInterrupt (
VOID
);
#endif // defined (MDE_CPU_RISCV64)
#if defined (MDE_CPU_LOONGARCH64)