summaryrefslogtreecommitdiffstats
path: root/UefiCpuPkg/Library
diff options
context:
space:
mode:
authorDongyan Qian <qiandongyan@loongson.cn>2024-06-25 13:51:44 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-07-25 06:17:09 +0000
commit556640bceac32c86a843d09a1dd0688e44883781 (patch)
tree2a98ba435d930e6f5159fc7194314aa70ba9ee27 /UefiCpuPkg/Library
parent6271b617b4e653029246152871cde93f3926e144 (diff)
downloadedk2-556640bceac32c86a843d09a1dd0688e44883781.tar.gz
edk2-556640bceac32c86a843d09a1dd0688e44883781.tar.bz2
edk2-556640bceac32c86a843d09a1dd0688e44883781.zip
UefiCpuPkg/MpInitLib: Reduce compiler dependencies for LoongArch
Structure assignment may depend on the compiler to expand to memcpy. For this, we may need to add -mno-memcpy to the compilation flag. Here, we reduce dependencies and use CopyMem for data conversion without memcpy. Cc: Ray Ni <ray.ni@intel.com> Cc: Rahul Kumar <rahul1.kumar@intel.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Chao Li <lichao@loongson.cn> Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn> Co-authored-by: Chao Li <lichao@loongson.cn>
Diffstat (limited to 'UefiCpuPkg/Library')
-rw-r--r--UefiCpuPkg/Library/MpInitLib/LoongArch64/MpLib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/UefiCpuPkg/Library/MpInitLib/LoongArch64/MpLib.c b/UefiCpuPkg/Library/MpInitLib/LoongArch64/MpLib.c
index c18671e95f..54c23ecf10 100644
--- a/UefiCpuPkg/Library/MpInitLib/LoongArch64/MpLib.c
+++ b/UefiCpuPkg/Library/MpInitLib/LoongArch64/MpLib.c
@@ -130,8 +130,8 @@ SortApicId (
} else {
for ( ; Index2 <= ApCount; Index2++) {
if (CpuInfoInHob[Index2].ApicId == INVALID_APIC_ID) {
- CopyMem (&CpuInfoInHob[Index2], &CpuInfoInHob[Index1], sizeof (CPU_INFO_IN_HOB));
- CpuMpData->CpuData[Index2] = CpuMpData->CpuData[Index1];
+ CopyMem (CpuInfoInHob + Index2, CpuInfoInHob + Index1, sizeof (CPU_INFO_IN_HOB));
+ CopyMem (CpuMpData->CpuData + Index2, CpuMpData->CpuData + Index1, sizeof (CPU_AP_DATA));
CpuInfoInHob[Index1].ApicId = INVALID_APIC_ID;
break;
}