From ba2377328775b10caa4c2091a8997eb8685c39b8 Mon Sep 17 00:00:00 2001 From: AJFISH Date: Tue, 3 Jul 2007 18:34:24 +0000 Subject: [PATCH] Removed IntelframeworkPkg contamination from MdeModulePkg modules. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3019 6f19259b-4bc3-4df7-8a09-765794883524 --- .../GuidedSectionExtraction.h | 2 +- .../Bus/Isa/IsaBusDxe/IsaBus.inf | 11 +- .../DxeBootScriptLibNull.inf | 9 -- .../Protocol/Crc32GuidedSectionExtraction.h | 42 ++++++ MdeModulePkg/MdeModulePkg.dec | 3 +- MdeModulePkg/MdeModulePkg.dsc | 4 + .../BaseMemoryTestPei/BaseMemoryTest.c | 26 +--- .../BaseMemoryTestPei/BaseMemoryTest.h | 8 + .../BaseMemoryTestPei/BaseMemoryTest.inf | 42 +----- .../Universal/Capsule/RuntimeDxe/Capsule.c | 68 --------- .../Capsule/RuntimeDxe/CapsuleRuntime.inf | 53 ------- .../Capsule/RuntimeDxe/CapsuleService.c | 65 ++++++-- .../Dxe/Crc32SectionExtract.c | 43 +++++- .../Dxe/Crc32SectionExtract.h | 13 +- .../Dxe/Crc32SectionExtract.inf | 44 ------ .../Crc32SectionExtract/Dxe/GuidedSection.c | 61 -------- .../Crc32SectionExtract/Dxe/GuidedSection.h | 54 ------- MdeModulePkg/Universal/RuntimeDxe/Runtime.c | 30 +--- MdeModulePkg/Universal/RuntimeDxe/Runtime.h | 16 ++ MdeModulePkg/Universal/RuntimeDxe/Runtime.inf | 4 +- .../VariablePei/Ipf/VariableWorker.c | 17 --- MdeModulePkg/Universal/VariablePei/Variable.c | 72 ++++----- MdeModulePkg/Universal/VariablePei/Variable.h | 30 ++-- .../Universal/VariablePei/Variable.inf | 53 +------ .../Universal/VariablePei/VariableWorker.c | 18 --- .../WatchDogTimerDxe/WatchDogTimer.c | 36 +---- .../WatchDogTimerDxe/WatchDogTimer.h | 26 +++- .../WatchDogTimerDxe/WatchDogTimer.inf | 52 +------ MdePkg/Include/Pi/PiMultiPhase.h | 9 ++ MdePkg/Include/Ppi/GuidedSectionExtraction.h | 7 - MdePkg/Include/Ppi/ReadOnlyVariable2.h | 4 +- ...nExtaction.h => GuidedSectionExtraction.h} | 0 MdePkg/Include/Protocol/SectionExtraction.h | 142 ++++++++++++++++++ MdePkg/Library/DxeMemoryLib/DxeMemoryLib.inf | 9 -- MdePkg/MdePkg.dec | 4 + Nt32Pkg/Nt32Pkg.dsc | 6 + 36 files changed, 415 insertions(+), 668 deletions(-) create mode 100644 MdeModulePkg/Include/Protocol/Crc32GuidedSectionExtraction.h delete mode 100644 MdeModulePkg/Universal/Capsule/RuntimeDxe/Capsule.c delete mode 100644 MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/GuidedSection.c delete mode 100644 MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/GuidedSection.h rename MdePkg/Include/Protocol/{GuidedSectionExtaction.h => GuidedSectionExtraction.h} (100%) create mode 100644 MdePkg/Include/Protocol/SectionExtraction.h diff --git a/EdkCompatibilityPkg/Foundation/Protocol/GuidedSectionExtraction/GuidedSectionExtraction.h b/EdkCompatibilityPkg/Foundation/Protocol/GuidedSectionExtraction/GuidedSectionExtraction.h index 9deb5c89be..83708b00df 100644 --- a/EdkCompatibilityPkg/Foundation/Protocol/GuidedSectionExtraction/GuidedSectionExtraction.h +++ b/EdkCompatibilityPkg/Foundation/Protocol/GuidedSectionExtraction/GuidedSectionExtraction.h @@ -51,7 +51,7 @@ EFI_FORWARD_DECLARATION (EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL); typedef EFI_STATUS (EFIAPI *EFI_EXTRACT_GUIDED_SECTION) ( - IN EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL * This, + IN EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *This, IN VOID *InputSection, OUT VOID **OutputBuffer, OUT UINTN *OutputSize, diff --git a/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaBus.inf b/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaBus.inf index c4d5177d15..704586180e 100644 --- a/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaBus.inf +++ b/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaBus.inf @@ -60,15 +60,6 @@ EntryPoint.c -################################################################################ -# -# Includes Section - list of Include locations that are required for -# this module. -# -################################################################################ - -[Includes] - ################################################################################ # # Package Dependency Section - list of Package files that are required for @@ -78,8 +69,8 @@ [Packages] MdePkg/MdePkg.dec - IntelFrameworkPkg/IntelFrameworkPkg.dec MdeModulePkg/MdeModulePkg.dec + IntelFrameworkPkg/IntelFrameworkPkg.dec IntelFrameworkModulePkg/IntelFrameworkModulePkg.dec diff --git a/IntelFrameworkPkg/Library/DxeBootScriptLibNull/DxeBootScriptLibNull.inf b/IntelFrameworkPkg/Library/DxeBootScriptLibNull/DxeBootScriptLibNull.inf index 7c54033367..5d7fdb5b69 100644 --- a/IntelFrameworkPkg/Library/DxeBootScriptLibNull/DxeBootScriptLibNull.inf +++ b/IntelFrameworkPkg/Library/DxeBootScriptLibNull/DxeBootScriptLibNull.inf @@ -48,15 +48,6 @@ BootScriptLib.c -################################################################################ -# -# Includes Section - list of Include locations that are required for -# this module. -# -################################################################################ - -[Includes] - ################################################################################ # # Package Dependency Section - list of Package files that are required for diff --git a/MdeModulePkg/Include/Protocol/Crc32GuidedSectionExtraction.h b/MdeModulePkg/Include/Protocol/Crc32GuidedSectionExtraction.h new file mode 100644 index 0000000000..6ef3b227ad --- /dev/null +++ b/MdeModulePkg/Include/Protocol/Crc32GuidedSectionExtraction.h @@ -0,0 +1,42 @@ +/** @file + This protocol implements a FV section extraction using a CRC32 encapsulation. + + The GUID defins the encapsulation scheme and the data structures come from + the SectionExtraction protocol definition. + + Copyright (c) 2006, 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 __CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_H__ +#define __CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_H__ + + +// +// Protocol GUID definition. Each GUIDed section extraction protocol has the +// same interface but with different GUID. All the GUIDs is defined here. +// May add multiple GUIDs here. +// +#define EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_GUID \ + { 0xFC1BCDB0, 0x7D31, 0x49aa, {0x93, 0x6A, 0xA4, 0x60, 0x0D, 0x9D, 0xD0, 0x83 } } + +// +// Forward reference for pure ANSI compatability +// +typedef struct _EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL EFI_CRC32_GUID_SECTION_EXTRACTION_PROTOCOL; + +// +// The data structures are the same as GuidedSectionExtraction protocol only the GUID's are different +// +#include + +extern EFI_GUID gEfiCrc32GuidedSectionExtractionProtocolGuid; + +#endif diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index ac6e2cfe90..6d4690507d 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -89,7 +89,8 @@ gEfiTianoDecompressProtocolGuid = { 0xE84CF29C, 0x191F, 0x4EAE, { 0x96, 0xE1, 0xF4, 0x6A, 0xEC, 0xEA, 0xEA, 0x0B }} gEfiCustomizedDecompressProtocolGuid = { 0x9A44198E, 0xA4A2, 0x44E6, { 0x8A, 0x1F, 0x39, 0xBE, 0xFD, 0xAC, 0x89, 0x6F }} gEfiCapsuleArchProtocolGuid = { 0x5053697E, 0x2EBC, 0x4819, { 0x90, 0xD9, 0x05, 0x80, 0xDE, 0xEE, 0x57, 0x54 }} - + gEfiCrc32GuidedSectionExtractionProtocolGuid = { 0xFC1BCDB0, 0x7D31, 0x49aa, {0x93, 0x6A, 0xA4, 0x60, 0x0D, 0x9D, 0xD0, 0x83 } } + diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc index 77290bc3ea..7379728bca 100644 --- a/MdeModulePkg/MdeModulePkg.dsc +++ b/MdeModulePkg/MdeModulePkg.dsc @@ -326,6 +326,10 @@ PcdMaxPeiPerformanceLogEntries|gEfiEdkModulePkgTokenSpaceGuid|28 PcdVpdBaseAddress|gEfiEdkModulePkgTokenSpaceGuid|0x0 PcdMaxPeiPcdCallBackNumberPerPcdEntry|gEfiEdkModulePkgTokenSpaceGuid|0x08 + PcdStatusCodeValueEfiWatchDogTimerExpired|gEfiMdePkgTokenSpaceGuid|0x00011003 # EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_TIMER_EXPIRED + PcdStatusCodeValueMemoryTestStarted|gEfiMdePkgTokenSpaceGuid|0x00051006 # EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_RS_PC_SET_VIRTUAL_ADDRESS_MAP + PcdStatusCodeValueSetVirtualAddressMap|gEfiMdePkgTokenSpaceGuid|0x03101004 # EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_PC_TEST + PcdStatusCodeValueUncorrectableMemoryError|gEfiMdePkgTokenSpaceGuid|0x0005100 # EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_UNCORRECTABLE3 [PcdsPatchableInModule.common] PcdDebugPrintErrorLevel|gEfiMdePkgTokenSpaceGuid|0x80000000 diff --git a/MdeModulePkg/Universal/BaseMemoryTestPei/BaseMemoryTest.c b/MdeModulePkg/Universal/BaseMemoryTestPei/BaseMemoryTest.c index 7b207b919d..f1ab82d87a 100644 --- a/MdeModulePkg/Universal/BaseMemoryTestPei/BaseMemoryTest.c +++ b/MdeModulePkg/Universal/BaseMemoryTestPei/BaseMemoryTest.c @@ -19,22 +19,6 @@ Abstract: --*/ -// -// The package level header files this module uses -// -#include -#include -// -// The protocols, PPI and GUID defintions for this module -// -#include -// -// The Library classes this module consumes -// -#include -#include -#include - #include static PEI_BASE_MEMORY_TEST_PPI mPeiBaseMemoryTestPpi = { BaseMemoryTest }; @@ -109,10 +93,7 @@ Returns: EFI_PHYSICAL_ADDRESS TempAddress; UINT32 SpanSize; - REPORT_STATUS_CODE ( - EFI_PROGRESS_CODE, - EFI_COMPUTING_UNIT_MEMORY + EFI_CU_MEMORY_PC_TEST - ); + REPORT_STATUS_CODE (EFI_PROGRESS_CODE, PcdGet32 (PcdStatusCodeValueMemoryTestStarted)); TestPattern = TEST_PATTERN; SpanSize = 0; @@ -151,10 +132,7 @@ Returns: while (TempAddress < BeginAddress + MemoryLength) { if ((*(UINT32 *) (UINTN) TempAddress) != TestPattern) { *ErrorAddress = TempAddress; - REPORT_STATUS_CODE ( - EFI_ERROR_CODE | EFI_ERROR_UNRECOVERED, - EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_UNCORRECTABLE - ); + REPORT_STATUS_CODE (EFI_ERROR_CODE | EFI_ERROR_UNRECOVERED, PcdGet32 (PcdStatusCodeValueUncorrectableMemoryError)); return EFI_DEVICE_ERROR; } diff --git a/MdeModulePkg/Universal/BaseMemoryTestPei/BaseMemoryTest.h b/MdeModulePkg/Universal/BaseMemoryTestPei/BaseMemoryTest.h index 791a66c54c..ed6081af11 100644 --- a/MdeModulePkg/Universal/BaseMemoryTestPei/BaseMemoryTest.h +++ b/MdeModulePkg/Universal/BaseMemoryTestPei/BaseMemoryTest.h @@ -22,6 +22,14 @@ Abstract: #ifndef _PEI_BASE_MEMORY_TEST_H_ #define _PEI_BASE_MEMORY_TEST_H_ +#include +#include +#include +#include +#include +#include + + // // Some global define // diff --git a/MdeModulePkg/Universal/BaseMemoryTestPei/BaseMemoryTest.inf b/MdeModulePkg/Universal/BaseMemoryTestPei/BaseMemoryTest.inf index 6010077de8..90d71e94ef 100644 --- a/MdeModulePkg/Universal/BaseMemoryTestPei/BaseMemoryTest.inf +++ b/MdeModulePkg/Universal/BaseMemoryTestPei/BaseMemoryTest.inf @@ -36,56 +36,22 @@ # VALID_ARCHITECTURES = IA32 X64 IPF EBC # -################################################################################ -# -# Sources Section - list of files that are required for the build to succeed. -# -################################################################################ - [Sources.common] BaseMemoryTest.c BaseMemoryTest.h - -################################################################################ -# -# Includes Section - list of Include locations that are required for -# this module. -# -################################################################################ - -################################################################################ -# -# Package Dependency Section - list of Package files that are required for -# this module. -# -################################################################################ - [Packages] MdePkg/MdePkg.dec - IntelFrameworkPkg/IntelFrameworkPkg.dec - - -################################################################################ -# -# Library Class Section - list of Library Classes that are required for -# this module. -# -################################################################################ [LibraryClasses] ReportStatusCodeLib PeimEntryPoint DebugLib - -################################################################################ -# -# PPI C Name Section - list of PPI and PPI Notify C Names that this module -# uses or produces. -# -################################################################################ - [Ppis] gPeiBaseMemoryTestPpiGuid # PPI ALWAYS_PRODUCED +[PcdsFixedAtBuild.common] + PcdStatusCodeValueMemoryTestStarted|gEfiMdePkgTokenSpaceGuid + PcdStatusCodeValueUncorrectableMemoryError|gEfiMdePkgTokenSpaceGuid + diff --git a/MdeModulePkg/Universal/Capsule/RuntimeDxe/Capsule.c b/MdeModulePkg/Universal/Capsule/RuntimeDxe/Capsule.c deleted file mode 100644 index 15736c6ca9..0000000000 --- a/MdeModulePkg/Universal/Capsule/RuntimeDxe/Capsule.c +++ /dev/null @@ -1,68 +0,0 @@ -/*++ - -Copyright (c) 2006, 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. - -Module Name: - - Capsule.c - -Abstract: - - Capsule Runtime Service Initialization - ---*/ - -#include "CapsuleService.h" - - -EFI_STATUS -EFIAPI -CapsuleServiceInitialize ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -/*++ - -Routine Description: - - This code is capsule runtime service initialization. - -Arguments: - - ImageHandle The image handle - SystemTable The system table. - -Returns: - - EFI STATUS - ---*/ -{ - EFI_STATUS Status; - EFI_HANDLE NewHandle; - - SystemTable->RuntimeServices->UpdateCapsule = UpdateCapsule; - SystemTable->RuntimeServices->QueryCapsuleCapabilities = QueryCapsuleCapabilities; - - // - // Now install the Capsule Architectural Protocol on a new handle - // - NewHandle = NULL; - - Status = gBS->InstallMultipleProtocolInterfaces ( - &NewHandle, - &gEfiCapsuleArchProtocolGuid, - NULL, - NULL - ); - ASSERT_EFI_ERROR (Status); - - return EFI_SUCCESS; -} diff --git a/MdeModulePkg/Universal/Capsule/RuntimeDxe/CapsuleRuntime.inf b/MdeModulePkg/Universal/Capsule/RuntimeDxe/CapsuleRuntime.inf index bdc91db1d7..61dae1b849 100644 --- a/MdeModulePkg/Universal/Capsule/RuntimeDxe/CapsuleRuntime.inf +++ b/MdeModulePkg/Universal/Capsule/RuntimeDxe/CapsuleRuntime.inf @@ -45,26 +45,9 @@ [Sources.common] CapsuleService.h CapsuleService.c - Capsule.c - - -################################################################################ -# -# Package Dependency Section - list of Package files that are required for -# this module. -# -################################################################################ [Packages] MdePkg/MdePkg.dec - IntelFrameworkPkg/IntelFrameworkPkg.dec - -################################################################################ -# -# Library Class Section - list of Library Classes that are required for -# this module. -# -################################################################################ [LibraryClasses] UefiBootServicesTableLib @@ -76,54 +59,18 @@ DxeServicesTableLib UefiDriverEntryPoint - -################################################################################ -# -# Guid C Name Section - list of Guids that this module uses or produces. -# -################################################################################ - [Guids] gEfiCapsuleVendorGuid # SOMETIMES_CONSUMED - gEfiCapsuleGuid - -################################################################################ -# -# Protocol C Name Section - list of Protocol and Protocol Notify C Names -# that this module uses or produces. -# -################################################################################ [Protocols] gEfiCapsuleArchProtocolGuid # PROTOCOL ALWAYS_CONSUMED - -################################################################################ -# -# Pcd FEATURE_FLAG - list of PCDs that this module is coded for. -# -################################################################################ - [PcdsFeatureFlag.common] PcdSupportUpdateCapsuleRest|gEfiEdkModulePkgTokenSpaceGuid - -################################################################################ -# -# Pcd FIXED_AT_BUILD - list of PCDs that this module is coded for. -# -################################################################################ - [PcdsFixedAtBuild.common] PcdMaxSizeNonPopulateCapsule|gEfiEdkModulePkgTokenSpaceGuid PcdMaxSizePopulateCapsule|gEfiEdkModulePkgTokenSpaceGuid -################################################################################ -# -# Dependency Expression Section - list of Dependency expressions that are required for -# this module. -# -################################################################################ - [Depex] gEfiVariableArchProtocolGuid diff --git a/MdeModulePkg/Universal/Capsule/RuntimeDxe/CapsuleService.c b/MdeModulePkg/Universal/Capsule/RuntimeDxe/CapsuleService.c index 7370eb4198..5a923cda34 100644 --- a/MdeModulePkg/Universal/Capsule/RuntimeDxe/CapsuleService.c +++ b/MdeModulePkg/Universal/Capsule/RuntimeDxe/CapsuleService.c @@ -65,19 +65,13 @@ Returns: BufferPtr = NULL; CapsuleHeader = NULL; - // - //Compare GUIDs with EFI_CAPSULE_GUID, if capsule header contains CAPSULE_FLAGS_PERSIST_ACROSS_RESET - //and CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE flags,whatever the GUID is ,the service supports. - // for (ArrayNumber = 0; ArrayNumber < CapsuleCount; ArrayNumber++) { CapsuleHeader = CapsuleHeaderArray[ArrayNumber]; if ((CapsuleHeader->Flags & (CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE)) == CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) { return EFI_INVALID_PARAMETER; } - if (!CompareGuid (&CapsuleHeader->CapsuleGuid, &gEfiCapsuleGuid)) { - if ((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) == 0) { - return EFI_UNSUPPORTED; - } + if ((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) == 0) { + return EFI_UNSUPPORTED; } } @@ -193,19 +187,13 @@ Returns: CapsuleHeader = NULL; - // - //Compare GUIDs with EFI_CAPSULE_GUID, if capsule header contains CAPSULE_FLAGS_PERSIST_ACROSS_RESET - //and CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE flags,whatever the GUID is ,the service supports. - // for (ArrayNumber = 0; ArrayNumber < CapsuleCount; ArrayNumber++) { CapsuleHeader = CapsuleHeaderArray[ArrayNumber]; if ((CapsuleHeader->Flags & (CAPSULE_FLAGS_PERSIST_ACROSS_RESET | CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE)) == CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) { return EFI_INVALID_PARAMETER; } - if (!CompareGuid (&CapsuleHeader->CapsuleGuid, &gEfiCapsuleGuid)) { - if ((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) == 0) { - return EFI_UNSUPPORTED; - } + if ((CapsuleHeader->Flags & CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE) == 0) { + return EFI_UNSUPPORTED; } } @@ -229,3 +217,48 @@ Returns: return EFI_SUCCESS; } + +EFI_STATUS +EFIAPI +CapsuleServiceInitialize ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +/*++ + +Routine Description: + + This code is capsule runtime service initialization. + +Arguments: + + ImageHandle The image handle + SystemTable The system table. + +Returns: + + EFI STATUS + +--*/ +{ + EFI_STATUS Status; + EFI_HANDLE NewHandle; + + SystemTable->RuntimeServices->UpdateCapsule = UpdateCapsule; + SystemTable->RuntimeServices->QueryCapsuleCapabilities = QueryCapsuleCapabilities; + + // + // Now install the Capsule Architectural Protocol on a new handle + // + NewHandle = NULL; + + Status = gBS->InstallMultipleProtocolInterfaces ( + &NewHandle, + &gEfiCapsuleArchProtocolGuid, + NULL, + NULL + ); + ASSERT_EFI_ERROR (Status); + + return EFI_SUCCESS; +} diff --git a/MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/Crc32SectionExtract.c b/MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/Crc32SectionExtract.c index de9ba8372f..ca5ee21fe7 100644 --- a/MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/Crc32SectionExtract.c +++ b/MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/Crc32SectionExtract.c @@ -23,9 +23,44 @@ Abstract: --*/ -#include #include +EFI_STATUS +GuidedSectionExtractionProtocolConstructor ( + OUT EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL **GuidedSep, + IN EFI_EXTRACT_GUIDED_SECTION ExtractSection + ) +/*++ + +Routine Description: + + Constructor for the GUIDed section extraction protocol. Initializes + instance data. + +Arguments: + + This Instance to construct + +Returns: + + EFI_SUCCESS: Instance initialized. + +--*/ +// TODO: GuidedSep - add argument and description to function comment +// TODO: ExtractSection - add argument and description to function comment +// TODO: EFI_OUT_OF_RESOURCES - add return value to function comment +{ + *GuidedSep = AllocatePool (sizeof (EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL)); + if (*GuidedSep == NULL) { + return EFI_OUT_OF_RESOURCES; + } + + (*GuidedSep)->ExtractSection = ExtractSection; + + return EFI_SUCCESS; +} + + EFI_STATUS EFIAPI InitializeCrc32GuidedSectionExtractionProtocol ( @@ -206,21 +241,21 @@ Crc32ExtractSection ( // Implictly CRC32 GUIDed section should have STATUS_VALID bit set // ASSERT (GuidedSectionHeader->Attributes & EFI_GUIDED_SECTION_AUTH_STATUS_VALID); - *AuthenticationStatus = EFI_LOCAL_AUTH_STATUS_IMAGE_SIGNED | EFI_AGGREGATE_AUTH_STATUS_IMAGE_SIGNED; + *AuthenticationStatus = EFI_AUTH_STATUS_IMAGE_SIGNED; // // Check whether there exists EFI_SECURITY_POLICY_PROTOCOL_GUID. // Status = gBS->LocateProtocol (&gEfiSecurityPolicyProtocolGuid, NULL, &DummyInterface); if (!EFI_ERROR (Status)) { - *AuthenticationStatus |= EFI_LOCAL_AUTH_STATUS_PLATFORM_OVERRIDE | EFI_AGGREGATE_AUTH_STATUS_PLATFORM_OVERRIDE; + *AuthenticationStatus |= EFI_AUTH_STATUS_PLATFORM_OVERRIDE; } else { // // Calculate CRC32 Checksum of Image // gBS->CalculateCrc32 (Image, *OutputSize, &Crc32Checksum); if (Crc32Checksum != Crc32SectionHeader->CRC32Checksum) { - *AuthenticationStatus |= EFI_LOCAL_AUTH_STATUS_TEST_FAILED | EFI_AGGREGATE_AUTH_STATUS_TEST_FAILED; + *AuthenticationStatus |= EFI_AUTH_STATUS_TEST_FAILED; } } diff --git a/MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/Crc32SectionExtract.h b/MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/Crc32SectionExtract.h index 65fb0a27ab..e7bf276a35 100644 --- a/MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/Crc32SectionExtract.h +++ b/MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/Crc32SectionExtract.h @@ -23,26 +23,17 @@ Abstract: #ifndef _CRC32_GUIDED_SECTION_EXTRACTION_H #define _CRC32_GUIDED_SECTION_EXTRACTION_H -// -// The package level header files this module uses -// #include -#include -// -// The protocols, PPI and GUID defintions for this module -// #include -#include #include -// -// The Library classes this module consumes -// #include #include #include #include #include + + typedef struct { EFI_GUID_DEFINED_SECTION GuidedSectionHeader; UINT32 CRC32Checksum; diff --git a/MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/Crc32SectionExtract.inf b/MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/Crc32SectionExtract.inf index 9bce71f76b..5b0c65dbce 100644 --- a/MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/Crc32SectionExtract.inf +++ b/MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/Crc32SectionExtract.inf @@ -14,11 +14,6 @@ # #**/ -################################################################################ -# -# Defines Section - statements that will be processed to create a Makefile. -# -################################################################################ [Defines] INF_VERSION = 0x00010005 BASE_NAME = Crc32SectionExtract @@ -36,36 +31,12 @@ # VALID_ARCHITECTURES = IA32 X64 IPF EBC # -################################################################################ -# -# Sources Section - list of files that are required for the build to succeed. -# -################################################################################ - [Sources.common] - GuidedSection.h - GuidedSection.c Crc32SectionExtract.h Crc32SectionExtract.c - -################################################################################ -# -# Package Dependency Section - list of Package files that are required for -# this module. -# -################################################################################ - [Packages] MdePkg/MdePkg.dec - IntelFrameworkPkg/IntelFrameworkPkg.dec - -################################################################################ -# -# Library Class Section - list of Library Classes that are required for -# this module. -# -################################################################################ [LibraryClasses] MemoryAllocationLib @@ -74,24 +45,9 @@ UefiDriverEntryPoint DebugLib - -################################################################################ -# -# Protocol C Name Section - list of Protocol and Protocol Notify C Names -# that this module uses or produces. -# -################################################################################ - [Protocols] gEfiSecurityPolicyProtocolGuid # PROTOCOL SOMETIMES_CONSUMED gEfiCrc32GuidedSectionExtractionProtocolGuid # PROTOCOL ALWAYS_PRODUCED -################################################################################ -# -# Dependency Expression Section - list of Dependency expressions that are required for -# this module. -# -################################################################################ - [Depex] gEfiRuntimeArchProtocolGuid diff --git a/MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/GuidedSection.c b/MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/GuidedSection.c deleted file mode 100644 index 87605cc055..0000000000 --- a/MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/GuidedSection.c +++ /dev/null @@ -1,61 +0,0 @@ -/*++ - -Copyright (c) 2006 - 2007, 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. - -Module Name: - - GuidedSection.c - -Abstract: - - GUIDed section extraction protocol implementation. - This contains the common constructor of GUIDed section - extraction protocol. GUID specific implementation of each - GUIDed section extraction protocol can be found in other - files under the same directory. - ---*/ - -#include "GuidedSection.h" - -EFI_STATUS -GuidedSectionExtractionProtocolConstructor ( - OUT EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL **GuidedSep, - IN EFI_EXTRACT_GUIDED_SECTION ExtractSection - ) -/*++ - -Routine Description: - - Constructor for the GUIDed section extraction protocol. Initializes - instance data. - -Arguments: - - This Instance to construct - -Returns: - - EFI_SUCCESS: Instance initialized. - ---*/ -// TODO: GuidedSep - add argument and description to function comment -// TODO: ExtractSection - add argument and description to function comment -// TODO: EFI_OUT_OF_RESOURCES - add return value to function comment -{ - *GuidedSep = AllocatePool (sizeof (EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL)); - if (*GuidedSep == NULL) { - return EFI_OUT_OF_RESOURCES; - } - - (*GuidedSep)->ExtractSection = ExtractSection; - - return EFI_SUCCESS; -} diff --git a/MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/GuidedSection.h b/MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/GuidedSection.h deleted file mode 100644 index d6613b0f4b..0000000000 --- a/MdeModulePkg/Universal/FirmwareVolume/GuidedSectionExtraction/Crc32SectionExtract/Dxe/GuidedSection.h +++ /dev/null @@ -1,54 +0,0 @@ -/*++ - -Copyright (c) 2006 - 2007, 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. - -Module Name: - - GuidedSection.h - -Abstract: - - Header file for GuidedSection.c - Please refer to the Framewokr Firmware Volume Specification 0.9. - ---*/ - -#ifndef _GUIDED_SECTION_EXTRACTION_H -#define _GUIDED_SECTION_EXTRACTION_H - -#include "Crc32SectionExtract.h" - -// -// Function prototype declarations -// -EFI_STATUS -GuidedSectionExtractionProtocolConstructor ( - OUT EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL **GuidedSep, - IN EFI_EXTRACT_GUIDED_SECTION ExtractSection - ) -/*++ - -Routine Description: - - TODO: Add function description - -Arguments: - - GuidedSep - TODO: add argument description - ExtractSection - TODO: add argument description - -Returns: - - TODO: add return values - ---*/ -; - -#endif diff --git a/MdeModulePkg/Universal/RuntimeDxe/Runtime.c b/MdeModulePkg/Universal/RuntimeDxe/Runtime.c index 4bf2e402a3..c2c0242962 100644 --- a/MdeModulePkg/Universal/RuntimeDxe/Runtime.c +++ b/MdeModulePkg/Universal/RuntimeDxe/Runtime.c @@ -51,31 +51,6 @@ Revision History: --*/ -// -// The package level header files this module uses -// -#include -#include -// -// The protocols, PPI and GUID defintions for this module -// -#include -#include -#include - -// -// The Library classes this module consumes -// -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "Runtime.h" // @@ -333,10 +308,7 @@ Returns: // check whether in Runtime or not (this is judged by looking at // mEfiAtRuntime global So this ReportStatusCode will work // - REPORT_STATUS_CODE ( - EFI_PROGRESS_CODE, - (EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_RS_PC_SET_VIRTUAL_ADDRESS_MAP) - ); + REPORT_STATUS_CODE (EFI_PROGRESS_CODE, PcdGet32 (PcdStatusCodeValueSetVirtualAddressMap)); // // Signal all the EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE events. diff --git a/MdeModulePkg/Universal/RuntimeDxe/Runtime.h b/MdeModulePkg/Universal/RuntimeDxe/Runtime.h index c2e4b39666..7154b53cdf 100644 --- a/MdeModulePkg/Universal/RuntimeDxe/Runtime.h +++ b/MdeModulePkg/Universal/RuntimeDxe/Runtime.h @@ -24,6 +24,22 @@ Abstract: #ifndef _RUNTIME_H_ #define _RUNTIME_H_ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + // // Function Prototypes // diff --git a/MdeModulePkg/Universal/RuntimeDxe/Runtime.inf b/MdeModulePkg/Universal/RuntimeDxe/Runtime.inf index 288e5d0766..e535fb1c8d 100644 --- a/MdeModulePkg/Universal/RuntimeDxe/Runtime.inf +++ b/MdeModulePkg/Universal/RuntimeDxe/Runtime.inf @@ -66,7 +66,6 @@ [Packages] MdePkg/MdePkg.dec - IntelFrameworkPkg/IntelFrameworkPkg.dec ################################################################################ @@ -108,3 +107,6 @@ gEfiRuntimeArchProtocolGuid # PROTOCOL ALWAYS_PRODUCED gEfiLoadedImageProtocolGuid # PROTOCOL ALWAYS_CONSUMED +[PcdsFixedAtBuild.common] + PcdStatusCodeValueSetVirtualAddressMap|gEfiMdePkgTokenSpaceGuid + \ No newline at end of file diff --git a/MdeModulePkg/Universal/VariablePei/Ipf/VariableWorker.c b/MdeModulePkg/Universal/VariablePei/Ipf/VariableWorker.c index 912aab1182..0a4ee95774 100644 --- a/MdeModulePkg/Universal/VariablePei/Ipf/VariableWorker.c +++ b/MdeModulePkg/Universal/VariablePei/Ipf/VariableWorker.c @@ -11,23 +11,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ -// -// The package level header files this module uses -// -#include - -// -// The protocols, PPI and GUID defintions for this module -// -#include -// -// The Library classes this module consumes -// -#include -#include -#include -#include -#include #include diff --git a/MdeModulePkg/Universal/VariablePei/Variable.c b/MdeModulePkg/Universal/VariablePei/Variable.c index b56e315e69..ba8a23d67a 100644 --- a/MdeModulePkg/Universal/VariablePei/Variable.c +++ b/MdeModulePkg/Universal/VariablePei/Variable.c @@ -18,38 +18,20 @@ Abstract: --*/ -// -// The package level header files this module uses -// -#include -// -// The protocols, PPI and GUID defintions for this module -// -#include -// -// The Library classes this module consumes -// -#include -#include -#include -#include -#include - - -#include +#include "Variable.h" // // Module globals // -static EFI_PEI_READ_ONLY_VARIABLE_PPI mVariablePpi = { +static EFI_PEI_READ_ONLY_VARIABLE2_PPI mVariablePpi = { PeiGetVariable, PeiGetNextVariableName }; static EFI_PEI_PPI_DESCRIPTOR mPpiListVariable = { (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST), - &gEfiPeiReadOnlyVariablePpiGuid, + &gEfiPeiReadOnlyVariable2PpiGuid, &mVariablePpi }; @@ -187,10 +169,10 @@ Returns: STATIC EFI_STATUS CompareWithValidVariable ( - IN VARIABLE_HEADER *Variable, - IN CHAR16 *VariableName, - IN EFI_GUID *VendorGuid, - OUT VARIABLE_POINTER_TRACK *PtrTrack + IN VARIABLE_HEADER *Variable, + IN CONST CHAR16 *VariableName, + IN CONST EFI_GUID *VendorGuid, + OUT VARIABLE_POINTER_TRACK *PtrTrack ) /*++ @@ -242,8 +224,8 @@ EFI_STATUS EFIAPI FindVariable ( IN EFI_PEI_SERVICES **PeiServices, - IN CHAR16 *VariableName, - IN EFI_GUID *VendorGuid, + IN CONST CHAR16 *VariableName, + IN CONST EFI_GUID *VendorGuid, OUT VARIABLE_POINTER_TRACK *PtrTrack ) /*++ @@ -380,12 +362,12 @@ Returns: EFI_STATUS EFIAPI PeiGetVariable ( - IN EFI_PEI_SERVICES **PeiServices, - IN CHAR16 *VariableName, - IN EFI_GUID * VendorGuid, - OUT UINT32 *Attributes OPTIONAL, - IN OUT UINTN *DataSize, - OUT VOID *Data + IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This, + IN CONST CHAR16 *VariableName, + IN CONST EFI_GUID *VariableGuid, + OUT UINT32 *Attributes, + IN OUT UINTN *DataSize, + OUT VOID *Data ) /*++ @@ -420,15 +402,16 @@ Returns: VARIABLE_POINTER_TRACK Variable; UINTN VarDataSize; EFI_STATUS Status; + EFI_PEI_SERVICES **PeiServices; - if (VariableName == NULL || VendorGuid == NULL) { + PeiServices = GetPeiServicesTablePointer (); + if (VariableName == NULL || VariableGuid == NULL) { return EFI_INVALID_PARAMETER; } // // Find existing variable // - Status = FindVariable (PeiServices, VariableName, VendorGuid, &Variable); - + Status = FindVariable (PeiServices, VariableName, VariableGuid, &Variable); if (Variable.CurrPtr == NULL || Status != EFI_SUCCESS) { return Status; } @@ -454,10 +437,10 @@ Returns: EFI_STATUS EFIAPI PeiGetNextVariableName ( - IN EFI_PEI_SERVICES **PeiServices, - IN OUT UINTN *VariableNameSize, - IN OUT CHAR16 *VariableName, - IN OUT EFI_GUID *VendorGuid + IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This, + IN OUT UINTN *VariableNameSize, + IN OUT CHAR16 *VariableName, + IN OUT EFI_GUID *VariableGuid ) /*++ @@ -470,7 +453,7 @@ Arguments: PeiServices - General purpose services available to every PEIM. VariabvleNameSize - The variable name's size. VariableName - A pointer to the variable's name. - VendorGuid - A pointer to the EFI_GUID structure. + VariableGuid - A pointer to the EFI_GUID structure. VariableNameSize - Size of the variable name @@ -489,13 +472,14 @@ Returns: VARIABLE_POINTER_TRACK Variable; UINTN VarNameSize; EFI_STATUS Status; + EFI_PEI_SERVICES **PeiServices; + PeiServices = GetPeiServicesTablePointer (); if (VariableName == NULL) { return EFI_INVALID_PARAMETER; } - Status = FindVariable (PeiServices, VariableName, VendorGuid, &Variable); - + Status = FindVariable (PeiServices, VariableName, VariableGuid, &Variable); if (Variable.CurrPtr == NULL || Status != EFI_SUCCESS) { return Status; } @@ -514,7 +498,7 @@ Returns: if (VarNameSize <= *VariableNameSize) { (*PeiServices)->CopyMem (VariableName, GET_VARIABLE_NAME_PTR (Variable.CurrPtr), VarNameSize); - (*PeiServices)->CopyMem (VendorGuid, &Variable.CurrPtr->VendorGuid, sizeof (EFI_GUID)); + (*PeiServices)->CopyMem (VariableGuid, &Variable.CurrPtr->VendorGuid, sizeof (EFI_GUID)); Status = EFI_SUCCESS; } else { diff --git a/MdeModulePkg/Universal/VariablePei/Variable.h b/MdeModulePkg/Universal/VariablePei/Variable.h index 187edbaf7d..9747a8d426 100644 --- a/MdeModulePkg/Universal/VariablePei/Variable.h +++ b/MdeModulePkg/Universal/VariablePei/Variable.h @@ -22,6 +22,16 @@ Abstract: #ifndef _PEI_VARIABLE_H #define _PEI_VARIABLE_H +#include +#include +#include +#include +#include +#include +#include +#include + + // // BugBug: We need relcate the head file. // @@ -91,12 +101,12 @@ Returns: EFI_STATUS EFIAPI PeiGetVariable ( - IN EFI_PEI_SERVICES **PeiServices, - IN CHAR16 *VariableName, - IN EFI_GUID * VendorGuid, - OUT UINT32 *Attributes OPTIONAL, - IN OUT UINTN *DataSize, - OUT VOID *Data + IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This, + IN CONST CHAR16 *VariableName, + IN CONST EFI_GUID *VariableGuid, + OUT UINT32 *Attributes, + IN OUT UINTN *DataSize, + OUT VOID *Data ) /*++ @@ -123,10 +133,10 @@ Returns: EFI_STATUS EFIAPI PeiGetNextVariableName ( - IN EFI_PEI_SERVICES **PeiServices, - IN OUT UINTN *VariableNameSize, - IN OUT CHAR16 *VariableName, - IN OUT EFI_GUID *VendorGuid + IN CONST EFI_PEI_READ_ONLY_VARIABLE2_PPI *This, + IN OUT UINTN *VariableNameSize, + IN OUT CHAR16 *VariableName, + IN OUT EFI_GUID *VariableGuid ) /*++ diff --git a/MdeModulePkg/Universal/VariablePei/Variable.inf b/MdeModulePkg/Universal/VariablePei/Variable.inf index 5151c4bf4b..434c2991c8 100644 --- a/MdeModulePkg/Universal/VariablePei/Variable.inf +++ b/MdeModulePkg/Universal/VariablePei/Variable.inf @@ -14,11 +14,6 @@ # #**/ -################################################################################ -# -# Defines Section - statements that will be processed to create a Makefile. -# -################################################################################ [Defines] INF_VERSION = 0x00010005 BASE_NAME = PeiVariable @@ -36,12 +31,6 @@ # VALID_ARCHITECTURES = IA32 X64 IPF EBC # -################################################################################ -# -# Sources Section - list of files that are required for the build to succeed. -# -################################################################################ - [Sources.common] Variable.c Variable.h @@ -58,26 +47,9 @@ [Sources.EBC] VariableWorker.c - -################################################################################ -# -# Package Dependency Section - list of Package files that are required for -# this module. -# -################################################################################ - [Packages] MdePkg/MdePkg.dec MdeModulePkg/MdeModulePkg.dec - IntelFrameworkPkg/IntelFrameworkPkg.dec - - -################################################################################ -# -# Library Class Section - list of Library Classes that are required for -# this module. -# -################################################################################ [LibraryClasses] BaseMemoryLib @@ -85,34 +57,13 @@ HobLib PeimEntryPoint DebugLib - - -################################################################################ -# -# PPI C Name Section - list of PPI and PPI Notify C Names that this module -# uses or produces. -# -################################################################################ + PeiServiceTablePointerLib [Ppis] - gEfiPeiReadOnlyVariablePpiGuid # PPI ALWAYS_CONSUMED - - -################################################################################ -# -# Pcd DYNAMIC - list of PCDs that this module is coded for. -# -################################################################################ + gEfiPeiReadOnlyVariable2PpiGuid # PPI ALWAYS_CONSUMED [PcdsDynamic.common] PcdFlashNvStorageVariableBase|gEfiGenericPlatformTokenSpaceGuid -################################################################################ -# -# Dependency Expression Section - list of Dependency expressions that are required for -# this module. -# -################################################################################ - [Depex] TRUE diff --git a/MdeModulePkg/Universal/VariablePei/VariableWorker.c b/MdeModulePkg/Universal/VariablePei/VariableWorker.c index 5cb75d03ef..1a49ee8c98 100644 --- a/MdeModulePkg/Universal/VariablePei/VariableWorker.c +++ b/MdeModulePkg/Universal/VariablePei/VariableWorker.c @@ -18,24 +18,6 @@ Abstract: Framework PEIM to provide the Variable functionality --*/ -// -// The package level header files this module uses -// -#include - -// -// The protocols, PPI and GUID defintions for this module -// -#include -// -// The Library classes this module consumes -// -#include -#include -#include -#include -#include - #include diff --git a/MdeModulePkg/Universal/WatchDogTimerDxe/WatchDogTimer.c b/MdeModulePkg/Universal/WatchDogTimerDxe/WatchDogTimer.c index ec43aec283..76289087bc 100644 --- a/MdeModulePkg/Universal/WatchDogTimerDxe/WatchDogTimer.c +++ b/MdeModulePkg/Universal/WatchDogTimerDxe/WatchDogTimer.c @@ -21,24 +21,6 @@ Revision History --*/ -// -// The package level header files this module uses -// -#include -#include -// -// The protocols, PPI and GUID defintions for this module -// -// -// The Library classes this module consumes -// -#include -#include -#include -#include -#include -#include - #include "WatchDogTimer.h" // @@ -103,13 +85,7 @@ WatchdogTimerDriverExpires ( --*/ { - // - // Report error code before exiting - // - REPORT_STATUS_CODE ( - EFI_ERROR_CODE | EFI_ERROR_MINOR, - (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_TIMER_EXPIRED) - ); + REPORT_STATUS_CODE (EFI_ERROR_CODE | EFI_ERROR_MINOR, PcdGet32 (PcdStatusCodeValueEfiWatchDogTimerExpired)); // // If a notification function has been registered, then call it @@ -123,6 +99,7 @@ WatchdogTimerDriverExpires ( gRT->ResetSystem (EfiResetCold, EFI_TIMEOUT, 0, NULL); } + EFI_STATUS EFIAPI WatchdogTimerDriverRegisterHandler ( @@ -288,10 +265,6 @@ Returns: { EFI_STATUS Status; - REPORT_STATUS_CODE ( - EFI_PROGRESS_CODE, - (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_SW_PC_INIT_BEGIN) - ); // // Make sure the Watchdog Timer Architectural Protocol is not already installed in the system // @@ -320,10 +293,5 @@ Returns: ); ASSERT_EFI_ERROR (Status); - REPORT_STATUS_CODE ( - EFI_PROGRESS_CODE, - (EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_SW_PC_INIT_END) - ); - return Status; } diff --git a/MdeModulePkg/Universal/WatchDogTimerDxe/WatchDogTimer.h b/MdeModulePkg/Universal/WatchDogTimerDxe/WatchDogTimer.h index bb1936b90e..2c8c33a8cb 100644 --- a/MdeModulePkg/Universal/WatchDogTimerDxe/WatchDogTimer.h +++ b/MdeModulePkg/Universal/WatchDogTimerDxe/WatchDogTimer.h @@ -24,6 +24,20 @@ Revision History #ifndef _WATCHDOG_TIMER_H_ #define _WATCHDOG_TIMER_H_ + +// +// The package level header files this module uses +// +#include +#include +#include +#include +#include +#include +#include +#include + + // // Function Prototypes // @@ -32,31 +46,27 @@ EFIAPI WatchdogTimerDriverRegisterHandler ( IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This, IN EFI_WATCHDOG_TIMER_NOTIFY NotifyFunction - ) -; + ); EFI_STATUS EFIAPI WatchdogTimerDriverSetTimerPeriod ( IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This, IN UINT64 TimerPeriod - ) -; + ); EFI_STATUS EFIAPI WatchdogTimerDriverGetTimerPeriod ( IN EFI_WATCHDOG_TIMER_ARCH_PROTOCOL *This, IN UINT64 *TimerPeriod - ) -; + ); EFI_STATUS EFIAPI WatchdogTimerDriverInitialize ( IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable - ) -; + ); #endif diff --git a/MdeModulePkg/Universal/WatchDogTimerDxe/WatchDogTimer.inf b/MdeModulePkg/Universal/WatchDogTimerDxe/WatchDogTimer.inf index 7c3984d488..5c9f3dfa4b 100644 --- a/MdeModulePkg/Universal/WatchDogTimerDxe/WatchDogTimer.inf +++ b/MdeModulePkg/Universal/WatchDogTimerDxe/WatchDogTimer.inf @@ -14,11 +14,6 @@ # #**/ -################################################################################ -# -# Defines Section - statements that will be processed to create a Makefile. -# -################################################################################ [Defines] INF_VERSION = 0x00010005 BASE_NAME = WatchDogTimer @@ -36,35 +31,13 @@ # VALID_ARCHITECTURES = IA32 X64 IPF EBC # -################################################################################ -# -# Sources Section - list of files that are required for the build to succeed. -# -################################################################################ +[Packages] + MdePkg/MdePkg.dec [Sources.common] WatchDogTimer.h WatchDogTimer.c - -################################################################################ -# -# Package Dependency Section - list of Package files that are required for -# this module. -# -################################################################################ - -[Packages] - MdePkg/MdePkg.dec - IntelFrameWorkPkg/IntelFrameworkPkg.dec - -################################################################################ -# -# Library Class Section - list of Library Classes that are required for -# this module. -# -################################################################################ - [LibraryClasses] UefiRuntimeServicesTableLib UefiBootServicesTableLib @@ -72,22 +45,13 @@ UefiDriverEntryPoint DebugLib - -################################################################################ -# -# Protocol C Name Section - list of Protocol and Protocol Notify C Names -# that this module uses or produces. -# -################################################################################ - [Protocols] gEfiWatchdogTimerArchProtocolGuid # PROTOCOL ALWAYS_PRODUCED -################################################################################ -# -# Dependency Expression Section - list of Dependency expressions that are required for -# this module. -# -################################################################################ +[PcdsFixedAtBuild.common] + PcdStatusCodeValueEfiWatchDogTimerExpired|gEfiMdePkgTokenSpaceGuid + [depex] - gEfiTimerArchProtocolGuid \ No newline at end of file + gEfiTimerArchProtocolGuid + + \ No newline at end of file diff --git a/MdePkg/Include/Pi/PiMultiPhase.h b/MdePkg/Include/Pi/PiMultiPhase.h index 6c956374b8..d9bb3e303c 100644 --- a/MdePkg/Include/Pi/PiMultiPhase.h +++ b/MdePkg/Include/Pi/PiMultiPhase.h @@ -86,4 +86,13 @@ typedef struct { EFI_GUID Type; } EFI_STATUS_CODE_DATA; + +// +// Bit values for AuthenticationStatus +// +#define EFI_AUTH_STATUS_PLATFORM_OVERRIDE 0x01 +#define EFI_AUTH_STATUS_IMAGE_SIGNED 0x02 +#define EFI_AUTH_STATUS_NOT_TESTED 0x04 +#define EFI_AUTH_STATUS_TEST_FAILED 0x08 + #endif diff --git a/MdePkg/Include/Ppi/GuidedSectionExtraction.h b/MdePkg/Include/Ppi/GuidedSectionExtraction.h index a5be7740c2..80b1ee1210 100644 --- a/MdePkg/Include/Ppi/GuidedSectionExtraction.h +++ b/MdePkg/Include/Ppi/GuidedSectionExtraction.h @@ -37,13 +37,6 @@ typedef struct _EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI EFI_PEI_GUIDED_SECTION_EXTRACTION_PPI; -// -// Bit values for AuthenticationStatus -// -#define EFI_AUTH_STATUS_PLATFORM_OVERRIDE 0x01 -#define EFI_AUTH_STATUS_IMAGE_SIGNED 0x02 -#define EFI_AUTH_STATUS_NOT_TESTED 0x04 -#define EFI_AUTH_STATUS_TEST_FAILED 0x08 /** The ExtractSection() function processes the input section and diff --git a/MdePkg/Include/Ppi/ReadOnlyVariable2.h b/MdePkg/Include/Ppi/ReadOnlyVariable2.h index 03e7796188..f4f85086ca 100644 --- a/MdePkg/Include/Ppi/ReadOnlyVariable2.h +++ b/MdePkg/Include/Ppi/ReadOnlyVariable2.h @@ -69,7 +69,7 @@ EFI_STATUS OUT UINT32 *Attributes, IN OUT UINTN *DataSize, OUT VOID *Data -); + ); /** @@ -112,7 +112,7 @@ EFI_STATUS IN OUT UINTN *VariableNameSize, IN OUT CHAR16 *VariableName, IN OUT EFI_GUID *VariableGuid -); + ); /** This PPI provides a lightweight, read-only variant of the full EFI diff --git a/MdePkg/Include/Protocol/GuidedSectionExtaction.h b/MdePkg/Include/Protocol/GuidedSectionExtraction.h similarity index 100% rename from MdePkg/Include/Protocol/GuidedSectionExtaction.h rename to MdePkg/Include/Protocol/GuidedSectionExtraction.h diff --git a/MdePkg/Include/Protocol/SectionExtraction.h b/MdePkg/Include/Protocol/SectionExtraction.h new file mode 100644 index 0000000000..2210887d35 --- /dev/null +++ b/MdePkg/Include/Protocol/SectionExtraction.h @@ -0,0 +1,142 @@ +/** @file + This file declares Section Extraction protocol. + + The section extraction protocol is referenced in the PI 1.0 specification, but + not defined. It will likely be added in an eratta update. + + Copyright (c) 2006, Intel Corporation + All rights reserved. This program and the 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 __SECTION_EXTRACTION_PROTOCOL_H__ +#define __SECTION_EXTRACTION_PROTOCOL_H__ + + + +typedef struct _EFI_SECTION_EXTRACTION_PROTOCOL EFI_SECTION_EXTRACTION_PROTOCOL; + +// +// Protocol member functions +// +/** + Creates and returns a new section stream handle to represent the new section stream. + + @param This Indicates the EFI_SECTION_EXTRACTION_PROTOCOL instance. + @param SectionStreamLength Size in bytes of the section stream. + @param SectionStream Buffer containing the new section stream. + @param SectionStreamHandle A pointer to a caller-allocated UINTN that, + on output, contains the new section stream handle. + + @retval EFI_SUCCESS The SectionStream was successfully processed and + the section stream handle was returned. + @retval EFI_OUT_OF_RESOURCES The system has insufficient resources to + process the request. + @retval EFI_INVALID_PARAMETER The section stream may be corrupt or the value + of SectionStreamLength may be incorrect. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_OPEN_SECTION_STREAM) ( + IN EFI_SECTION_EXTRACTION_PROTOCOL *This, + IN UINTN SectionStreamLength, + IN VOID *SectionStream, + OUT UINTN *SectionStreamHandle + ); + +/** + Reads and returns a single section from a section stream. + + @param This Indicates the EFI_SECTION_EXTRACTION_PROTOCOL instance. + @param SectionStreamHandle Indicates from which section stream to read. + @param SectionType Pointer to an EFI_SECTION_TYPE. + @param SectionDefinitionGuid Pointer to an EFI_GUID.If SectionType == + EFI_SECTION_GUID_DEFINED, SectionDefinitionGuid indicates what section GUID + to search for.If SectionType !=EFI_SECTION_GUID_DEFINED, then + SectionDefinitionGuid is unused and is ignored. + @param SectionInstance Indicates which instance of the requested section + type to return when SectionType is not NULL. + @param SectionStreamHandle A pointer to a caller-allocated UINTN that, on output, + contains the new section stream handle. + @param Buffer Pointer to a pointer to a buffer in which the section + contents are returned. + @param BufferSize Pointer to a caller-allocated UINTN. + @param AuthenticationStatus Pointer to a caller-allocated UINT32 in + which any meta-data from encapsulation GUID-defined sections is returned. + + @retval EFI_SUCCESS The SectionStream was successfully processed and + the section contents were returned in Buffer. + @retval EFI_PROTOCOL_ERROR A GUID-defined section was encountered in + the section stream with its EFI_GUIDED_SECTION_PROCESSING_REQUIRED bit set, + but there was no corresponding GUIDed Section Extraction Protocol in + the handle database. + @retval EFI_NOT_FOUND An error was encountered when parsing the SectionStream, + which indicates that the SectionStream is not correctly formatted. + Or The requested section does not exist. + @retval EFI_OUT_OF_RESOURCES The system has insufficient resources to process + the request. + @retval EFI_INVALID_PARAMETER The SectionStreamHandle does not exist. + @retval EFI_BUFFER_TOO_SMALL The size of the input buffer is insufficient to + contain the requested section. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_GET_SECTION) ( + IN EFI_SECTION_EXTRACTION_PROTOCOL *This, + IN UINTN SectionStreamHandle, + IN EFI_SECTION_TYPE *SectionType, + IN EFI_GUID *SectionDefinitionGuid, + IN UINTN SectionInstance, + IN VOID **Buffer, + IN OUT UINTN *BufferSize, + OUT UINT32 *AuthenticationStatus + ); + +/** + Deletes a section stream handle and returns all associated resources to the system. + + @param This Indicates the EFI_SECTION_EXTRACTION_PROTOCOL instance. + @param SectionStreamHandle Indicates the section stream to close. + @retval EFI_SUCCESS The SectionStream was successfully processed and + the section stream handle was returned. + @retval EFI_INVALID_PARAMETER The SectionStreamHandle does not exist. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_CLOSE_SECTION_STREAM) ( + IN EFI_SECTION_EXTRACTION_PROTOCOL *This, + IN UINTN SectionStreamHandle + ); + +/** + @par Protocol Description: + The Section Extraction Protocol provides a simple method of extracting + sections from arbitrarily complex files. + + @param OpenSectionStream + Takes a bounded stream of sections and returns a section stream handle. + + @param GetSection + Given a section stream handle, retrieves the requested section and + meta-data from the section stream. + + @param CloseSectionStream + Given a section stream handle, closes the section stream. + +**/ +struct _EFI_SECTION_EXTRACTION_PROTOCOL { + EFI_OPEN_SECTION_STREAM OpenSectionStream; + EFI_GET_SECTION GetSection; + EFI_CLOSE_SECTION_STREAM CloseSectionStream; +}; + +#endif diff --git a/MdePkg/Library/DxeMemoryLib/DxeMemoryLib.inf b/MdePkg/Library/DxeMemoryLib/DxeMemoryLib.inf index 3cc3f59819..11d4a0c2c7 100644 --- a/MdePkg/Library/DxeMemoryLib/DxeMemoryLib.inf +++ b/MdePkg/Library/DxeMemoryLib/DxeMemoryLib.inf @@ -61,15 +61,6 @@ MemLibInternals.h -################################################################################ -# -# Includes Section - list of Include locations that are required for -# this module. -# -################################################################################ - -[Includes] - ################################################################################ # # Package Dependency Section - list of Package files that are required for diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 9669aa6780..5c2f7a7048 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -315,6 +315,10 @@ PcdPciExpressBaseAddress|0x0000000a|gEfiMdePkgTokenSpaceGuid|UINT64|0xE0000000 PcdFSBClock|0x0000000c|gEfiMdePkgTokenSpaceGuid|UINT32|200000000 PcdUefiLibMaxPrintBufferSize|0x101|gEfiMdePkgTokenSpaceGuid|UINT32|320 + PcdStatusCodeValueEfiWatchDogTimerExpired|0x0000000d|gEfiMdePkgTokenSpaceGuid|UINT32|0x00011003 # EFI_COMPUTING_UNIT_HOST_PROCESSOR | EFI_CU_HP_EC_TIMER_EXPIRED + PcdStatusCodeValueSetVirtualAddressMap|0x0000000e|gEfiMdePkgTokenSpaceGuid|UINT32|0x03101004 # EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_RS_PC_SET_VIRTUAL_ADDRESS_MAP + PcdStatusCodeValueMemoryTestStarted|0x0000000f|gEfiMdePkgTokenSpaceGuid|UINT32|0x00051006 # EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_PC_TEST + PcdStatusCodeValueUncorrectableMemoryError|0x00000010|gEfiMdePkgTokenSpaceGuid|UINT32|0x00051003 # EFI_COMPUTING_UNIT_MEMORY | EFI_CU_MEMORY_EC_UNCORRECTABLE [PcdsPatchableInModule.common] PcdDebugPrintErrorLevel|0x00000006|gEfiMdePkgTokenSpaceGuid|UINT32|0x80000000 diff --git a/Nt32Pkg/Nt32Pkg.dsc b/Nt32Pkg/Nt32Pkg.dsc index bb6487953f..d4a9dddd80 100644 --- a/Nt32Pkg/Nt32Pkg.dsc +++ b/Nt32Pkg/Nt32Pkg.dsc @@ -271,6 +271,12 @@ PcdPciIsaEnable|gEfiIntelFrameworkModulePkgTokenSpaceGuid|FALSE PcdPciVgaEnable|gEfiIntelFrameworkModulePkgTokenSpaceGuid|FALSE PcdPciBusHotplugDeviceSupport|gEfiIntelFrameworkModulePkgTokenSpaceGuid|TRUE + PcdStatusCodeValueEfiWatchDogTimerExpired|gEfiMdePkgTokenSpaceGuid|0x00011003 + PcdStatusCodeValueMemoryTestStarted|gEfiMdePkgTokenSpaceGuid|0x00051006 + PcdStatusCodeValueSetVirtualAddressMap|gEfiMdePkgTokenSpaceGuid|0x03101004 + PcdStatusCodeValueUncorrectableMemoryError|gEfiMdePkgTokenSpaceGuid|0x00051003 + + ################################################################################ # -- 2.39.2