MdePkg/BaseLib: RISC-V: Add function to update stimecmp register
stimecmp is a CSR supported only when Sstc extension is supported by the platform. This register can be used to set the timer interrupt directly in S-mode instead of going via SBI call. Add a function to update this register. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Cc: Andrei Warkentin <andrei.warkentin@intel.com> Signed-off-by: Sunil V L <sunilvl@ventanamicro.com> Reviewed-by: Andrei Warkentin <andrei.warkentin@intel.com>
This commit is contained in:
@@ -191,6 +191,11 @@ RiscVReadTimer (
|
||||
VOID
|
||||
);
|
||||
|
||||
VOID
|
||||
RiscVSetSupervisorTimeCompareRegister (
|
||||
IN UINT64
|
||||
);
|
||||
|
||||
VOID
|
||||
RiscVEnableTimerInterrupt (
|
||||
VOID
|
||||
|
@@ -96,6 +96,9 @@
|
||||
/* Supervisor Protection and Translation */
|
||||
#define CSR_SATP 0x180
|
||||
|
||||
/* Sstc extension */
|
||||
#define CSR_STIMECMP 0x14D
|
||||
|
||||
/* Trap/Exception Causes */
|
||||
#define CAUSE_MISALIGNED_FETCH 0x0
|
||||
#define CAUSE_FETCH_ACCESS 0x1
|
||||
|
Reference in New Issue
Block a user