Looks reasonable to me.

Reviewed-by: Andrei Warkentin <andrei.warken...@intel.com>

> -----Original Message-----
> From: Tuan Phan <tp...@ventanamicro.com>
> Sent: Friday, April 14, 2023 1:58 PM
> To: devel@edk2.groups.io
> Cc: Kinney, Michael D <michael.d.kin...@intel.com>; Gao, Liming
> <gaolim...@byosoft.com.cn>; Liu, Zhiguang <zhiguang....@intel.com>;
> suni...@ventanamicro.com; g...@danielschaefer.me; Warkentin, Andrei
> <andrei.warken...@intel.com>; Tuan Phan <tp...@ventanamicro.com>
> Subject: [PATCH v2 1/6] MdePkg/BaseLib: RISC-V: Support getting satp
> register value
> 
> Add an API to retrieve satp register value.
> 
> Signed-off-by: Tuan Phan <tp...@ventanamicro.com>
> ---
>  MdePkg/Include/Library/BaseLib.h          | 5 +++++
>  MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S | 8 ++++++++
>  2 files changed, 13 insertions(+)
> 
> diff --git a/MdePkg/Include/Library/BaseLib.h
> b/MdePkg/Include/Library/BaseLib.h
> index 8f2df76c29a3..5d7067ee854e 100644
> --- a/MdePkg/Include/Library/BaseLib.h
> +++ b/MdePkg/Include/Library/BaseLib.h
> @@ -181,6 +181,11 @@ RiscVSetSupervisorAddressTranslationRegister (
>    IN UINT64
> 
>    );
> 
> 
> 
> +UINT64
> 
> +RiscVGetSupervisorAddressTranslationRegister (
> 
> +  VOID
> 
> +  );
> 
> +
> 
>  UINT64
> 
>  RiscVReadTimer (
> 
>    VOID
> 
> diff --git a/MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S
> b/MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S
> index ac8f92f38aed..c9cf60c1664b 100644
> --- a/MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S
> +++ b/MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S
> @@ -21,3 +21,11 @@
>  ASM_FUNC (RiscVSetSupervisorAddressTranslationRegister)
> 
>      csrw  CSR_SATP, a0
> 
>      ret
> 
> +
> 
> +//
> 
> +// Get the value of Supervisor Address Translation and
> 
> +// Protection Register.
> 
> +//
> 
> +ASM_FUNC (RiscVGetSupervisorAddressTranslationRegister)
> 
> +    csrr  a0, CSR_SATP
> 
> +    ret
> 
> --
> 2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#103168): https://edk2.groups.io/g/devel/message/103168
Mute This Topic: https://groups.io/mt/98269072/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to