]> git.proxmox.com Git - mirror_edk2.git/commitdiff
UefiCpuPkg/CpuDxe: Remove unused codes and files
authorJeff Fan <jeff.fan@intel.com>
Fri, 29 Jul 2016 17:32:25 +0000 (01:32 +0800)
committerJeff Fan <jeff.fan@intel.com>
Wed, 17 Aug 2016 12:07:07 +0000 (20:07 +0800)
v5:
  1. Remove unused PcdCpuApStackSize and PcdCpuApInitTimeOutInMicroSeconds.

v4:
  1. Keep GDT table setup to fix IA32 S3 boot issue.

Cc: Michael Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
UefiCpuPkg/CpuDxe/ApStartup.c [deleted file]
UefiCpuPkg/CpuDxe/CpuDxe.h
UefiCpuPkg/CpuDxe/CpuDxe.inf
UefiCpuPkg/CpuDxe/CpuMp.c
UefiCpuPkg/CpuDxe/CpuMp.h
UefiCpuPkg/CpuDxe/Ia32/MpAsm.asm [deleted file]
UefiCpuPkg/CpuDxe/Ia32/MpAsm.nasm [deleted file]
UefiCpuPkg/CpuDxe/X64/MpAsm.asm [deleted file]
UefiCpuPkg/CpuDxe/X64/MpAsm.nasm [deleted file]

