]> git.proxmox.com Git - mirror_edk2.git/blobdiff - SourceLevelDebugPkg/Library/DebugAgent/DebugAgentCommon/DebugMp.c
SourceLevelDebugPkg DebugAgentLib: Rename IsBsp to DebugAgentIsBsp
[mirror_edk2.git] / SourceLevelDebugPkg / Library / DebugAgent / DebugAgentCommon / DebugMp.c
index bdb6742811ea03f47ffea623b8480f1ef9f800eb..e3ed08db4946487cb0ec50c657b4d5e2de67dc89 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Multi-Processor support functions implementation.\r
 \r
-  Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -75,7 +75,7 @@ HaltOtherProcessors (
   )\r
 {\r
   DebugAgentMsgPrint (DEBUG_AGENT_INFO, "processor[%x]:Try to halt other processors.\n", CurrentProcessorIndex);\r
-  if (!IsBsp (CurrentProcessorIndex)) {\r
+  if (!DebugAgentIsBsp (CurrentProcessorIndex)) {\r
     SetIpiSentByApFlag (TRUE);;\r
   }\r
 \r
@@ -137,10 +137,12 @@ GetProcessorIndex (
 \r
 **/\r
 BOOLEAN\r
-IsBsp (\r
+DebugAgentIsBsp (\r
   IN UINT32  ProcessorIndex\r
   )\r
 {\r
+  MSR_IA32_APIC_BASE_REGISTER  MsrApicBase;\r
+  \r
   //\r
   // If there are less than 2 CPUs detected, then the currently executing CPU\r
   // must be the BSP.  This avoids an access to an MSR that may not be supported \r
@@ -150,7 +152,8 @@ IsBsp (
     return TRUE;\r
   }\r
 \r
-  if (AsmMsrBitFieldRead64 (MSR_IA32_APIC_BASE_ADDRESS, 8, 8) == 1) {\r
+  MsrApicBase.Uint64 = AsmReadMsr64 (MSR_IA32_APIC_BASE);\r
+  if (MsrApicBase.Bits.BSP == 1) {\r
     if (mDebugMpContext.BspIndex != ProcessorIndex) {\r
       AcquireMpSpinLock (&mDebugMpContext.MpContextSpinLock);\r
       mDebugMpContext.BspIndex = ProcessorIndex;\r