mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-31 01:24:12 +02:00
MdePkg: Add read stable counter operation for LoongArch
Add LoongArch gets stable counter ASM function. BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584 Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Signed-off-by: Chao Li <lichao@loongson.cn> Acked-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
This commit is contained in:
parent
344dc4b9d3
commit
414ad233a5
@ -339,6 +339,18 @@ AsmCpucfg (
|
|||||||
OUT UINT32 *Data
|
OUT UINT32 *Data
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Gets the timer count value.
|
||||||
|
|
||||||
|
@param[] VOID
|
||||||
|
@retval timer count value.
|
||||||
|
|
||||||
|
**/
|
||||||
|
UINTN
|
||||||
|
AsmReadStableCounter (
|
||||||
|
VOID
|
||||||
|
);
|
||||||
|
|
||||||
#endif // defined (MDE_CPU_LOONGARCH64)
|
#endif // defined (MDE_CPU_LOONGARCH64)
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -422,6 +422,7 @@
|
|||||||
LoongArch64/SwitchStack.S | GCC
|
LoongArch64/SwitchStack.S | GCC
|
||||||
LoongArch64/ExceptionBase.S | GCC
|
LoongArch64/ExceptionBase.S | GCC
|
||||||
LoongArch64/Cpucfg.S | GCC
|
LoongArch64/Cpucfg.S | GCC
|
||||||
|
LoongArch64/ReadStableCounter.S | GCC
|
||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
MdePkg/MdePkg.dec
|
MdePkg/MdePkg.dec
|
||||||
|
24
MdePkg/Library/BaseLib/LoongArch64/ReadStableCounter.S
Normal file
24
MdePkg/Library/BaseLib/LoongArch64/ReadStableCounter.S
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#------------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# LoongArch Read Stable Counter
|
||||||
|
#
|
||||||
|
# Copyright (c) 2024, Loongson Technology Corporation Limited. All rights reserved.<BR>
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
#
|
||||||
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
ASM_GLOBAL ASM_PFX(AsmReadStableCounter)
|
||||||
|
|
||||||
|
#/**
|
||||||
|
# Gets the timer count value.
|
||||||
|
#
|
||||||
|
# @param[] VOID
|
||||||
|
# @retval timer count value.
|
||||||
|
#
|
||||||
|
#**/
|
||||||
|
|
||||||
|
ASM_PFX(AsmReadStableCounter):
|
||||||
|
rdtime.d $a0, $zero
|
||||||
|
jirl $zero, $ra, 0
|
||||||
|
.end
|
Loading…
x
Reference in New Issue
Block a user