From 556640bceac32c86a843d09a1dd0688e44883781 Mon Sep 17 00:00:00 2001 From: Dongyan Qian Date: Tue, 25 Jun 2024 13:51:44 +0800 Subject: 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 Cc: Rahul Kumar Cc: Gerd Hoffmann Cc: Jiaxin Wu Cc: Chao Li Signed-off-by: Dongyan Qian Co-authored-by: Chao Li --- UefiCpuPkg/Library/MpInitLib/LoongArch64/MpLib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'UefiCpuPkg/Library') 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; } -- cgit v1.2.3