]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/Library/MpInitLib/MpLib.h
UefiCpuPkg/MpLib: Add GDTR, IDTR and TR in saved AP data
[mirror_edk2.git] / UefiCpuPkg / Library / MpInitLib / MpLib.h
index 49305ad6637bc6292a57b38c9fe059990f70a5a3..685e96cbac45f694ad7e03600da5a828338b3773 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Common header file for MP Initialize Library.\r
 \r
-  Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2016 - 2017, 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
@@ -102,6 +102,9 @@ typedef struct {
   UINTN                          Dr3;\r
   UINTN                          Dr6;\r
   UINTN                          Dr7;\r
+  IA32_DESCRIPTOR                Gdtr;\r
+  IA32_DESCRIPTOR                Idtr;\r
+  UINT16                         Tr;\r
 } CPU_VOLATILE_REGISTERS;\r
 \r
 //\r
@@ -169,14 +172,16 @@ typedef struct {
   IA32_DESCRIPTOR       IdtrProfile;\r
   UINTN                 BufferStart;\r
   UINTN                 ModeOffset;\r
-  UINTN                 NumApsExecuting;\r
+  UINTN                 ApIndex;\r
   UINTN                 CodeSegment;\r
   UINTN                 DataSegment;\r
   UINTN                 EnableExecuteDisable;\r
   UINTN                 Cr3;\r
   UINTN                 InitFlag;\r
   CPU_INFO_IN_HOB       *CpuInfo;\r
+  UINTN                 NumApsExecuting;\r
   CPU_MP_DATA           *CpuMpData;\r
+  UINTN                 InitializeFloatingPointUnitsAddress;\r
 } MP_CPU_EXCHANGE_INFO;\r
 \r
 #pragma pack()\r
@@ -200,7 +205,6 @@ struct _CPU_MP_DATA {
   UINTN                          WakeupBuffer;\r
   UINTN                          BackupBuffer;\r
   UINTN                          BackupBufferSize;\r
-  BOOLEAN                        SaveRestoreFlag;\r
 \r
   volatile UINT32                StartCount;\r
   volatile UINT32                FinishedCount;\r
@@ -227,6 +231,14 @@ struct _CPU_MP_DATA {
   UINT16                         PmCodeSegment;\r
   CPU_AP_DATA                    *CpuData;\r
   volatile MP_CPU_EXCHANGE_INFO  *MpCpuExchangeInfo;\r
+\r
+  UINT32                         CurrentTimerCount;\r
+  UINTN                          DivideValue;\r
+  UINT8                          Vector;\r
+  BOOLEAN                        PeriodicMode;\r
+  BOOLEAN                        TimerInterruptState;\r
+  UINT64                         MicrocodePatchAddress;\r
+  UINT64                         MicrocodePatchRegionSize;\r
 };\r
 \r
 extern EFI_GUID mCpuInitMpLibHobGuid;\r
@@ -303,24 +315,18 @@ SaveCpuMpData (
   IN CPU_MP_DATA   *CpuMpData\r
   );\r
 \r
-/**\r
-  Allocate reset vector buffer.\r
-\r
-  @param[in, out]  CpuMpData  The pointer to CPU MP Data structure.\r
-**/\r
-VOID\r
-AllocateResetVector (\r
-  IN OUT CPU_MP_DATA          *CpuMpData\r
-  );\r
 \r
 /**\r
-  Free AP reset vector buffer.\r
+  Get available system memory below 1MB by specified size.\r
 \r
-  @param[in]  CpuMpData  The pointer to CPU MP Data structure.\r
+  @param[in] WakeupBufferSize   Wakeup buffer size required\r
+\r
+  @retval other   Return wakeup buffer address below 1MB.\r
+  @retval -1      Cannot find free memory below 1MB.\r
 **/\r
-VOID\r
-FreeResetVector (\r
-  IN CPU_MP_DATA              *CpuMpData\r
+UINTN\r
+GetWakeupBuffer (\r
+  IN UINTN                WakeupBufferSize\r
   );\r
 \r
 /**\r
@@ -365,7 +371,7 @@ InitMpGlobalData (
                                       simultaneously.\r
   @param[in]  WaitEvent               The event created by the caller with CreateEvent()\r
                                       service.\r
-  @param[in]  TimeoutInMicrosecsond   Indicates the time limit in microseconds for\r
+  @param[in]  TimeoutInMicroseconds   Indicates the time limit in microseconds for\r
                                       APs to return from Procedure, either for\r
                                       blocking or non-blocking mode.\r
   @param[in]  ProcedureArgument       The parameter passed into Procedure for\r
@@ -402,7 +408,7 @@ StartupAllAPsWorker (
   @param[in]  ProcessorNumber         The handle number of the AP.\r
   @param[in]  WaitEvent               The event created by the caller with CreateEvent()\r
                                       service.\r
-  @param[in]  TimeoutInMicrosecsond   Indicates the time limit in microseconds for\r
+  @param[in]  TimeoutInMicroseconds   Indicates the time limit in microseconds for\r
                                       APs to return from Procedure, either for\r
                                       blocking or non-blocking mode.\r
   @param[in]  ProcedureArgument       The parameter passed into Procedure for\r
@@ -536,43 +542,12 @@ IsMwaitSupport (
   );\r
 \r
 /**\r
-  Notify function on End Of PEI PPI.\r
+  Enable Debug Agent to support source debugging on AP function.\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[in]  PeiServices        The pointer to the PEI Services Table.\r
-  @param[in]  NotifyDescriptor   Address of the notification descriptor data structure.\r
-  @param[in]  Ppi                Address of the PPI that was installed.\r
-\r
-  @retval EFI_SUCCESS        When everything is OK.\r
-**/\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
-  Get available system memory below 1MB by specified size.\r
-\r
-  @param[in]  CpuMpData  The pointer to CPU MP Data structure.\r
 **/\r
 VOID\r
-BackupAndPrepareWakeupBuffer(\r
-  IN CPU_MP_DATA              *CpuMpData\r
-  );\r
-\r
-/**\r
-  Restore wakeup buffer data.\r
-\r
-  @param[in]  CpuMpData  The pointer to CPU MP Data structure.\r
-**/\r
-VOID\r
-RestoreWakeupBuffer(\r
-  IN CPU_MP_DATA              *CpuMpData\r
+EnableDebugAgent (\r
+  VOID\r
   );\r
 \r
 #endif\r