diff --git a/UefiCpuPkg/CpuDxe/ApStartup.c b/UefiCpuPkg/CpuDxe/ApStartup.c
deleted file mode 100644 (file)
index 78fb26f..0000000
+++ /dev/null
@@ -1,478 +0,0 @@
-/** @file\r
-  CPU DXE AP Startup\r
-\r
-  Copyright (c) 2008 - 2015, 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
-  http://opensource.org/licenses/bsd-license.php\r
-\r
-  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-\r
-**/\r
-\r
-#include "CpuDxe.h"\r
-#include "CpuGdt.h"\r
-#include "CpuMp.h"\r
-\r
-#pragma pack(1)\r
-\r
-typedef struct {\r
-  UINT8  MoveIa32EferMsrToEcx[5];\r
-  UINT8  ReadIa32EferMsr[2];\r
-  UINT8  SetExecuteDisableBitEnableBit[4];\r
-  UINT8  WriteIa32EferMsr[2];\r
-\r
-#if defined (MDE_CPU_IA32)\r
-  UINT8  MovEaxCr3;\r
-  UINT32 Cr3Value;\r
-  UINT8  MovCr3Eax[3];\r
-\r
-  UINT8  MoveCr4ToEax[3];\r
-  UINT8  SetCr4Bit5[4];\r
-  UINT8  MoveEaxToCr4[3];\r
-\r
-  UINT8  MoveCr0ToEax[3];\r
-  UINT8  SetCr0PagingBit[4];\r
-  UINT8  MoveEaxToCr0[3];\r
-#endif\r
-} ENABLE_EXECUTE_DISABLE_CODE;\r
-\r
-ENABLE_EXECUTE_DISABLE_CODE mEnableExecuteDisableCodeTemplate = {\r
-  { 0xB9, 0x80, 0x00, 0x00, 0xC0 },   // mov ecx, 0xc0000080\r
-  { 0x0F, 0x32 },                     // rdmsr\r
-  { 0x0F, 0xBA, 0xE8, 0x0B },         // bts eax, 11\r
-  { 0x0F, 0x30 },                     // wrmsr\r
-\r
-#if defined (MDE_CPU_IA32)\r
-  0xB8, 0x00000000,                   // mov eax, cr3 value\r
-  { 0x0F, 0x22, 0xd8 },               // mov cr3, eax\r
-\r
-  { 0x0F, 0x20, 0xE0 },               // mov eax, cr4\r
-  { 0x0F, 0xBA, 0xE8, 0x05 },         // bts eax, 5\r
-  { 0x0F, 0x22, 0xE0 },               // mov cr4, eax\r
-\r
-  { 0x0F, 0x20, 0xC0 },               // mov eax, cr0\r
-  { 0x0F, 0xBA, 0xE8, 0x1F },         // bts eax, 31\r
-  { 0x0F, 0x22, 0xC0 },               // mov cr0, eax\r
-#endif\r
-};\r
-\r
-typedef struct {\r
-  UINT8  JmpToCli[2];\r
-\r
-  UINT16 GdtLimit;\r
-  UINT32 GdtBase;\r
-\r
-  UINT8  Cli;\r
-\r
-  UINT8  MovAxRealSegment; UINT16 RealSegment;\r
-  UINT8  MovDsAx[2];\r
-\r
-  UINT8  MovBxGdtr[3];\r
-  UINT8  LoadGdt[5];\r
-\r
-  UINT8  MovEaxCr0[2];\r
-  UINT32 MovEaxCr0Value;\r
-  UINT8  MovCr0Eax[3];\r
-\r
-  UINT8  FarJmp32Flat[2]; UINT32 FlatJmpOffset; UINT16 FlatJmpSelector;\r
-\r
-  //\r
-  // Now in IA32\r
-  //\r
-  UINT8  MovEaxCr4;\r
-  UINT32 MovEaxCr4Value;\r
-  UINT8  MovCr4Eax[3];\r
-\r
-  UINT8  MoveDataSelectorIntoAx[2]; UINT16 FlatDataSelector;\r
-  UINT8  MoveFlatDataSelectorFromAxToDs[2];\r
-  UINT8  MoveFlatDataSelectorFromAxToEs[2];\r
-  UINT8  MoveFlatDataSelectorFromAxToFs[2];\r
-  UINT8  MoveFlatDataSelectorFromAxToGs[2];\r
-  UINT8  MoveFlatDataSelectorFromAxToSs[2];\r
-\r
-  //\r
-  // Code placeholder to enable PAE Execute Disable for IA32\r
-  // and enable Execute Disable Bit for X64\r
-  //\r
-  ENABLE_EXECUTE_DISABLE_CODE EnableExecuteDisable;\r
-\r
-#if defined (MDE_CPU_X64)\r
-  //\r
-  // Transition to X64\r
-  //\r
-  UINT8  MovEaxCr3;\r
-  UINT32 Cr3Value;\r
-  UINT8  MovCr3Eax[3];\r
-\r
-  UINT8  MoveCr4ToEax[3];\r
-  UINT8  SetCr4Bit5[4];\r
-  UINT8  MoveEaxToCr4[3];\r
-\r
-  UINT8  MoveLongModeEnableMsrToEcx[5];\r
-  UINT8  ReadLmeMsr[2];\r
-  UINT8  SetLongModeEnableBit[4];\r
-  UINT8  WriteLmeMsr[2];\r
-\r
-  UINT8  MoveCr0ToEax[3];\r
-  UINT8  SetCr0PagingBit[4];\r
-  UINT8  MoveEaxToCr0[3];\r
-  //UINT8  DeadLoop[2];\r
-\r
-  UINT8  FarJmp32LongMode; UINT32 LongJmpOffset; UINT16 LongJmpSelector;\r
-#endif // defined (MDE_CPU_X64)\r
-\r
-#if defined (MDE_CPU_X64)\r
-  UINT8  MovEaxOrRaxCpuDxeEntry[2]; UINTN CpuDxeEntryValue;\r
-#else\r
-  UINT8  MovEaxOrRaxCpuDxeEntry; UINTN CpuDxeEntryValue;\r
-#endif\r
-  UINT8  JmpToCpuDxeEntry[2];\r
-\r
-} STARTUP_CODE;\r
-\r
-#pragma pack()\r
-\r
-/**\r
-  This .asm code used for translating processor from 16 bit real mode into\r
-  64 bit long mode. which help to create the mStartupCodeTemplate value.\r
-\r
-  To assemble:\r
-    * nasm -o ApStartup ApStartup.asm\r
-    Then disassemble:\r
-    * ndisasm -b 16 ApStartup\r
-    * ndisasm -b 16 -e 6 ApStartup\r
-    * ndisasm -b 32 -e 32 ApStartup (This -e offset may need adjustment)\r
-    * ndisasm -b 64 -e 0x83 ApStartup (This -e offset may need adjustment)\r
-\r
-  %define DEFAULT_CR0  0x00000023\r
-  %define DEFAULT_CR4  0x640\r
-\r
-  BITS    16\r
-\r
-      jmp     short TransitionFromReal16To32BitFlat\r
-\r
-  ALIGN   2\r
-\r
-  Gdtr:\r
-      dw      0x5a5a\r
-      dd      0x5a5a5a5a\r
-\r
-  ;\r
-  ; Modified:  EAX, EBX\r
-  ;\r
-  TransitionFromReal16To32BitFlat:\r
-\r
-      cli\r
-      mov     ax, 0x5a5a\r
-      mov     ds, ax\r
-\r
-      mov     bx, Gdtr\r
-  o32 lgdt    [ds:bx]\r
-\r
-      mov     eax, cr4\r
-      btc     eax, 5\r
-      mov     cr4, eax\r
-\r
-      mov     eax, DEFAULT_CR0\r
-      mov     cr0, eax\r
-\r
-      jmp     0x5a5a:dword jumpTo32BitAndLandHere\r
-  BITS    32\r
-  jumpTo32BitAndLandHere:\r
-\r
-      mov     eax, DEFAULT_CR4\r
-      mov     cr4, eax\r
-\r
-      mov     ax, 0x5a5a\r
-      mov     ds, ax\r
-      mov     es, ax\r
-      mov     fs, ax\r
-      mov     gs, ax\r
-      mov     ss, ax\r
-\r
-  ;\r
-  ; Jump to CpuDxe for IA32\r
-  ;\r
-      mov     eax, 0x5a5a5a5a\r
-      or      eax, eax\r
-      jz      Transition32FlatTo64Flat\r
-      jmp     eax\r
-\r
-  ;\r
-  ; Transition to X64\r
-  ;\r
-  Transition32FlatTo64Flat:\r
-      mov     eax, 0x5a5a5a5a\r
-      mov     cr3, eax\r
-\r
-      mov     eax, cr4\r
-      bts     eax, 5                      ; enable PAE\r
-      mov     cr4, eax\r
-\r
-      mov     ecx, 0xc0000080\r
-      rdmsr\r
-      bts     eax, 8                      ; set LME\r
-      wrmsr\r
-\r
-      mov     eax, cr0\r
-      bts     eax, 31                     ; set PG\r
-      mov     cr0, eax                    ; enable paging\r
-\r
-  ;\r
-  ; Jump to CpuDxe for X64\r
-  ;\r
-      jmp     0x5a5a:jumpTo64BitAndLandHere\r
-  BITS    64\r
-  jumpTo64BitAndLandHere:\r
-      mov     rax, 0xcdcdcdcdcdcdcdcd\r
-      jmp     rax\r
-**/\r
-STARTUP_CODE mStartupCodeTemplate = {\r
-  { 0xeb, 0x06 },                     // Jump to cli\r
-  0,                                  // GDT Limit\r
-  0,                                  // GDT Base\r
-  0xfa,                               // cli (Clear Interrupts)\r
-  0xb8, 0x0000,                       // mov ax, RealSegment\r
-  { 0x8e, 0xd8 },                     // mov ds, ax\r
-  { 0xBB, 0x02, 0x00 },               // mov bx, Gdtr\r
-  { 0x3e, 0x66, 0x0f, 0x01, 0x17 },   // lgdt [ds:bx]\r
-  { 0x66, 0xB8 }, 0x00000023,         // mov eax, cr0 value\r
-  { 0x0F, 0x22, 0xC0 },               // mov cr0, eax\r
-  { 0x66, 0xEA },                     // far jmp to 32-bit flat\r
-        OFFSET_OF(STARTUP_CODE, MovEaxCr4),\r
-        LINEAR_CODE_SEL,\r
-  0xB8, 0x00000640,                   // mov eax, cr4 value\r
-  { 0x0F, 0x22, 0xe0 },               // mov cr4, eax\r
-  { 0x66, 0xb8 }, CPU_DATA_SEL,       // mov ax, FlatDataSelector\r
-  { 0x8e, 0xd8 },                     // mov ds, ax\r
-  { 0x8e, 0xc0 },                     // mov es, ax\r
-  { 0x8e, 0xe0 },                     // mov fs, ax\r
-  { 0x8e, 0xe8 },                     // mov gs, ax\r
-  { 0x8e, 0xd0 },                     // mov ss, ax\r
-\r
-#if defined (MDE_CPU_X64)\r
-  //\r
-  // Code placeholder to enable Execute Disable Bit for X64\r
-  // Default is all NOP - No Operation\r
-  //\r
-  {\r
-    { 0x90, 0x90, 0x90, 0x90, 0x90 },\r
-    { 0x90, 0x90 },\r
-    { 0x90, 0x90, 0x90, 0x90 },\r
-    { 0x90, 0x90 },\r
-  },\r
-\r
-  0xB8, 0x00000000,                   // mov eax, cr3 value\r
-  { 0x0F, 0x22, 0xd8 },               // mov cr3, eax\r
-\r
-  { 0x0F, 0x20, 0xE0 },               // mov eax, cr4\r
-  { 0x0F, 0xBA, 0xE8, 0x05 },         // bts eax, 5\r
-  { 0x0F, 0x22, 0xE0 },               // mov cr4, eax\r
-\r
-  { 0xB9, 0x80, 0x00, 0x00, 0xC0 },   // mov ecx, 0xc0000080\r
-  { 0x0F, 0x32 },                     // rdmsr\r
-  { 0x0F, 0xBA, 0xE8, 0x08 },         // bts eax, 8\r
-  { 0x0F, 0x30 },                     // wrmsr\r
-\r
-  { 0x0F, 0x20, 0xC0 },               // mov eax, cr0\r
-  { 0x0F, 0xBA, 0xE8, 0x1F },         // bts eax, 31\r
-  { 0x0F, 0x22, 0xC0 },               // mov cr0, eax\r
-\r
-  0xEA,                               // FarJmp32LongMode\r
-        OFFSET_OF(STARTUP_CODE, MovEaxOrRaxCpuDxeEntry),\r
-        LINEAR_CODE64_SEL,\r
-#else\r
-  //\r
-  // Code placeholder to enable PAE Execute Disable for IA32\r
-  // Default is all NOP - No Operation\r
-  //\r
-  {\r
-    { 0x90, 0x90, 0x90, 0x90, 0x90 },\r
-    { 0x90, 0x90 },\r
-    { 0x90, 0x90, 0x90, 0x90 },\r
-    { 0x90, 0x90 },\r
-\r
-    0x90, 0x90909090,\r
-    { 0x90, 0x90, 0x90 },\r
-\r
-    { 0x90, 0x90, 0x90 },\r
-    { 0x90, 0x90, 0x90, 0x90 },\r
-    { 0x90, 0x90, 0x90 },\r
-\r
-    { 0x90, 0x90, 0x90 },\r
-    { 0x90, 0x90, 0x90, 0x90 },\r
-    { 0x90, 0x90, 0x90 },\r
-  },\r
-#endif\r
-\r
-  //0xeb, 0xfe,       // jmp $\r
-#if defined (MDE_CPU_X64)\r
-  { 0x48, 0xb8 }, 0x0,                // mov rax, X64 CpuDxe MP Entry Point\r
-#else\r
-  0xB8, 0x0,                          // mov eax, IA32 CpuDxe MP Entry Point\r
-#endif\r
-  { 0xff, 0xe0 },                     // jmp to eax/rax (CpuDxe MP Entry Point)\r
-\r
-};\r
-\r
-volatile STARTUP_CODE *StartupCode = NULL;\r
-\r
-/**\r
-  The function will check if BSP Execute Disable is enabled.\r
-  DxeIpl may have enabled Execute Disable for BSP,\r
-  APs need to get the status and sync up the settings.\r
-\r
-  @retval TRUE      BSP Execute Disable is enabled.\r
-  @retval FALSE     BSP Execute Disable is not enabled.\r
-\r
-**/\r
-BOOLEAN\r
-IsBspExecuteDisableEnabled (\r
-  VOID\r
-  )\r
-{\r
-  UINT32            RegEax;\r
-  UINT32            RegEdx;\r
-  UINT64            MsrRegisters;\r
-  BOOLEAN           Enabled;\r
-\r
-  Enabled = FALSE;\r
-  AsmCpuid (0x80000000, &RegEax, NULL, NULL, NULL);\r
-  if (RegEax >= 0x80000001) {\r
-    AsmCpuid (0x80000001, NULL, NULL, NULL, &RegEdx);\r
-    //\r
-    // Cpuid 0x80000001\r
-    // Bit 20: Execute Disable Bit available.\r
-    //\r
-    if ((RegEdx & BIT20) != 0) {\r
-      MsrRegisters = AsmReadMsr64 (0xC0000080);\r
-      //\r
-      // Msr 0xC0000080\r
-      // Bit 11: Execute Disable Bit enable.\r
-      //\r
-      if ((MsrRegisters & BIT11) != 0) {\r
-        Enabled = TRUE;\r
-      }\r
-    }\r
-  }\r
-\r
-  return Enabled;\r
-}\r
-\r
-/**\r
-  Prepares Startup Code for APs.\r
-  This function prepares Startup Code for APs.\r
-\r
-  @retval EFI_SUCCESS           The APs were started\r
-  @retval EFI_OUT_OF_RESOURCES  Cannot allocate memory to start APs\r
-\r
-**/\r
-EFI_STATUS\r
-PrepareAPStartupCode (\r
-  VOID\r
-  )\r
-{\r
-  EFI_STATUS            Status;\r
-  IA32_DESCRIPTOR       Gdtr;\r
-  EFI_PHYSICAL_ADDRESS  StartAddress;\r
-\r
-  StartAddress = BASE_1MB;\r
-  Status = gBS->AllocatePages (\r
-                  AllocateMaxAddress,\r
-                  EfiACPIMemoryNVS,\r
-                  EFI_SIZE_TO_PAGES (sizeof (*StartupCode)),\r
-                  &StartAddress\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  StartupCode = (STARTUP_CODE*)(VOID*)(UINTN) StartAddress;\r
-  CopyMem ((VOID*) StartupCode, &mStartupCodeTemplate, sizeof (*StartupCode));\r
-  StartupCode->RealSegment = (UINT16) (((UINTN) StartAddress) >> 4);\r
-\r
-  AsmReadGdtr (&Gdtr);\r
-  StartupCode->GdtLimit = Gdtr.Limit;\r
-  StartupCode->GdtBase = (UINT32) Gdtr.Base;\r
-\r
-  StartupCode->CpuDxeEntryValue = (UINTN) AsmApEntryPoint;\r
-\r
-  StartupCode->FlatJmpOffset += (UINT32) StartAddress;\r
-\r
-  if (IsBspExecuteDisableEnabled ()) {\r
-    CopyMem (\r
-      (VOID*) &StartupCode->EnableExecuteDisable,\r
-      &mEnableExecuteDisableCodeTemplate,\r
-      sizeof (ENABLE_EXECUTE_DISABLE_CODE)\r
-      );\r
-  }\r
-#if defined (MDE_CPU_X64)\r
-  StartupCode->Cr3Value = (UINT32) AsmReadCr3 ();\r
-  StartupCode->LongJmpOffset += (UINT32) StartAddress;\r
-#else\r
-  StartupCode->EnableExecuteDisable.Cr3Value = (UINT32) AsmReadCr3 ();\r
-#endif\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Free the code buffer of startup AP.\r
-\r
-**/\r
-VOID\r
-FreeApStartupCode (\r
-  VOID\r
-  )\r
-{\r
-  if (StartupCode != NULL) {\r
-    gBS->FreePages ((EFI_PHYSICAL_ADDRESS)(UINTN)(VOID*) StartupCode,\r
-                    EFI_SIZE_TO_PAGES (sizeof (*StartupCode)));\r
-  }\r
-}\r
-\r
-\r
-/**\r
-  Starts the Application Processors and directs them to jump to the\r
-  specified routine.\r
-\r
-  The processor jumps to this code in flat mode, but the processor's\r
-  stack is not initialized.\r
-\r
-  @retval EFI_SUCCESS           The APs were started\r
-\r
-**/\r
-EFI_STATUS\r
-StartApsStackless (\r
-  VOID\r
-  )\r
-{\r
-  SendInitSipiSipiAllExcludingSelf ((UINT32)(UINTN)(VOID*) StartupCode);\r
-  //\r
-  // Wait for APs to arrive at the ApEntryPoint routine\r
-  //\r
-  MicroSecondDelay (PcdGet32 (PcdCpuApInitTimeOutInMicroSeconds));\r
-\r
-  return EFI_SUCCESS;\r
-}\r
-\r
-/**\r
-  Resets the Application Processor and directs it to jump to the\r
-  specified routine.\r
-\r
-  The processor jumps to this code in flat mode, but the processor's\r
-  stack is not initialized.\r
-\r
-  @param ProcessorId           the AP of ProcessorId was reset\r
-**/\r
-VOID\r
-ResetApStackless (\r
-  IN UINT32 ProcessorId\r
-  )\r
-{\r
-  SendInitSipiSipi (ProcessorId,\r
-                    (UINT32)(UINTN)(VOID*) StartupCode);\r
-}\r
index 00d1a8f130c39b32c5c6cb3e7d8e7ee3425763cc..6dd0ad3f01f273d2c3e627d641dd2411b0e786cf 100644 (file)
@@ -36,7 +36,6 @@
 #include <Library/UefiCpuLib.h>\r
 #include <Library/UefiLib.h>\r
 #include <Library/CpuExceptionHandlerLib.h>\r
-#include <Library/TimerLib.h>\r
 #include <Library/HobLib.h>\r
 #include <Library/ReportStatusCodeLib.h>\r
 #include <Library/MpInitLib.h>\r
index 0643bec5d28a3c5b021a0a9d67c1c718cd416c46..0adb66b032e607e359fc07dded24e10321be685d 100644 (file)
@@ -46,7 +46,6 @@
   MpInitLib\r
 \r
 [Sources]\r
-  ApStartup.c\r
   CpuDxe.c\r
   CpuDxe.h\r
   CpuGdt.c\r
   Ia32/CpuAsm.asm\r
   Ia32/CpuAsm.nasm\r
   Ia32/CpuAsm.S\r
-  Ia32/MpAsm.asm\r
-  Ia32/MpAsm.nasm\r
 \r
 [Sources.X64]\r
   X64/CpuAsm.asm\r
   X64/CpuAsm.nasm\r
   X64/CpuAsm.S\r
-  X64/MpAsm.asm\r
-  X64/MpAsm.nasm\r
 \r
 [Protocols]\r
   gEfiCpuArchProtocolGuid                       ## PRODUCES\r
@@ -82,8 +77,6 @@
 \r
 [Pcd]\r
   gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber    ## CONSUMES\r
-  gUefiCpuPkgTokenSpaceGuid.PcdCpuApStackSize                  ## CONSUMES\r
-  gUefiCpuPkgTokenSpaceGuid.PcdCpuApInitTimeOutInMicroSeconds  ## CONSUMES\r
 \r
 [Depex]\r
   TRUE\r
index 8f7a56c40daa2bbb1559061f9871d5859571f124..efab78c83de0cf19c17fe3f39876cd8bc0fdbf4c 100644 (file)
 #include "CpuDxe.h"\r
 #include "CpuMp.h"\r
 \r
-UINTN gMaxLogicalProcessorNumber;\r
-UINTN gApStackSize;\r
-UINTN gPollInterval = 100; // 100 microseconds\r
-\r
-MP_SYSTEM_DATA mMpSystemData;\r
 EFI_HANDLE     mMpServiceHandle       = NULL;\r
 UINTN          mNumberOfProcessors    = 1;\r
-EFI_EVENT      mExitBootServicesEvent = (EFI_EVENT)NULL;\r
-\r
-VOID *mCommonStack = 0;\r
-VOID *mTopOfApCommonStack = 0;\r
-VOID *mApStackStart = 0;\r
-\r
-volatile BOOLEAN mAPsAlreadyInitFinished = FALSE;\r
 \r
 EFI_MP_SERVICES_PROTOCOL  mMpServicesTemplate = {\r
   GetNumberOfProcessors,\r
@@ -40,372 +28,6 @@ EFI_MP_SERVICES_PROTOCOL  mMpServicesTemplate = {
   WhoAmI\r
 };\r
 \r
-/**\r
-   Get Mp Service Lock.\r
-\r
-  @param   CpuData    the pointer to CPU_DATA_BLOCK of specified processor\r
-\r
-**/\r
-VOID\r
-GetMpSpinLock (\r
-  IN  CPU_DATA_BLOCK  *CpuData\r
-  )\r
-{\r
-  while (!AcquireSpinLockOrFail (&CpuData->CpuDataLock)) {\r
-    CpuPause ();\r
-  }\r
-  CpuData->LockSelf = GetApicId ();\r
-}\r
-\r
-/**\r
-   Release Mp Service Lock.\r
-\r
-  @param   CpuData    the pointer to CPU_DATA_BLOCK of specified processor\r
-\r
-**/\r
-VOID\r
-ReleaseMpSpinLock (\r
-  IN  CPU_DATA_BLOCK  *CpuData\r
-  )\r
-{\r
-  ReleaseSpinLock (&CpuData->CpuDataLock);\r
-}\r
-\r
-/**\r
-  Check whether caller processor is BSP.\r
-\r
-  @retval  TRUE       the caller is BSP\r
-  @retval  FALSE      the caller is AP\r
-\r
-**/\r
-BOOLEAN\r
-IsBSP (\r
-  VOID\r
-  )\r
-{\r
-  UINTN           CpuIndex;\r
-  CPU_DATA_BLOCK  *CpuData;\r
-\r
-  CpuData = NULL;\r
-\r
-  WhoAmI (&mMpServicesTemplate, &CpuIndex);\r
-  CpuData = &mMpSystemData.CpuDatas[CpuIndex];\r
-\r
-  return CpuData->Info.StatusFlag & PROCESSOR_AS_BSP_BIT ? TRUE : FALSE;\r
-}\r
-\r
-/**\r
-  Get the Application Processors state.\r
-\r
-  @param   CpuData    the pointer to CPU_DATA_BLOCK of specified AP\r
-\r
-  @retval  CPU_STATE  the AP status\r
-\r
-**/\r
-STATIC\r
-CPU_STATE\r
-GetApState (\r
-  IN  CPU_DATA_BLOCK  *CpuData\r
-  )\r
-{\r
-  CPU_STATE State;\r
-\r
-  GetMpSpinLock (CpuData);\r
-  State = CpuData->State;\r
-  ReleaseMpSpinLock (CpuData);\r
-\r
-  return State;\r
-}\r
-\r
-/**\r
-  Set the Application Processors state.\r
-\r
-  @param   CpuData    The pointer to CPU_DATA_BLOCK of specified AP\r
-  @param   State      The AP status\r
-\r
-**/\r
-STATIC\r
-VOID\r
-SetApState (\r
-  IN  CPU_DATA_BLOCK   *CpuData,\r
-  IN  CPU_STATE        State\r
-  )\r
-{\r
-  GetMpSpinLock (CpuData);\r
-  CpuData->State = State;\r
-  ReleaseMpSpinLock (CpuData);\r
-}\r
-\r
-/**\r
-  Set the Application Processor prepare to run a function specified\r
-  by Params.\r
-\r
-  @param CpuData           the pointer to CPU_DATA_BLOCK of specified AP\r
-  @param Procedure         A pointer to the function to be run on enabled APs of the system\r
-  @param ProcedureArgument Pointer to the optional parameter of the assigned function\r
-\r
-**/\r
-VOID\r
-SetApProcedure (\r
-  IN   CPU_DATA_BLOCK        *CpuData,\r
-  IN   EFI_AP_PROCEDURE      Procedure,\r
-  IN   VOID                  *ProcedureArgument\r
-  )\r
-{\r
-  GetMpSpinLock (CpuData);\r
-  CpuData->Parameter  = ProcedureArgument;\r
-  CpuData->Procedure  = Procedure;\r
-  ReleaseMpSpinLock (CpuData);\r
-}\r
-\r
-/**\r
-  Check the Application Processors Status whether contains the Flags.\r
-\r
-  @param     CpuData  the pointer to CPU_DATA_BLOCK of specified AP\r
-  @param     Flags    the StatusFlag describing in EFI_PROCESSOR_INFORMATION\r
-\r
-  @retval    TRUE     the AP status includes the StatusFlag\r
-  @retval    FALSE    the AP status excludes the StatusFlag\r
-\r
-**/\r
-BOOLEAN\r
-TestCpuStatusFlag (\r
-  IN  CPU_DATA_BLOCK  *CpuData,\r
-  IN  UINT32          Flags\r
-  )\r
-{\r
-  UINT32 Ret;\r
-\r
-  GetMpSpinLock (CpuData);\r
-  Ret = CpuData->Info.StatusFlag & Flags;\r
-  ReleaseMpSpinLock (CpuData);\r
-\r
-  return (BOOLEAN) (Ret != 0);\r
-}\r
-\r
-/**\r
-  Bitwise-Or of the Application Processors Status with the Flags.\r
-\r
-  @param     CpuData  the pointer to CPU_DATA_BLOCK of specified AP\r
-  @param     Flags    the StatusFlag describing in EFI_PROCESSOR_INFORMATION\r
-\r
-**/\r
-VOID\r
-CpuStatusFlagOr (\r
-  IN  CPU_DATA_BLOCK  *CpuData,\r
-  IN  UINT32          Flags\r
-  )\r
-{\r
-  GetMpSpinLock (CpuData);\r
-  CpuData->Info.StatusFlag |= Flags;\r
-  ReleaseMpSpinLock (CpuData);\r
-}\r
-\r
-/**\r
-  Bitwise-AndNot of the Application Processors Status with the Flags.\r
-\r
-  @param     CpuData  the pointer to CPU_DATA_BLOCK of specified AP\r
-  @param     Flags    the StatusFlag describing in EFI_PROCESSOR_INFORMATION\r
-\r
-**/\r
-VOID\r
-CpuStatusFlagAndNot (\r
-  IN  CPU_DATA_BLOCK  *CpuData,\r
-  IN  UINT32          Flags\r
-  )\r
-{\r
-  GetMpSpinLock (CpuData);\r
-  CpuData->Info.StatusFlag &= ~Flags;\r
-  ReleaseMpSpinLock (CpuData);\r
-}\r
-\r
-/**\r
-  Searches for the next blocking AP.\r
-\r
-  Search for the next AP that is put in blocking state by single-threaded StartupAllAPs().\r
-\r
-  @param  NextNumber           Pointer to the processor number of the next blocking AP.\r
-\r
-  @retval EFI_SUCCESS          The next blocking AP has been found.\r
-  @retval EFI_NOT_FOUND        No blocking AP exists.\r
-\r
-**/\r
-EFI_STATUS\r
-GetNextBlockedNumber (\r
-  OUT UINTN  *NextNumber\r
-  )\r
-{\r
-  UINTN                 Number;\r
-  CPU_STATE             CpuState;\r
-  CPU_DATA_BLOCK        *CpuData;\r
-\r
-  for (Number = 0; Number < mMpSystemData.NumberOfProcessors; Number++) {\r
-    CpuData = &mMpSystemData.CpuDatas[Number];\r
-    if (TestCpuStatusFlag (CpuData, PROCESSOR_AS_BSP_BIT)) {\r
-      //\r
-      // Skip BSP\r
-      //\r
-      continue;\r
-    }\r
-\r
-    CpuState = GetApState (CpuData);\r
-    if (CpuState == CpuStateBlocked) {\r
-      *NextNumber = Number;\r
-      return EFI_SUCCESS;\r
-    }\r
-  }\r
-\r
-  return EFI_NOT_FOUND;\r
-}\r
-\r
-/**\r
-  Check if the APs state are finished, and update them to idle state\r
-  by StartupAllAPs().\r
-\r
-**/\r
-VOID\r
-CheckAndUpdateAllAPsToIdleState (\r
-  VOID\r
-  )\r
-{\r
-  UINTN                 ProcessorNumber;\r
-  UINTN                 NextNumber;\r
-  CPU_DATA_BLOCK        *CpuData;\r
-  EFI_STATUS            Status;\r
-  CPU_STATE             CpuState;\r
-\r
-  for (ProcessorNumber = 0; ProcessorNumber < mMpSystemData.NumberOfProcessors; ProcessorNumber++) {\r
-    CpuData = &mMpSystemData.CpuDatas[ProcessorNumber];\r
-    if (TestCpuStatusFlag (CpuData, PROCESSOR_AS_BSP_BIT)) {\r
-      //\r
-      // Skip BSP\r
-      //\r
-      continue;\r
-    }\r
-\r
-    if (!TestCpuStatusFlag (CpuData, PROCESSOR_ENABLED_BIT)) {\r
-      //\r
-      // Skip Disabled processors\r
-      //\r
-      continue;\r
-    }\r
-\r
-    CpuState = GetApState (CpuData);\r
-    if (CpuState == CpuStateFinished) {\r
-      mMpSystemData.FinishCount++;\r
-      if (mMpSystemData.SingleThread) {\r
-        Status = GetNextBlockedNumber (&NextNumber);\r
-        if (!EFI_ERROR (Status)) {\r
-          SetApState (&mMpSystemData.CpuDatas[NextNumber], CpuStateReady);\r
-          SetApProcedure (&mMpSystemData.CpuDatas[NextNumber],\r
-                          mMpSystemData.Procedure,\r
-                          mMpSystemData.ProcedureArgument);\r
-          //\r
-          // If this AP previous state is blocked, we should\r
-          // wake up this AP by sent a SIPI. and avoid\r
-          // re-involve the sleeping state. we must call\r
-          // SetApProcedure() first.\r
-          //\r
-          ResetProcessorToIdleState (&mMpSystemData.CpuDatas[NextNumber]);\r
-        }\r
-      }\r
-      SetApState (CpuData, CpuStateIdle);\r
-    }\r
-  }\r
-}\r
-\r
-/**\r
-  Check if all APs are in state CpuStateSleeping.\r
-\r
-  Return TRUE if all APs are in the CpuStateSleeping state.  Do not\r
-  check the state of the BSP or any disabled APs.\r
-\r
-  @retval TRUE   All APs are in CpuStateSleeping state.\r
-  @retval FALSE  One or more APs are not in CpuStateSleeping state.\r
-\r
-**/\r
-BOOLEAN\r
-CheckAllAPsSleeping (\r
-  VOID\r
-  )\r
-{\r
-  UINTN           ProcessorNumber;\r
-  CPU_DATA_BLOCK  *CpuData;\r
-\r
-  for (ProcessorNumber = 0; ProcessorNumber < mMpSystemData.NumberOfProcessors; ProcessorNumber++) {\r
-    CpuData = &mMpSystemData.CpuDatas[ProcessorNumber];\r
-    if (TestCpuStatusFlag (CpuData, PROCESSOR_AS_BSP_BIT)) {\r
-      //\r
-      // Skip BSP\r
-      //\r
-      continue;\r
-    }\r
-\r
-    if (!TestCpuStatusFlag (CpuData, PROCESSOR_ENABLED_BIT)) {\r
-      //\r
-      // Skip Disabled processors\r
-      //\r
-      continue;\r
-    }\r
-\r
-    if (GetApState (CpuData) != CpuStateSleeping) {\r
-      return FALSE;\r
-    }\r
-  }\r
-  return TRUE;\r
-}\r
-\r
-/**\r
-  If the timeout expires before all APs returns from Procedure,\r
-  we should forcibly terminate the executing AP and fill FailedList back\r
-  by StartupAllAPs().\r
-\r
-**/\r
-VOID\r
-ResetAllFailedAPs (\r
-  VOID\r
-  )\r
-{\r
-  CPU_DATA_BLOCK        *CpuData;\r
-  UINTN                 Number;\r
-  CPU_STATE             CpuState;\r
-\r
-  if (mMpSystemData.FailedList != NULL) {\r
-     *mMpSystemData.FailedList = AllocatePool ((mMpSystemData.StartCount - mMpSystemData.FinishCount + 1) * sizeof(UINTN));\r
-     ASSERT (*mMpSystemData.FailedList != NULL);\r
-  }\r
-\r
-  for (Number = 0; Number < mMpSystemData.NumberOfProcessors; Number++) {\r
-    CpuData = &mMpSystemData.CpuDatas[Number];\r
-    if (TestCpuStatusFlag (CpuData,  PROCESSOR_AS_BSP_BIT)) {\r
-      //\r
-      // Skip BSP\r
-      //\r
-      continue;\r
-    }\r
-\r
-    if (!TestCpuStatusFlag (CpuData, PROCESSOR_ENABLED_BIT)) {\r
-      //\r
-      // Skip Disabled processors\r
-      //\r
-      continue;\r
-    }\r
-\r
-    CpuState = GetApState (CpuData);\r
-    if (CpuState != CpuStateIdle &&\r
-        CpuState != CpuStateSleeping) {\r
-      if (mMpSystemData.FailedList != NULL) {\r
-        (*mMpSystemData.FailedList)[mMpSystemData.FailedListIndex++] = Number;\r
-      }\r
-      ResetProcessorToIdleState (CpuData);\r
-    }\r
-  }\r
-\r
-  if (mMpSystemData.FailedList != NULL) {\r
-    (*mMpSystemData.FailedList)[mMpSystemData.FailedListIndex] = END_OF_CPU_LIST;\r
-  }\r
-}\r
-\r
 /**\r
   This service retrieves the number of logical processor in the platform\r
   and the number of those logical processors that are enabled on this boot.\r
@@ -978,28 +600,6 @@ CollectBistDataFromHob (
   }\r
 }\r
 \r
-/**\r
-  Callback function for ExitBootServices.\r
-\r
-  @param  Event                 Event whose notification function is being invoked.\r
-  @param  Context               The pointer to the notification function's context,\r
-                                which is implementation-dependent.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-ExitBootServicesCallback (\r
-  IN EFI_EVENT                Event,\r
-  IN VOID                     *Context\r
-  )\r
-{\r
-  //\r
-  // Avoid APs access invalid buff datas which allocated by BootServices,\r
-  // so we send INIT IPI to APs to let them wait for SIPI state.\r
-  //\r
-  SendInitIpiAllExcludingSelf ();\r
-}\r
-\r
 /**\r
   Initialize Multi-processor support.\r
 \r
index 1e204f34565bbaa58b1084c4f5883979bf88038f..43ec3bdd0b86c426cb44e05868a48120b8084fef 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   CPU DXE MP support\r
 \r
-  Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2016, 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
 #ifndef _CPU_MP_H_\r
 #define _CPU_MP_H_\r
 \r
-#include <Ppi/SecPlatformInformation.h>\r
-#include <Ppi/SecPlatformInformation2.h>\r
-#include <Protocol/MpService.h>\r
-#include <Library/SynchronizationLib.h>\r
-\r
 /**\r
   Initialize Multi-processor support.\r
 \r
@@ -29,120 +24,6 @@ InitializeMpSupport (
   VOID\r
   );\r
 \r
-typedef\r
-VOID\r
-(EFIAPI *STACKLESS_AP_ENTRY_POINT)(\r
-  VOID\r
-  );\r
-\r
-/**\r
-  Starts the Application Processors and directs them to jump to the\r
-  specified routine.\r
-\r
-  The processor jumps to this code in flat mode, but the processor's\r
-  stack is not initialized.\r
-\r
-  @retval EFI_SUCCESS           The APs were started\r
-\r
-**/\r
-EFI_STATUS\r
-StartApsStackless (\r
-  VOID\r
-  );\r
-\r
-/**\r
-  The AP entry point that the Startup-IPI target code will jump to.\r
-\r
-  The processor jumps to this code in flat mode, but the processor's\r
-  stack is not initialized.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmApEntryPoint (\r
-  VOID\r
-  );\r
-\r
-/**\r
-  Releases the lock preventing other APs from using the shared AP\r
-  stack.\r
-\r
-  Once the AP has transitioned to using a new stack, it can call this\r
-  function to allow another AP to proceed with using the shared stack.\r
-\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmApDoneWithCommonStack (\r
-  VOID\r
-  );\r
-\r
-typedef enum {\r
-  CpuStateIdle,\r
-  CpuStateBlocked,\r
-  CpuStateReady,\r
-  CpuStateBusy,\r
-  CpuStateFinished,\r
-  CpuStateSleeping\r
-} CPU_STATE;\r
-\r
-/**\r
-  Define Individual Processor Data block.\r
-\r
-**/\r
-typedef struct {\r
-  EFI_PROCESSOR_INFORMATION      Info;\r
-  SPIN_LOCK                      CpuDataLock;\r
-  INTN                           LockSelf;\r
-  volatile CPU_STATE             State;\r
-\r
-  volatile EFI_AP_PROCEDURE      Procedure;\r
-  volatile VOID*                 Parameter;\r
-  BOOLEAN                        *Finished;\r
-  INTN                           Timeout;\r
-  EFI_EVENT                      WaitEvent;\r
-  BOOLEAN                        TimeoutActive;\r
-  EFI_EVENT                      CheckThisAPEvent;\r
-  VOID                           *TopOfStack;\r
-} CPU_DATA_BLOCK;\r
-\r
-/**\r
-  Define MP data block which consumes individual processor block.\r
-\r
-**/\r
-typedef struct {\r
-  CPU_DATA_BLOCK              *CpuDatas;\r
-  UINTN                       NumberOfProcessors;\r
-  UINTN                       NumberOfEnabledProcessors;\r
-\r
-  EFI_AP_PROCEDURE            Procedure;\r
-  VOID                        *ProcedureArgument;\r
-  UINTN                       StartCount;\r
-  UINTN                       FinishCount;\r
-  BOOLEAN                     SingleThread;\r
-  UINTN                       **FailedList;\r
-  UINTN                       FailedListIndex;\r
-  INTN                        Timeout;\r
-  EFI_EVENT                   WaitEvent;\r
-  BOOLEAN                     TimeoutActive;\r
-  EFI_EVENT                   CheckAllAPsEvent;\r
-} MP_SYSTEM_DATA;\r
-\r
-/**\r
-  This function is called by all processors (both BSP and AP) once and collects MP related data.\r
-\r
-  @param Bsp             TRUE if the CPU is BSP\r
-  @param ProcessorNumber The specific processor number\r
-\r
-  @retval EFI_SUCCESS    Data for the processor collected and filled in\r
-\r
-**/\r
-EFI_STATUS\r
-FillInProcessorInformation (\r
-  IN     BOOLEAN              Bsp,\r
-  IN     UINTN                ProcessorNumber\r
-  );\r
-\r
 /**\r
   This service retrieves the number of logical processor in the platform\r
   and the number of those logical processors that are enabled on this boot.\r
@@ -591,68 +472,5 @@ WhoAmI (
   OUT UINTN                    *ProcessorNumber\r
   );\r
 \r
-/**\r
-  Terminate AP's task and set it to idle state.\r
-\r
-  This function terminates AP's task due to timeout by sending INIT-SIPI,\r
-  and sends it to idle state.\r
-\r
-  @param CpuData           the pointer to CPU_DATA_BLOCK of specified AP\r
-\r
-**/\r
-VOID\r
-ResetProcessorToIdleState (\r
-  IN CPU_DATA_BLOCK  *CpuData\r
-  );\r
-\r
-/**\r
-  Prepares Startup Code for APs.\r
-  This function prepares Startup Code for APs.\r
-\r
-  @retval EFI_SUCCESS           The APs were started\r
-  @retval EFI_OUT_OF_RESOURCES  Cannot allocate memory to start APs\r
-\r
-**/\r
-EFI_STATUS\r
-PrepareAPStartupCode (\r
-  VOID\r
-  );\r
-\r
-/**\r
-  Free the code buffer of startup AP.\r
-\r
-**/\r
-VOID\r
-FreeApStartupCode (\r
-  VOID\r
-  );\r
-\r
-/**\r
-  Resets the Application Processor and directs it to jump to the\r
-  specified routine.\r
-\r
-  The processor jumps to this code in flat mode, but the processor's\r
-  stack is not initialized.\r
-\r
-  @param ProcessorId           the AP of ProcessorId was reset\r
-**/\r
-VOID\r
-ResetApStackless (\r
-  IN UINT32 ProcessorId\r
-  );\r
-\r
-/**\r
-  A minimal wrapper function that allows MtrrSetAllMtrrs() to be passed to\r
-  EFI_MP_SERVICES_PROTOCOL.StartupAllAPs() as Procedure.\r
-\r
-  @param[in] Buffer  Pointer to an MTRR_SETTINGS object, to be passed to\r
-                     MtrrSetAllMtrrs().\r
-**/\r
-VOID\r
-EFIAPI\r
-SetMtrrsFromBuffer (\r
-  IN VOID *Buffer\r
-  );\r
-\r
 #endif // _CPU_MP_H_\r
 \r
diff --git a/UefiCpuPkg/CpuDxe/Ia32/MpAsm.asm b/UefiCpuPkg/CpuDxe/Ia32/MpAsm.asm
deleted file mode 100644 (file)
index 09579f2..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006 - 2014, 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
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-.686\r
-.xmm\r
-.model flat, C\r
-\r
-extern mTopOfApCommonStack:DWORD\r
-extern ApEntryPointInC:PROC\r
-\r
-.code\r
-\r
-;\r
-; This lock only allows one AP to use the mTopOfApCommonStack stack at a time\r
-;\r
-ApStackLock dd      0\r
-\r
-;.code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; AsmApEntryPoint (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmApEntryPoint PROC\r
-\r
-    cli\r
-AsmApEntryPointAcquireLock:\r
-lock bts    dword ptr [ApStackLock], 0\r
-    pause\r
-    jc      AsmApEntryPointAcquireLock\r
-\r
-    mov     esp, [mTopOfApCommonStack]\r
-    call    ApEntryPointInC\r
-\r
-    cli\r
-\r
-lock btc    dword ptr [ApStackLock], 0\r
-\r
-    mov     eax, 100h\r
-AsmApEntryPointShareLock:\r
-    pause\r
-    dec     eax\r
-    jnz     AsmApEntryPointShareLock\r
-\r
-    jmp     AsmApEntryPoint\r
-\r
-AsmApEntryPoint ENDP\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; AsmApDoneWithCommonStack (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-AsmApDoneWithCommonStack PROC PUBLIC\r
-\r
-lock btc    dword ptr [ApStackLock], 0\r
-    ret\r
-\r
-AsmApDoneWithCommonStack ENDP\r
-\r
-END\r
diff --git a/UefiCpuPkg/CpuDxe/Ia32/MpAsm.nasm b/UefiCpuPkg/CpuDxe/Ia32/MpAsm.nasm
deleted file mode 100644 (file)
index c47cdce..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006 - 2014, 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
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-extern ASM_PFX(mTopOfApCommonStack)\r
-extern ASM_PFX(ApEntryPointInC)\r
-\r
-SECTION .data\r
-\r
-;\r
-; This lock only allows one AP to use the mTopOfApCommonStack stack at a time\r
-;\r
-ApStackLock:\r
-    dd      0\r
-\r
-SECTION .text\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; AsmApEntryPoint (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-global ASM_PFX(AsmApEntryPoint)\r
-ASM_PFX(AsmApEntryPoint):\r
-    cli\r
-AsmApEntryPointAcquireLock:\r
-lock bts    dword [ApStackLock], 0\r
-    pause\r
-    jc      AsmApEntryPointAcquireLock\r
-\r
-    mov     esp, [ASM_PFX(mTopOfApCommonStack)]\r
-    call    ASM_PFX(ApEntryPointInC)\r
-\r
-    cli\r
-\r
-lock btc    dword [ApStackLock], 0\r
-\r
-    mov     eax, 0x100\r
-AsmApEntryPointShareLock:\r
-    pause\r
-    dec     eax\r
-    jnz     AsmApEntryPointShareLock\r
-\r
-    jmp     ASM_PFX(AsmApEntryPoint)\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; AsmApDoneWithCommonStack (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-global ASM_PFX(AsmApDoneWithCommonStack)\r
-ASM_PFX(AsmApDoneWithCommonStack):\r
-lock btc    dword [ApStackLock], 0\r
-    ret\r
-\r
diff --git a/UefiCpuPkg/CpuDxe/X64/MpAsm.asm b/UefiCpuPkg/CpuDxe/X64/MpAsm.asm
deleted file mode 100644 (file)
index 308de51..0000000
+++ /dev/null
@@ -1,76 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006 - 2014, 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
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-#include <Base.h>\r
-\r
-extern ASM_PFX(mTopOfApCommonStack):QWORD\r
-extern ASM_PFX(ApEntryPointInC):PROC\r
-\r
-.data\r
-\r
-;\r
-; This lock only allows one AP to use the mTopOfApCommonStack stack at a time\r
-;\r
-ApStackLock:\r
-    dd      0\r
-\r
-.code\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; AsmApEntryPoint (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-ASM_PFX(AsmApEntryPoint) PROC PUBLIC\r
-\r
-    cli\r
-AsmApEntryPointAcquireLock:\r
-lock bts    dword ptr [ApStackLock], 0\r
-    pause\r
-    jc      AsmApEntryPointAcquireLock\r
-\r
-    mov     rsp, [ASM_PFX(mTopOfApCommonStack)]\r
-    call    ASM_PFX(ApEntryPointInC)\r
-\r
-    cli\r
-\r
-lock btc    dword ptr [ApStackLock], 0\r
-\r
-    mov     eax, 100h\r
-AsmApEntryPointShareLock:\r
-    pause\r
-    dec     eax\r
-    jnz     AsmApEntryPointShareLock\r
-\r
-    jmp     ASM_PFX(AsmApEntryPoint)\r
-\r
-ASM_PFX(AsmApEntryPoint) ENDP\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; AsmApDoneWithCommonStack (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-ASM_PFX(AsmApDoneWithCommonStack) PROC PUBLIC\r
-\r
-lock btc    dword ptr [ApStackLock], 0\r
-    ret\r
-\r
-ASM_PFX(AsmApDoneWithCommonStack) ENDP\r
-\r
-END\r
-\r
diff --git a/UefiCpuPkg/CpuDxe/X64/MpAsm.nasm b/UefiCpuPkg/CpuDxe/X64/MpAsm.nasm
deleted file mode 100644 (file)
index e3dc248..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-;------------------------------------------------------------------------------\r
-;\r
-; Copyright (c) 2006 - 2014, 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
-; http://opensource.org/licenses/bsd-license.php.\r
-;\r
-; THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-; WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
-;\r
-;------------------------------------------------------------------------------\r
-\r
-extern ASM_PFX(mTopOfApCommonStack)\r
-extern ASM_PFX(ApEntryPointInC)\r
-\r
-DEFAULT REL\r
-\r
-SECTION .data\r
-\r
-;\r
-; This lock only allows one AP to use the mTopOfApCommonStack stack at a time\r
-;\r
-ApStackLock:\r
-    dd      0\r
-\r
-SECTION .text\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; AsmApEntryPoint (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-global ASM_PFX(AsmApEntryPoint)\r
-ASM_PFX(AsmApEntryPoint):\r
-    cli\r
-AsmApEntryPointAcquireLock:\r
-lock bts    dword [ApStackLock], 0\r
-    pause\r
-    jc      AsmApEntryPointAcquireLock\r
-\r
-    mov     rsp, [ASM_PFX(mTopOfApCommonStack)]\r
-    call    ASM_PFX(ApEntryPointInC)\r
-\r
-    cli\r
-\r
-lock btc    dword [ApStackLock], 0\r
-\r
-    mov     eax, 0x100\r
-AsmApEntryPointShareLock:\r
-    pause\r
-    dec     eax\r
-    jnz     AsmApEntryPointShareLock\r
-\r
-    jmp     ASM_PFX(AsmApEntryPoint)\r
-\r
-;------------------------------------------------------------------------------\r
-; VOID\r
-; EFIAPI\r
-; AsmApDoneWithCommonStack (\r
-;   VOID\r
-;   );\r
-;------------------------------------------------------------------------------\r
-global ASM_PFX(AsmApDoneWithCommonStack)\r
-ASM_PFX(AsmApDoneWithCommonStack):\r
-lock btc    dword [ApStackLock], 0\r
-    ret\r
-\r