]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/CpuMpPei/CpuMpPei.h
UefiCpuPkg/CpuMpPei: Remove unused files and codes
[mirror_edk2.git] / UefiCpuPkg / CpuMpPei / CpuMpPei.h
index fb57669de51667a7afc5f537407ac1151a4026bd..5a422b2315dcede4404f3874e81c43f1383d6fb4 100644 (file)
 #include <Ppi/SecPlatformInformation.h>\r
 #include <Ppi/SecPlatformInformation2.h>\r
 #include <Ppi/EndOfPeiPhase.h>\r
-#include <Ppi/VectorHandoffInfo.h>\r
-\r
-#include <Register/Cpuid.h>\r
-#include <Register/LocalApic.h>\r
-#include <Register/Msr.h>\r
 \r
 #include <Library/BaseLib.h>\r
-#include <Library/BaseMemoryLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/HobLib.h>\r
 #include <Library/LocalApicLib.h>\r
-#include <Library/MtrrLib.h>\r
-#include <Library/PcdLib.h>\r
 #include <Library/PeimEntryPoint.h>\r
 #include <Library/PeiServicesLib.h>\r
 #include <Library/ReportStatusCodeLib.h>\r
-#include <Library/SynchronizationLib.h>\r
-#include <Library/TimerLib.h>\r
-#include <Library/UefiCpuLib.h>\r
-#include <Library/CpuLib.h>\r
 #include <Library/CpuExceptionHandlerLib.h>\r
 #include <Library/MpInitLib.h>\r
 \r
-#include "Microcode.h"\r
-\r
-//\r
-// AP state\r
-//\r
-typedef enum {\r
-  CpuStateIdle,\r
-  CpuStateBusy,\r
-  CpuStateDisabled\r
-} CPU_STATE;\r
-\r
-#define WAKEUP_AP_SIGNAL SIGNATURE_32 ('S', 'T', 'A', 'P')\r
-\r
-typedef enum {\r
-  ApInHltLoop   = 1,\r
-  ApInMwaitLoop = 2,\r
-  ApInRunLoop   = 3\r
-} AP_LOOP_MODE;\r
-\r
-//\r
-// AP reset code information\r
-//\r
-typedef struct {\r
-  UINT8             *RendezvousFunnelAddress;\r
-  UINTN             ModeEntryOffset;\r
-  UINTN             RendezvousFunnelSize;\r
-} MP_ASSEMBLY_ADDRESS_MAP;\r
-\r
-//\r
-// CPU exchange information for switch BSP\r
-//\r
-typedef struct {\r
-  UINT8             State;        // offset 0\r
-  UINTN             StackPointer; // offset 4 / 8\r
-  IA32_DESCRIPTOR   Gdtr;         // offset 8 / 16\r
-  IA32_DESCRIPTOR   Idtr;         // offset 14 / 26\r
-} CPU_EXCHANGE_ROLE_INFO;\r
-\r
-typedef struct _PEI_CPU_MP_DATA  PEI_CPU_MP_DATA;\r
-\r
-#pragma pack(1)\r
-\r
-//\r
-// MP CPU exchange information for AP reset code\r
-// This structure is required to be packed because fixed field offsets\r
-// into this structure are used in assembly code in this module\r
-//\r
-typedef struct {\r
-  UINTN                 Lock;\r
-  UINTN                 StackStart;\r
-  UINTN                 StackSize;\r
-  UINTN                 CFunction;\r
-  IA32_DESCRIPTOR       GdtrProfile;\r
-  IA32_DESCRIPTOR       IdtrProfile;\r
-  UINTN                 BufferStart;\r
-  UINTN                 ModeOffset;\r
-  UINTN                 NumApsExecuting;\r
-  UINTN                 CodeSegment;\r
-  UINTN                 DataSegment;\r
-  UINTN                 Cr3;\r
-  PEI_CPU_MP_DATA       *PeiCpuMpData;\r
-} MP_CPU_EXCHANGE_INFO;\r
-\r
-#pragma pack()\r
-\r
-typedef struct {\r
-  UINTN                          Cr0;\r
-  UINTN                          Cr3;\r
-  UINTN                          Cr4;\r
-  UINTN                          Dr0;\r
-  UINTN                          Dr1;\r
-  UINTN                          Dr2;\r
-  UINTN                          Dr3;\r
-  UINTN                          Dr6;\r
-  UINTN                          Dr7;\r
-} CPU_VOLATILE_REGISTERS;\r
-\r
-typedef struct {\r
-  volatile UINT32                *StartupApSignal;\r
-  UINT32                         ApicId;\r
-  EFI_HEALTH_FLAGS               Health;\r
-  CPU_STATE                      State;\r
-  BOOLEAN                        CpuHealthy;\r
-  CPU_VOLATILE_REGISTERS         VolatileRegisters;\r
-} PEI_CPU_DATA;\r
-\r
-//\r
-// PEI CPU MP Data save in memory\r
-//\r
-struct _PEI_CPU_MP_DATA {\r
-  SPIN_LOCK                      MpLock;\r
-  UINT32                         CpuCount;\r
-  UINT32                         BspNumber;\r
-  UINTN                          Buffer;\r
-  UINTN                          CpuApStackSize;\r
-  MP_ASSEMBLY_ADDRESS_MAP        AddressMap;\r
-  UINTN                          WakeupBuffer;\r
-  UINTN                          BackupBuffer;\r
-  UINTN                          BackupBufferSize;\r
-  UINTN                          ApFunction;\r
-  UINTN                          ApFunctionArgument;\r
-  volatile UINT32                FinishedCount;\r
-  BOOLEAN                        EndOfPeiFlag;\r
-  BOOLEAN                        InitFlag;\r
-  BOOLEAN                        X2ApicEnable;\r
-  CPU_EXCHANGE_ROLE_INFO         BSPInfo;\r
-  CPU_EXCHANGE_ROLE_INFO         APInfo;\r
-  MTRR_SETTINGS                  MtrrTable;\r
-  UINT8                          ApLoopMode;\r
-  UINT8                          ApTargetCState;\r
-  PEI_CPU_DATA                   *CpuData;\r
-  volatile MP_CPU_EXCHANGE_INFO  *MpCpuExchangeInfo;\r
-};\r
 extern EFI_PEI_PPI_DESCRIPTOR   mPeiCpuMpPpiDesc;\r
 \r
 \r
