From: rsun3 Date: Mon, 1 Aug 2011 06:09:17 +0000 (+0000) Subject: Clean and split AcpiVariable.h in IntelFrameworkModulePkg into 2 new .h files for... X-Git-Tag: edk2-stable201903~14462 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=1261fe23ca7dba7d4ba28b858329920dbd96f46b Clean and split AcpiVariable.h in IntelFrameworkModulePkg into 2 new .h files for better modularity: IntelFrameworkModulePkg\Include\Guid\AcpiVariableCompatibility.h, MdeModulePkg\Include\Guid\AcpiS3Context.h. Signed-off-by: rsun3 Reviewed-by: jljusten Reviewed-by: jyao1 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12063 6f19259b-4bc3-4df7-8a09-765794883524 --- diff --git a/EdkCompatibilityPkg/Compatibility/AcpiVariableHobOnSmramReserveHobThunk/AcpiVariableHobOnSmramReserveHobThunk.c b/EdkCompatibilityPkg/Compatibility/AcpiVariableHobOnSmramReserveHobThunk/AcpiVariableHobOnSmramReserveHobThunk.c index 05dda263fa..42e5787a9d 100644 --- a/EdkCompatibilityPkg/Compatibility/AcpiVariableHobOnSmramReserveHobThunk/AcpiVariableHobOnSmramReserveHobThunk.c +++ b/EdkCompatibilityPkg/Compatibility/AcpiVariableHobOnSmramReserveHobThunk/AcpiVariableHobOnSmramReserveHobThunk.c @@ -17,7 +17,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include -#include +#include #include #include diff --git a/EdkCompatibilityPkg/Compatibility/AcpiVariableHobOnSmramReserveHobThunk/AcpiVariableHobOnSmramReserveHobThunk.inf b/EdkCompatibilityPkg/Compatibility/AcpiVariableHobOnSmramReserveHobThunk/AcpiVariableHobOnSmramReserveHobThunk.inf index 447aa77e8c..2294a01956 100644 --- a/EdkCompatibilityPkg/Compatibility/AcpiVariableHobOnSmramReserveHobThunk/AcpiVariableHobOnSmramReserveHobThunk.inf +++ b/EdkCompatibilityPkg/Compatibility/AcpiVariableHobOnSmramReserveHobThunk/AcpiVariableHobOnSmramReserveHobThunk.inf @@ -1,7 +1,7 @@ ## @file # Component description file for AcpiVariableHob on SmramReservedHob Thunk driver. # -# Copyright (c) 2010, Intel Corporation. All rights reserved.
+# Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.
# # This program and the accompanying materials # are licensed and made available under the terms and conditions @@ -34,7 +34,7 @@ [Packages] MdePkg/MdePkg.dec IntelFrameworkPkg/IntelFrameworkPkg.dec - IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec + MdeModulePkg/MdeModulePkg.dec [LibraryClasses] PeimEntryPoint diff --git a/IntelFrameworkModulePkg/Include/Guid/AcpiVariable.h b/IntelFrameworkModulePkg/Include/Guid/AcpiVariable.h deleted file mode 100644 index 6df9ddb100..0000000000 --- a/IntelFrameworkModulePkg/Include/Guid/AcpiVariable.h +++ /dev/null @@ -1,167 +0,0 @@ -/** @file -Provides the data format and Name and GUID definition for the EFI Variable ACPI_VARIABLE_SET and the Framework version's correponding -EFI Variable. -This variable is the persistent data that will be saved to NV EFI Variable. It is the central repository -for configuration data saved by the CPU Driver, Platform SMM Handler. It is read by -Platform PEIM and PEIM on S3 boot path to restore the system configuration. - -Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.
- -This program and the accompanying materials -are licensed and made available under the terms and conditions -of the BSD License which accompanies this distribution. The -full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, -WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. - -**/ - -#ifndef _ACPI_VARIABLE_H_ -#define _ACPI_VARIABLE_H_ - -#define EFI_ACPI_VARIABLE_GUID \ - { \ - 0xaf9ffd67, 0xec10, 0x488a, {0x9d, 0xfc, 0x6c, 0xbf, 0x5e, 0xe2, 0x2c, 0x2e } \ - } - -#define ACPI_GLOBAL_VARIABLE L"AcpiGlobalVariable" - -#define EFI_ACPI_VARIABLE_COMPATIBILITY_GUID \ - { \ - 0xc020489e, 0x6db2, 0x4ef2, {0x9a, 0xa5, 0xca, 0x6, 0xfc, 0x11, 0xd3, 0x6a } \ - } -// -// The following structure boosts performance by combining all ACPI related variables into one. -// -#pragma pack(1) -typedef struct { - UINT16 Limit; - UINTN Base; -} PSEUDO_DESCRIPTOR; -#pragma pack() - -typedef struct { - BOOLEAN APState; - BOOLEAN S3BootPath; - EFI_PHYSICAL_ADDRESS WakeUpBuffer; - EFI_PHYSICAL_ADDRESS GdtrProfile; - EFI_PHYSICAL_ADDRESS IdtrProfile; - EFI_PHYSICAL_ADDRESS CpuPrivateData; - EFI_PHYSICAL_ADDRESS StackAddress; - EFI_PHYSICAL_ADDRESS MicrocodePointerBuffer; - EFI_PHYSICAL_ADDRESS SmramBase; - EFI_PHYSICAL_ADDRESS SmmStartImageBase; - UINT32 SmmStartImageSize; - UINT32 NumberOfCpus; -} ACPI_CPU_DATA_COMPATIBILITY; - -typedef struct { - // - // Acpi Related variables - // - EFI_PHYSICAL_ADDRESS AcpiReservedMemoryBase; - UINT32 AcpiReservedMemorySize; - EFI_PHYSICAL_ADDRESS S3ReservedLowMemoryBase; - EFI_PHYSICAL_ADDRESS AcpiBootScriptTable; - EFI_PHYSICAL_ADDRESS RuntimeScriptTableBase; - EFI_PHYSICAL_ADDRESS AcpiFacsTable; - UINT64 SystemMemoryLength; - ACPI_CPU_DATA_COMPATIBILITY AcpiCpuData; - // - // VGA OPROM to support Video Re-POST for Linux S3 - // - EFI_PHYSICAL_ADDRESS VideoOpromAddress; - UINT32 VideoOpromSize; - - // - // S3 Debug extension - // - EFI_PHYSICAL_ADDRESS S3DebugBufferAddress; - EFI_PHYSICAL_ADDRESS S3ResumeNvsEntryPoint; -} ACPI_VARIABLE_SET_COMPATIBILITY; - -typedef struct { - BOOLEAN APState; - EFI_PHYSICAL_ADDRESS StartupVector; - EFI_PHYSICAL_ADDRESS GdtrProfile; - EFI_PHYSICAL_ADDRESS IdtrProfile; - EFI_PHYSICAL_ADDRESS StackAddress; - UINT32 StackSize; - UINT32 NumberOfCpus; - EFI_PHYSICAL_ADDRESS MtrrTable; - EFI_PHYSICAL_ADDRESS RegisterTable; - EFI_PHYSICAL_ADDRESS Microcode; -} ACPI_CPU_DATA; - -typedef struct { - // - // Acpi Related variables - // - EFI_PHYSICAL_ADDRESS AcpiReservedMemoryBase; - UINT32 AcpiReservedMemorySize; - EFI_PHYSICAL_ADDRESS S3ReservedLowMemoryBase; - EFI_PHYSICAL_ADDRESS AcpiFacsTable; - UINT64 SystemMemoryLength; - ACPI_CPU_DATA AcpiCpuData; - - // - // VGA OPROM to support Video Re-POST for Linux S3 - // - EFI_PHYSICAL_ADDRESS VideoOpromAddress; - UINT32 VideoOpromSize; - EFI_PHYSICAL_ADDRESS S3PostVideoStatusRestoreEntryPoint; - - EFI_PHYSICAL_ADDRESS S3NvsPageTableAddress; - EFI_PHYSICAL_ADDRESS S3DebugBufferAddress; -} ACPI_VARIABLE_SET; - -#define SMM_S3_RESUME_SMM_32 SIGNATURE_64 ('S','M','M','S','3','_','3','2') -#define SMM_S3_RESUME_SMM_64 SIGNATURE_64 ('S','M','M','S','3','_','6','4') - -typedef struct { - UINT64 Signature; - EFI_PHYSICAL_ADDRESS SmmS3ResumeEntryPoint; - EFI_PHYSICAL_ADDRESS SmmS3StackBase; - UINT64 SmmS3StackSize; - UINT64 SmmS3Cr0; - UINT64 SmmS3Cr3; - UINT64 SmmS3Cr4; - UINT16 ReturnCs; - EFI_PHYSICAL_ADDRESS ReturnEntryPoint; - EFI_PHYSICAL_ADDRESS ReturnContext1; - EFI_PHYSICAL_ADDRESS ReturnContext2; - EFI_PHYSICAL_ADDRESS ReturnStackPointer; - EFI_PHYSICAL_ADDRESS Smst; -} SMM_S3_RESUME_STATE; - - -typedef struct { - EFI_PHYSICAL_ADDRESS AcpiFacsTable; - EFI_PHYSICAL_ADDRESS IdtrProfile; - EFI_PHYSICAL_ADDRESS S3NvsPageTableAddress; - EFI_PHYSICAL_ADDRESS BootScriptStackBase; - UINT64 BootScriptStackSize; - EFI_PHYSICAL_ADDRESS S3DebugBufferAddress; -} ACPI_S3_CONTEXT; - -typedef struct { - UINT16 ReturnCs; - EFI_PHYSICAL_ADDRESS ReturnEntryPoint; - EFI_PHYSICAL_ADDRESS ReturnStackPointer; - EFI_PHYSICAL_ADDRESS AsmTransferControl; - PSEUDO_DESCRIPTOR Idtr; -} PEI_S3_RESUME_STATE; - -#define EFI_ACPI_S3_CONTEXT_GUID \ - { \ - 0xef98d3a, 0x3e33, 0x497a, {0xa4, 0x1, 0x77, 0xbe, 0x3e, 0xb7, 0x4f, 0x38} \ - } - -extern EFI_GUID gEfiAcpiS3ContextGuid; - -extern EFI_GUID gEfiAcpiVariableGuid; -extern EFI_GUID gEfiAcpiVariableCompatiblityGuid; - -#endif diff --git a/IntelFrameworkModulePkg/Include/Guid/AcpiVariableCompatibility.h b/IntelFrameworkModulePkg/Include/Guid/AcpiVariableCompatibility.h new file mode 100644 index 0000000000..6c9f851543 --- /dev/null +++ b/IntelFrameworkModulePkg/Include/Guid/AcpiVariableCompatibility.h @@ -0,0 +1,69 @@ +/** @file + Definitions for data structures used in S3 resume. + +Copyright (c) 2011, Intel Corporation. All rights reserved.
+ +This program and the accompanying materials +are licensed and made available under the terms and conditions +of the BSD License which accompanies this distribution. The +full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef _ACPI_VARIABLE_COMPATIBILITY_H_ +#define _ACPI_VARIABLE_COMPATIBILITY_H_ + +#define EFI_ACPI_VARIABLE_COMPATIBILITY_GUID \ + { \ + 0xc020489e, 0x6db2, 0x4ef2, {0x9a, 0xa5, 0xca, 0x6, 0xfc, 0x11, 0xd3, 0x6a } \ + } + +#define ACPI_GLOBAL_VARIABLE L"AcpiGlobalVariable" + +extern EFI_GUID gEfiAcpiVariableCompatiblityGuid; + +typedef struct { + BOOLEAN APState; + BOOLEAN S3BootPath; + EFI_PHYSICAL_ADDRESS WakeUpBuffer; + EFI_PHYSICAL_ADDRESS GdtrProfile; + EFI_PHYSICAL_ADDRESS IdtrProfile; + EFI_PHYSICAL_ADDRESS CpuPrivateData; + EFI_PHYSICAL_ADDRESS StackAddress; + EFI_PHYSICAL_ADDRESS MicrocodePointerBuffer; + EFI_PHYSICAL_ADDRESS SmramBase; + EFI_PHYSICAL_ADDRESS SmmStartImageBase; + UINT32 SmmStartImageSize; + UINT32 NumberOfCpus; +} ACPI_CPU_DATA_COMPATIBILITY; + +typedef struct { + // + // Acpi Related variables + // + EFI_PHYSICAL_ADDRESS AcpiReservedMemoryBase; + UINT32 AcpiReservedMemorySize; + EFI_PHYSICAL_ADDRESS S3ReservedLowMemoryBase; + EFI_PHYSICAL_ADDRESS AcpiBootScriptTable; + EFI_PHYSICAL_ADDRESS RuntimeScriptTableBase; + EFI_PHYSICAL_ADDRESS AcpiFacsTable; + UINT64 SystemMemoryLength; + ACPI_CPU_DATA_COMPATIBILITY AcpiCpuData; + // + // VGA OPROM to support Video Re-POST for Linux S3 + // + EFI_PHYSICAL_ADDRESS VideoOpromAddress; + UINT32 VideoOpromSize; + + // + // S3 Debug extension + // + EFI_PHYSICAL_ADDRESS S3DebugBufferAddress; + EFI_PHYSICAL_ADDRESS S3ResumeNvsEntryPoint; +} ACPI_VARIABLE_SET_COMPATIBILITY; + +#endif diff --git a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec index b297a885e1..00542e9c93 100644 --- a/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec +++ b/IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec @@ -47,12 +47,6 @@ # Include/Guid/LzmaDecompress.h gLzmaCustomDecompressGuid = { 0xEE4E5898, 0x3914, 0x4259, { 0x9D, 0x6E, 0xDC, 0x7B, 0xD7, 0x94, 0x03, 0xCF }} - ## Include/Guid/AcpiVariable.h - gEfiAcpiVariableGuid = { 0xAF9FFD67, 0xEC10, 0x488A, { 0x9D, 0xFC, 0x6C, 0xBF, 0x5E, 0xE2, 0x2C, 0x2E }} - - ## Include/Guid/AcpiVariable.h - gEfiAcpiS3ContextGuid = { 0xef98d3a, 0x3e33, 0x497a, { 0xa4, 0x1, 0x77, 0xbe, 0x3e, 0xb7, 0x4f, 0x38 }} - ## Include/Guid/AcpiVariable.h gEfiAcpiVariableCompatiblityGuid = { 0xc020489e, 0x6db2, 0x4ef2, { 0x9a, 0xa5, 0xca, 0x6, 0xfc, 0x11, 0xd3, 0x6a }} diff --git a/MdeModulePkg/Include/Guid/AcpiS3Context.h b/MdeModulePkg/Include/Guid/AcpiS3Context.h new file mode 100644 index 0000000000..80386e59f0 --- /dev/null +++ b/MdeModulePkg/Include/Guid/AcpiS3Context.h @@ -0,0 +1,68 @@ +/** @file + Definitions for data structures used in S3 resume. + +Copyright (c) 2011, Intel Corporation. All rights reserved.
+ +This program and the accompanying materials +are licensed and made available under the terms and conditions +of the BSD License which accompanies this distribution. The +full text of the license may be found at +http://opensource.org/licenses/bsd-license.php + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. + +**/ + +#ifndef _ACPI_S3_DATA_H_ +#define _ACPI_S3_DATA_H_ + +#include + +#define SMM_S3_RESUME_SMM_32 SIGNATURE_64 ('S','M','M','S','3','_','3','2') +#define SMM_S3_RESUME_SMM_64 SIGNATURE_64 ('S','M','M','S','3','_','6','4') + +typedef struct { + UINT64 Signature; + EFI_PHYSICAL_ADDRESS SmmS3ResumeEntryPoint; + EFI_PHYSICAL_ADDRESS SmmS3StackBase; + UINT64 SmmS3StackSize; + UINT64 SmmS3Cr0; + UINT64 SmmS3Cr3; + UINT64 SmmS3Cr4; + UINT16 ReturnCs; + EFI_PHYSICAL_ADDRESS ReturnEntryPoint; + EFI_PHYSICAL_ADDRESS ReturnContext1; + EFI_PHYSICAL_ADDRESS ReturnContext2; + EFI_PHYSICAL_ADDRESS ReturnStackPointer; + EFI_PHYSICAL_ADDRESS Smst; +} SMM_S3_RESUME_STATE; + + +typedef struct { + EFI_PHYSICAL_ADDRESS AcpiFacsTable; + EFI_PHYSICAL_ADDRESS IdtrProfile; + EFI_PHYSICAL_ADDRESS S3NvsPageTableAddress; + EFI_PHYSICAL_ADDRESS BootScriptStackBase; + UINT64 BootScriptStackSize; + EFI_PHYSICAL_ADDRESS S3DebugBufferAddress; +} ACPI_S3_CONTEXT; + +typedef struct { + UINT16 ReturnCs; + EFI_PHYSICAL_ADDRESS ReturnEntryPoint; + EFI_PHYSICAL_ADDRESS ReturnStackPointer; + EFI_PHYSICAL_ADDRESS AsmTransferControl; + IA32_DESCRIPTOR Idtr; +} PEI_S3_RESUME_STATE; + +#define EFI_ACPI_S3_CONTEXT_GUID \ + { \ + 0xef98d3a, 0x3e33, 0x497a, {0xa4, 0x1, 0x77, 0xbe, 0x3e, 0xb7, 0x4f, 0x38} \ + } + +extern EFI_GUID gEfiAcpiS3ContextGuid; + +extern EFI_GUID gEfiAcpiVariableGuid; + +#endif diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index 616e7e6c7b..80c9632e60 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -188,6 +188,12 @@ ## Include/Guid/SmmLockBox.h gEfiSmmLockBoxCommunicationGuid = { 0x2a3cfebd, 0x27e8, 0x4d0a, { 0x8b, 0x79, 0xd6, 0x88, 0xc2, 0xa3, 0xe1, 0xc0 }} + ## Include/Guid/AcpiS3Context.h + gEfiAcpiVariableGuid = { 0xAF9FFD67, 0xEC10, 0x488A, { 0x9D, 0xFC, 0x6C, 0xBF, 0x5E, 0xE2, 0x2C, 0x2E }} + + ## Include/Guid/AcpiS3Context.h + gEfiAcpiS3ContextGuid = { 0xef98d3a, 0x3e33, 0x497a, { 0xa4, 0x1, 0x77, 0xbe, 0x3e, 0xb7, 0x4f, 0x38 }} + [Ppis] ## Include/Ppi/AtaController.h gPeiAtaControllerPpiGuid = { 0xa45e60d1, 0xc719, 0x44aa, { 0xb0, 0x7a, 0xaa, 0x77, 0x7f, 0x85, 0x90, 0x6d }}