Dongyan Qian 2fbaaa96d1 MdePkg/BaseLib: Fix an instruction write width error in LoongArch64
Cpucfg fetch is a 32-bit register, and AsmCpucfg's function
 declaration is a 32-bit address storage operation in BaseLib.h,
So, fix it by replacing stptr.d with stptr.w instrcution.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4797

Cc: Chao Li <lichao@loongson.cn>
Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
Co-authored-by: Chao Li <lichao@loongson.cn>
2024-06-26 00:52:39 +00:00

27 lines
677 B
ArmAsm

#------------------------------------------------------------------------------
#
# AsmCpucfg for LoongArch
#
# Copyright (c) 2024, Loongson Technology Corporation Limited. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
#------------------------------------------------------------------------------
ASM_GLOBAL ASM_PFX(AsmCpucfg)
#/**
# Read CPUCFG register.
#
# @param a0 Specifies the register number of the CPUCFG to read the data.
# @param a1 Pointer to the variable used to store the CPUCFG register value.
#
#**/
ASM_PFX(AsmCpucfg):
cpucfg $t0, $a0
stptr.w $t0, $a1, 0
jirl $zero, $ra, 0
.end