-/**\r
-  Assembly code to get starting address and size of the rendezvous entry for APs.\r
-  Information for fixing a jump instruction in the code is also returned.\r
-\r
-  @param AddressMap  Output buffer for address map information.\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmGetAddressMap (\r
-  OUT MP_ASSEMBLY_ADDRESS_MAP    *AddressMap\r
-  );\r
-\r
-/**\r
-  Assembly code to load GDT table and update segment accordingly.\r
-\r
-  @param Gdtr   Pointer to GDT descriptor\r
-**/\r
-VOID\r
-EFIAPI\r
-AsmInitializeGdt (\r
-  IN IA32_DESCRIPTOR  *Gdtr\r
-  );\r
-\r
-/**\r
-  Get available system memory below 1MB by specified size.\r
-\r
-  @param PeiCpuMpData        Pointer to PEI CPU MP Data\r
-**/\r
-STATIC\r
-VOID\r
-BackupAndPrepareWakeupBuffer(\r
-  IN PEI_CPU_MP_DATA         *PeiCpuMpData\r
-  );\r
-\r
-/**\r
-  Restore wakeup buffer data.\r
-\r
-  @param PeiCpuMpData        Pointer to PEI CPU MP Data\r
-**/\r
-STATIC\r
-VOID\r
-RestoreWakeupBuffer(\r
-  IN PEI_CPU_MP_DATA         *PeiCpuMpData\r
-  );\r
-\r
-/**\r
-  Notify function on End Of Pei PPI.\r
-\r
-  On S3 boot, this function will restore wakeup buffer data.\r
-  On normal boot, this function will flag wakeup buffer to be un-used type.\r
-\r
-  @param  PeiServices        The pointer to the PEI Services Table.\r
-  @param  NotifyDescriptor   Address of the notification descriptor data structure.\r
-  @param  Ppi                Address of the PPI that was installed.\r
-\r
-  @retval EFI_SUCCESS        When everything is OK.\r
-\r
-**/\r
-STATIC\r
-EFI_STATUS\r
-EFIAPI\r
-CpuMpEndOfPeiCallback (\r
-  IN      EFI_PEI_SERVICES        **PeiServices,\r
-  IN EFI_PEI_NOTIFY_DESCRIPTOR    *NotifyDescriptor,\r
-  IN VOID                         *Ppi\r
-  );\r
-\r
-/**\r
-  This function will be called by BSP to wakeup AP.\r
-\r
-  @param PeiCpuMpData       Pointer to PEI CPU MP Data\r
-  @param Broadcast          TRUE:  Send broadcast IPI to all APs\r
-                            FALSE: Send IPI to AP by ApicId\r
-  @param ProcessorNumber    The handle number of specified processor\r
-  @param Procedure          The function to be invoked by AP\r
-  @param ProcedureArgument  The argument to be passed into AP function\r
-**/\r
-STATIC\r
-VOID\r
-WakeUpAP (\r
-  IN PEI_CPU_MP_DATA           *PeiCpuMpData,\r
-  IN BOOLEAN                   Broadcast,\r
-  IN UINTN                     ProcessorNumber,\r
-  IN EFI_AP_PROCEDURE          Procedure,              OPTIONAL\r
-  IN VOID                      *ProcedureArgument      OPTIONAL\r
-  );\r
-\r
-/**\r
-  Get CPU MP Data pointer from the Guided HOB.\r
-\r
-  @return  Pointer to Pointer to PEI CPU MP Data\r
-**/\r
-PEI_CPU_MP_DATA *\r
-GetMpHobData (\r
-  VOID\r
-  );\r
-\r
-/**\r
-  Find the current Processor number by APIC ID.\r
-\r
-  @param PeiCpuMpData        Pointer to PEI CPU MP Data\r
-  @param ProcessorNumber     Return the pocessor number found\r
-\r
-  @retval EFI_SUCCESS        ProcessorNumber is found and returned.\r
-  @retval EFI_NOT_FOUND      ProcessorNumber is not found.\r
-**/\r
-STATIC\r
-EFI_STATUS\r
-GetProcessorNumber (\r
-  IN PEI_CPU_MP_DATA         *PeiCpuMpData,\r
-  OUT UINTN                  *ProcessorNumber\r
-  );\r
-\r
 /**\r
   Collects BIST data from PPI.\r
 \r
@@ -307,14 +69,4 @@ SecPlatformInformation2 (
      OUT EFI_SEC_PLATFORM_INFORMATION_RECORD2 *PlatformInformationRecord2\r
   );\r
 \r
-/**\r
-  Detect whether specified processor can find matching microcode patch and load it.\r
-\r
-  @param PeiCpuMpData        Pointer to PEI CPU MP Data\r
-**/\r
-VOID\r
-MicrocodeDetect (\r
-  IN PEI_CPU_MP_DATA            *PeiCpuMpData\r
-  );\r
-\r
 #endif\r