From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.100; helo=mga07.intel.com; envelope-from=eric.dong@intel.com; receiver=edk2-devel@lists.01.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 84AEE2034CF9C for ; Mon, 23 Oct 2017 00:19:01 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP; 23 Oct 2017 00:22:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,421,1503385200"; d="scan'208";a="1028152306" Received: from ydong10-win10.ccr.corp.intel.com ([10.239.158.64]) by orsmga003.jf.intel.com with ESMTP; 23 Oct 2017 00:22:41 -0700 From: Eric Dong To: edk2-devel@lists.01.org Cc: Ruiyu Ni Date: Mon, 23 Oct 2017 15:22:37 +0800 Message-Id: <1508743358-3640-2-git-send-email-eric.dong@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 In-Reply-To: <1508743358-3640-1-git-send-email-eric.dong@intel.com> References: <1508743358-3640-1-git-send-email-eric.dong@intel.com> Subject: [Patch 1/2] UefiCpuPkg/MpInitLib: Change AP Index variable name. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Oct 2017 07:19:01 -0000 Original AP index variable name not well express the meaning of the variable. Also this name is better used in later patch. So change the variable name for better understanding. Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Eric Dong --- UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc | 2 +- UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm | 4 ++-- UefiCpuPkg/Library/MpInitLib/MpLib.c | 6 +++--- UefiCpuPkg/Library/MpInitLib/MpLib.h | 2 +- UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc | 2 +- UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc b/UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc index 6276230..976af1f 100644 --- a/UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc +++ b/UefiCpuPkg/Library/MpInitLib/Ia32/MpEqu.inc @@ -33,7 +33,7 @@ GdtrLocation equ LockLocation + 10h IdtrLocation equ LockLocation + 16h BufferStartLocation equ LockLocation + 1Ch ModeOffsetLocation equ LockLocation + 20h -NumApsExecutingLocation equ LockLocation + 24h +ApIndexLocation equ LockLocation + 24h CodeSegmentLocation equ LockLocation + 28h DataSegmentLocation equ LockLocation + 2Ch EnableExecuteDisableLocation equ LockLocation + 30h diff --git a/UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm b/UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm index 52363e6..1b9c6a6 100644 --- a/UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm +++ b/UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm @@ -130,7 +130,7 @@ TestLock: jz TestLock mov ecx, esi - add ecx, NumApsExecutingLocation + add ecx, ApIndexLocation inc dword [ecx] mov ebx, [ecx] @@ -200,7 +200,7 @@ CProcedureInvoke: mov eax, ASM_PFX(InitializeFloatingPointUnits) call eax ; Call assembly function to initialize FPU per UEFI spec - push ebx ; Push NumApsExecuting + push ebx ; Push ApIndex mov eax, esi add eax, LockLocation push eax ; push address of exchange info data buffer diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c index f3ee6d4..db923c9 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c @@ -542,7 +542,7 @@ VOID EFIAPI ApWakeupFunction ( IN MP_CPU_EXCHANGE_INFO *ExchangeInfo, - IN UINTN NumApsExecuting + IN UINTN ApIndex ) { CPU_MP_DATA *CpuMpData; @@ -574,7 +574,7 @@ ApWakeupFunction ( // Add CPU number // InterlockedIncrement ((UINT32 *) &CpuMpData->CpuCount); - ProcessorNumber = NumApsExecuting; + ProcessorNumber = ApIndex; // // This is first time AP wakeup, get BIST information from AP stack // @@ -764,7 +764,7 @@ FillExchangeInfoData ( ExchangeInfo->Cr3 = AsmReadCr3 (); ExchangeInfo->CFunction = (UINTN) ApWakeupFunction; - ExchangeInfo->NumApsExecuting = 0; + ExchangeInfo->ApIndex = 0; ExchangeInfo->InitFlag = (UINTN) CpuMpData->InitFlag; ExchangeInfo->CpuInfo = (CPU_INFO_IN_HOB *) (UINTN) CpuMpData->CpuInfoInHob; ExchangeInfo->CpuMpData = CpuMpData; diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.h b/UefiCpuPkg/Library/MpInitLib/MpLib.h index 84ae24f..e41d2db 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.h +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.h @@ -169,7 +169,7 @@ typedef struct { IA32_DESCRIPTOR IdtrProfile; UINTN BufferStart; UINTN ModeOffset; - UINTN NumApsExecuting; + UINTN ApIndex; UINTN CodeSegment; UINTN DataSegment; UINTN EnableExecuteDisable; diff --git a/UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc b/UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc index 5b2529b..114f4e0 100644 --- a/UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc +++ b/UefiCpuPkg/Library/MpInitLib/X64/MpEqu.inc @@ -33,7 +33,7 @@ GdtrLocation equ LockLocation + 20h IdtrLocation equ LockLocation + 2Ah BufferStartLocation equ LockLocation + 34h ModeOffsetLocation equ LockLocation + 3Ch -NumApsExecutingLocation equ LockLocation + 44h +ApIndexLocation equ LockLocation + 44h CodeSegmentLocation equ LockLocation + 4Ch DataSegmentLocation equ LockLocation + 54h EnableExecuteDisableLocation equ LockLocation + 5Ch diff --git a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm b/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm index 0b14a53..4ada649 100644 --- a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm +++ b/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm @@ -134,7 +134,7 @@ TestLock: cmp rax, NotVacantFlag jz TestLock - lea ecx, [esi + NumApsExecutingLocation] + lea ecx, [esi + ApIndexLocation] inc dword [ecx] mov ebx, [ecx] @@ -206,7 +206,7 @@ CProcedureInvoke: call rax ; Call assembly function to initialize FPU per UEFI spec add rsp, 20h - mov edx, ebx ; edx is NumApsExecuting + mov edx, ebx ; edx is ApIndex mov ecx, esi add ecx, LockLocation ; rcx is address of exchange info data buffer -- 2.7.0.windows.1