]> git.proxmox.com Git - mirror_edk2.git/blobdiff - UefiCpuPkg/Include/AcpiCpuData.h
UefiCpuPkg: Refactor initialization of CPU features during S3 resume
[mirror_edk2.git] / UefiCpuPkg / Include / AcpiCpuData.h
index 62a01b2c6baccc1e16c67d6c27f82e5ed30dd54c..659821072d0d74cdddfc180fd684c32aadb0f2bc 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Definitions for CPU S3 data.\r
 \r
-Copyright (c) 2013 - 2020, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2013 - 2021, Intel Corporation. All rights reserved.<BR>\r
 SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
@@ -9,6 +9,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #ifndef _ACPI_CPU_DATA_H_\r
 #define _ACPI_CPU_DATA_H_\r
 \r
+//\r
+// This macro definition is used to fix incompatibility issue caused by\r
+// ACPI_CPU_DATA structure update. It will be removed after all the platform\r
+// code uses new ACPI_CPU_DATA structure.\r
+//\r
+#define ACPI_CPU_DATA_STRUCTURE_UPDATE\r
+\r
 //\r
 // Register types in register table\r
 //\r
@@ -118,6 +125,49 @@ typedef struct {
   EFI_PHYSICAL_ADDRESS      RegisterTableEntry;\r
 } CPU_REGISTER_TABLE;\r
 \r
+//\r
+// Data structure that is used for CPU feature initialization during ACPI S3\r
+// resume.\r
+//\r
+typedef struct {\r
+  //\r
+  // Physical address of an array of CPU_REGISTER_TABLE structures, with\r
+  // NumberOfCpus entries.  If a register table is not required, then the\r
+  // TableLength and AllocatedSize fields of CPU_REGISTER_TABLE are set to 0.\r
+  // If TableLength is > 0, then elements of RegisterTableEntry are used to\r
+  // initialize the CPU that matches InitialApicId, during an ACPI S3 resume,\r
+  // before SMBASE relocation is performed.\r
+  // If a register table is not required for any one of the CPUs, then\r
+  // PreSmmInitRegisterTable may be set to 0.\r
+  //\r
+  EFI_PHYSICAL_ADDRESS    PreSmmInitRegisterTable;\r
+  //\r
+  // Physical address of an array of CPU_REGISTER_TABLE structures, with\r
+  // NumberOfCpus entries.  If a register table is not required, then the\r
+  // TableLength and AllocatedSize fields of CPU_REGISTER_TABLE are set to 0.\r
+  // If TableLength is > 0, then elements of RegisterTableEntry are used to\r
+  // initialize the CPU that matches InitialApicId, during an ACPI S3 resume,\r
+  // after SMBASE relocation is performed.\r
+  // If a register table is not required for any one of the CPUs, then\r
+  // RegisterTable may be set to 0.\r
+  //\r
+  EFI_PHYSICAL_ADDRESS    RegisterTable;\r
+  //\r
+  // CPU information which is required when set the register table.\r
+  //\r
+  CPU_STATUS_INFORMATION  CpuStatus;\r
+  //\r
+  // Location info for each AP.\r
+  // It points to an array which saves all APs location info.\r
+  // The array count is the AP count in this CPU.\r
+  //\r
+  // If the platform does not support MSR setting at S3 resume, and\r
+  // therefore it doesn't need the dependency semaphores, it should set\r
+  // this field to 0.\r
+  //\r
+  EFI_PHYSICAL_ADDRESS    ApLocation;\r
+} CPU_FEATURE_INIT_DATA;\r
+\r
 //\r
 // Data structure that is required for ACPI S3 resume. The PCD\r
 // PcdCpuS3DataAddress must be set to the physical address where this structure\r
@@ -172,28 +222,6 @@ typedef struct {
   //\r
   EFI_PHYSICAL_ADDRESS  MtrrTable;\r
   //\r
-  // Physical address of an array of CPU_REGISTER_TABLE structures, with\r
-  // NumberOfCpus entries.  If a register table is not required, then the\r
-  // TableLength and AllocatedSize fields of CPU_REGISTER_TABLE are set to 0.\r
-  // If TableLength is > 0, then elements of RegisterTableEntry are used to\r
-  // initialize the CPU that matches InitialApicId, during an ACPI S3 resume,\r
-  // before SMBASE relocation is performed.\r
-  // If a register table is not required for any one of the CPUs, then\r
-  // PreSmmInitRegisterTable may be set to 0.\r
-  //\r
-  EFI_PHYSICAL_ADDRESS  PreSmmInitRegisterTable;\r
-  //\r
-  // Physical address of an array of CPU_REGISTER_TABLE structures, with\r
-  // NumberOfCpus entries.  If a register table is not required, then the\r
-  // TableLength and AllocatedSize fields of CPU_REGISTER_TABLE are set to 0.\r
-  // If TableLength is > 0, then elements of RegisterTableEntry are used to\r
-  // initialize the CPU that matches InitialApicId, during an ACPI S3 resume,\r
-  // after SMBASE relocation is performed.\r
-  // If a register table is not required for any one of the CPUs, then\r
-  // RegisterTable may be set to 0.\r
-  //\r
-  EFI_PHYSICAL_ADDRESS  RegisterTable;\r
-  //\r
   // Physical address of a buffer that contains the machine check handler that\r
   // is used during an ACPI S3 Resume.  In order for this machine check\r
   // handler to be active on an AP during an ACPI S3 resume, the machine check\r
@@ -208,19 +236,10 @@ typedef struct {
   //\r
   UINT32                ApMachineCheckHandlerSize;\r
   //\r
-  // CPU information which is required when set the register table.\r
-  //\r
-  CPU_STATUS_INFORMATION     CpuStatus;\r
-  //\r
-  // Location info for each AP.\r
-  // It points to an array which saves all APs location info.\r
-  // The array count is the AP count in this CPU.\r
-  //\r
-  // If the platform does not support MSR setting at S3 resume, and\r
-  // therefore it doesn't need the dependency semaphores, it should set\r
-  // this field to 0.\r
+  // Data structure that is used for CPU feature initialization during ACPI S3\r
+  // resume.\r
   //\r
-  EFI_PHYSICAL_ADDRESS  ApLocation;\r
+  CPU_FEATURE_INIT_DATA CpuFeatureInitData;\r
 } ACPI_CPU_DATA;\r
 \r
 #endif\r