]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/CpuDxe/CpuMp.c
UefiCpuPkg: Apply uncrustify changes
[mirror_edk2.git] / UefiCpuPkg / CpuDxe / CpuMp.c
index 60ede38df4fccf377b7606d4514fea60b4e770c7..1f218367b3a155cd2a86db495c3938a42e8b26f9 100644 (file)
@@ -9,8 +9,8 @@
 #include "CpuDxe.h"\r
 #include "CpuMp.h"\r
 \r
-EFI_HANDLE     mMpServiceHandle       = NULL;\r
-UINTN          mNumberOfProcessors    = 1;\r
+EFI_HANDLE  mMpServiceHandle    = NULL;\r
+UINTN       mNumberOfProcessors = 1;\r
 \r
 EFI_MP_SERVICES_PROTOCOL  mMpServicesTemplate = {\r
   GetNumberOfProcessors,\r
@@ -509,7 +509,7 @@ WhoAmI (
   OUT UINTN                    *ProcessorNumber\r
   )\r
 {\r
-  return MpInitLibWhoAmI (ProcessorNumber);;\r
+  return MpInitLibWhoAmI (ProcessorNumber);\r
 }\r
 \r
 /**\r
@@ -547,8 +547,8 @@ CollectBistDataFromHob (
     // Sec Platform Information2 PPI includes BSP/APs' BIST information\r
     //\r
     SecPlatformInformation2 = GET_GUID_HOB_DATA (GuidHob);\r
-    NumberOfData = SecPlatformInformation2->NumberOfCpus;\r
-    CpuInstance  = SecPlatformInformation2->CpuInstance;\r
+    NumberOfData            = SecPlatformInformation2->NumberOfCpus;\r
+    CpuInstance             = SecPlatformInformation2->CpuInstance;\r
   } else {\r
     //\r
     // Otherwise, get gEfiSecPlatformInformationPpiGuid Guided HOB\r
@@ -556,14 +556,14 @@ CollectBistDataFromHob (
     GuidHob = GetFirstGuidHob (&gEfiSecPlatformInformationPpiGuid);\r
     if (GuidHob != NULL) {\r
       SecPlatformInformation = GET_GUID_HOB_DATA (GuidHob);\r
-      NumberOfData = 1;\r
+      NumberOfData           = 1;\r
       //\r
       // SEC Platform Information only includes BSP's BIST information\r
       // does not have BSP's APIC ID\r
       //\r
-      BspCpuInstance.CpuLocation = GetApicId ();\r
-      BspCpuInstance.InfoRecord.IA32HealthFlags.Uint32  = SecPlatformInformation->IA32HealthFlags.Uint32;\r
-      CpuInstance = &BspCpuInstance;\r
+      BspCpuInstance.CpuLocation                       = GetApicId ();\r
+      BspCpuInstance.InfoRecord.IA32HealthFlags.Uint32 = SecPlatformInformation->IA32HealthFlags.Uint32;\r
+      CpuInstance                                      = &BspCpuInstance;\r
     } else {\r
       DEBUG ((DEBUG_INFO, "Does not find any HOB stored CPU BIST information!\n"));\r
       //\r
@@ -583,6 +583,7 @@ CollectBistDataFromHob (
         BistData = CpuInstance[CpuInstanceNumber].InfoRecord.IA32HealthFlags;\r
       }\r
     }\r
+\r
     if (BistData.Uint32 != 0) {\r
       //\r
       // Report Status Code that self test is failed\r
@@ -607,7 +608,7 @@ CollectBistDataFromHob (
 VOID\r
 EFIAPI\r
 GetGdtr (\r
-  IN OUT VOID *Buffer\r
+  IN OUT VOID  *Buffer\r
   )\r
 {\r
   AsmReadGdtr ((IA32_DESCRIPTOR *)Buffer);\r
@@ -625,12 +626,12 @@ GetGdtr (
 VOID\r
 EFIAPI\r
 InitializeExceptionStackSwitchHandlers (\r
-  IN OUT VOID *Buffer\r
+  IN OUT VOID  *Buffer\r
   )\r
 {\r
-  CPU_EXCEPTION_INIT_DATA           *EssData;\r
-  IA32_DESCRIPTOR                   Idtr;\r
-  EFI_STATUS                        Status;\r
+  CPU_EXCEPTION_INIT_DATA  *EssData;\r
+  IA32_DESCRIPTOR          Idtr;\r
+  EFI_STATUS               Status;\r
 \r
   EssData = Buffer;\r
   //\r
@@ -638,9 +639,9 @@ InitializeExceptionStackSwitchHandlers (
   // the AP's IDT is the same as BSP's IDT either.\r
   //\r
   AsmReadIdtr (&Idtr);\r
-  EssData->Ia32.IdtTable = (VOID *)Idtr.Base;\r
+  EssData->Ia32.IdtTable     = (VOID *)Idtr.Base;\r
   EssData->Ia32.IdtTableSize = Idtr.Limit + 1;\r
-  Status = InitializeCpuExceptionHandlersEx (NULL, EssData);\r
+  Status                     = InitializeCpuExceptionHandlersEx (NULL, EssData);\r
   ASSERT_EFI_ERROR (Status);\r
 }\r
 \r
@@ -656,19 +657,19 @@ InitializeMpExceptionStackSwitchHandlers (
   VOID\r
   )\r
 {\r
-  UINTN                           Index;\r
-  UINTN                           Bsp;\r
-  UINTN                           ExceptionNumber;\r
-  UINTN                           OldGdtSize;\r
-  UINTN                           NewGdtSize;\r
-  UINTN                           NewStackSize;\r
-  IA32_DESCRIPTOR                 Gdtr;\r
-  CPU_EXCEPTION_INIT_DATA         EssData;\r
-  UINT8                           *GdtBuffer;\r
-  UINT8                           *StackTop;\r
+  UINTN                    Index;\r
+  UINTN                    Bsp;\r
+  UINTN                    ExceptionNumber;\r
+  UINTN                    OldGdtSize;\r
+  UINTN                    NewGdtSize;\r
+  UINTN                    NewStackSize;\r
+  IA32_DESCRIPTOR          Gdtr;\r
+  CPU_EXCEPTION_INIT_DATA  EssData;\r
+  UINT8                    *GdtBuffer;\r
+  UINT8                    *StackTop;\r
 \r
   ExceptionNumber = FixedPcdGetSize (PcdCpuStackSwitchExceptionList);\r
-  NewStackSize = FixedPcdGet32 (PcdCpuKnownGoodStackSize) * ExceptionNumber;\r
+  NewStackSize    = FixedPcdGet32 (PcdCpuKnownGoodStackSize) * ExceptionNumber;\r
 \r
   StackTop = AllocateRuntimeZeroPool (NewStackSize * mNumberOfProcessors);\r
   ASSERT (StackTop != NULL);\r
@@ -678,17 +679,17 @@ InitializeMpExceptionStackSwitchHandlers (
   // The default exception handlers must have been initialized. Let's just skip\r
   // it in this method.\r
   //\r
-  EssData.Ia32.Revision = CPU_EXCEPTION_INIT_DATA_REV;\r
+  EssData.Ia32.Revision            = CPU_EXCEPTION_INIT_DATA_REV;\r
   EssData.Ia32.InitDefaultHandlers = FALSE;\r
 \r
-  EssData.Ia32.StackSwitchExceptions = FixedPcdGetPtr(PcdCpuStackSwitchExceptionList);\r
+  EssData.Ia32.StackSwitchExceptions      = FixedPcdGetPtr (PcdCpuStackSwitchExceptionList);\r
   EssData.Ia32.StackSwitchExceptionNumber = ExceptionNumber;\r
-  EssData.Ia32.KnownGoodStackSize = FixedPcdGet32(PcdCpuKnownGoodStackSize);\r
+  EssData.Ia32.KnownGoodStackSize         = FixedPcdGet32 (PcdCpuKnownGoodStackSize);\r
 \r
   //\r
   // Initialize Gdtr to suppress incorrect compiler/analyzer warnings.\r
   //\r
-  Gdtr.Base = 0;\r
+  Gdtr.Base  = 0;\r
   Gdtr.Limit = 0;\r
   MpInitLibWhoAmI (&Bsp);\r
   for (Index = 0; Index < mNumberOfProcessors; ++Index) {\r
@@ -733,7 +734,7 @@ InitializeMpExceptionStackSwitchHandlers (
     //    |                              |\r
     //    --------------------------------\r
     //\r
-    OldGdtSize = Gdtr.Limit + 1;\r
+    OldGdtSize                        = Gdtr.Limit + 1;\r
     EssData.Ia32.ExceptionTssDescSize = sizeof (IA32_TSS_DESCRIPTOR) *\r
                                         (ExceptionNumber + 1);\r
     EssData.Ia32.ExceptionTssSize = sizeof (IA32_TASK_STATE_SEGMENT) *\r
@@ -749,19 +750,21 @@ InitializeMpExceptionStackSwitchHandlers (
     //\r
     // Make sure GDT table alignment\r
     //\r
-    EssData.Ia32.GdtTable = ALIGN_POINTER(GdtBuffer, sizeof (IA32_TSS_DESCRIPTOR));\r
-    NewGdtSize -= ((UINT8 *)EssData.Ia32.GdtTable - GdtBuffer);\r
+    EssData.Ia32.GdtTable     = ALIGN_POINTER (GdtBuffer, sizeof (IA32_TSS_DESCRIPTOR));\r
+    NewGdtSize               -= ((UINT8 *)EssData.Ia32.GdtTable - GdtBuffer);\r
     EssData.Ia32.GdtTableSize = NewGdtSize;\r
 \r
     EssData.Ia32.ExceptionTssDesc = ((UINT8 *)EssData.Ia32.GdtTable + OldGdtSize);\r
-    EssData.Ia32.ExceptionTss = ((UINT8 *)EssData.Ia32.GdtTable + OldGdtSize +\r
-                                 EssData.Ia32.ExceptionTssDescSize);\r
+    EssData.Ia32.ExceptionTss     = ((UINT8 *)EssData.Ia32.GdtTable + OldGdtSize +\r
+                                     EssData.Ia32.ExceptionTssDescSize);\r
 \r
     EssData.Ia32.KnownGoodStackTop = (UINTN)StackTop;\r
-    DEBUG ((DEBUG_INFO,\r
-            "Exception stack top[cpu%lu]: 0x%lX\n",\r
-            (UINT64)(UINTN)Index,\r
-            (UINT64)(UINTN)StackTop));\r
+    DEBUG ((\r
+      DEBUG_INFO,\r
+      "Exception stack top[cpu%lu]: 0x%lX\n",\r
+      (UINT64)(UINTN)Index,\r
+      (UINT64)(UINTN)StackTop\r
+      ));\r
 \r
     if (Index == Bsp) {\r
       InitializeExceptionStackSwitchHandlers (&EssData);\r
@@ -776,7 +779,7 @@ InitializeMpExceptionStackSwitchHandlers (
         );\r
     }\r
 \r
-    StackTop  -= NewStackSize;\r
+    StackTop -= NewStackSize;\r
   }\r
 }\r
 \r
@@ -815,9 +818,9 @@ InitializeMpSupport (
   VOID\r
   )\r
 {\r
-  EFI_STATUS     Status;\r
-  UINTN          NumberOfProcessors;\r
-  UINTN          NumberOfEnabledProcessors;\r
+  EFI_STATUS  Status;\r
+  UINTN       NumberOfProcessors;\r
+  UINTN       NumberOfEnabledProcessors;\r
 \r
   //\r
   // Wakeup APs to do initialization\r
@@ -841,9 +844,9 @@ InitializeMpSupport (
 \r
   Status = gBS->InstallMultipleProtocolInterfaces (\r
                   &mMpServiceHandle,\r
-                  &gEfiMpServiceProtocolGuid,  &mMpServicesTemplate,\r
+                  &gEfiMpServiceProtocolGuid,\r
+                  &mMpServicesTemplate,\r
                   NULL\r
                   );\r
   ASSERT_EFI_ERROR (Status);\r
 }\r
-\r