summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg
diff options
context:
space:
mode:
authorklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2007-12-10 03:47:56 +0000
committerklu2 <klu2@6f19259b-4bc3-4df7-8a09-765794883524>2007-12-10 03:47:56 +0000
commit797a9d6791a7529c20c7b10f2843e9f38ed5a6a5 (patch)
tree8af8218c32963366e55a3f9757b34f02a8d0b44d /MdeModulePkg
parent256a0cc3c2cb522246e8a9555887b8f50705771e (diff)
downloadedk2-797a9d6791a7529c20c7b10f2843e9f38ed5a6a5.tar.gz
edk2-797a9d6791a7529c20c7b10f2843e9f38ed5a6a5.tar.bz2
edk2-797a9d6791a7529c20c7b10f2843e9f38ed5a6a5.zip
MdeModule cleanup for PI:
1) PeiMain: - Use PCD for bundle of status code which definitions are put into MdePkg.dec file. 2) DxeMain: - Use PCD for bundle of status code which definitions are put into MdePkg.dec file. - Do not produce SectionExtraction protocol which is belong to IntelFramework specification. - Update many macro for PI specifications. 3) DxeIpl - Use PCD for bundle of status code which definitions are put into MdePkg.dec file. 4) Add SectionExtractionDxe module (IntelFrameworkModulePkg) - This module will produce EFI_SECTION_EXTRACTION_PROTOCOL defined in framework specification. If a old platform want to use this protocol, then this platform need dispatch this DXE driver. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4376 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg')
-rw-r--r--MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c41
-rw-r--r--MdeModulePkg/Core/Dxe/DxeMain.h52
-rw-r--r--MdeModulePkg/Core/Dxe/DxeMain.inf9
-rw-r--r--MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c19
-rw-r--r--MdeModulePkg/Core/Dxe/FwVol/FwVol.c4
-rw-r--r--MdeModulePkg/Core/Dxe/FwVol/FwVolRead.c39
-rw-r--r--MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c25
-rw-r--r--MdeModulePkg/Core/Dxe/FwVolDriver.h18
-rw-r--r--MdeModulePkg/Core/Dxe/Library/Library.c23
-rw-r--r--MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c130
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/DxeIpl.h15
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf4
-rw-r--r--MdeModulePkg/Core/DxeIplPeim/DxeLoad.c3
-rw-r--r--MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c27
-rw-r--r--MdeModulePkg/Core/Pei/FwVol/FwVol.c4
-rw-r--r--MdeModulePkg/Core/Pei/PeiMain.h2
-rw-r--r--MdeModulePkg/Core/Pei/PeiMain.inf3
-rw-r--r--MdeModulePkg/Core/Pei/PeiMain/PeiMain.c2
18 files changed, 152 insertions, 268 deletions
diff --git a/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c
index bb49686875..9c99442e7a 100644
--- a/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c
+++ b/MdeModulePkg/Core/Dxe/Dispatcher/Dispatcher.c
@@ -1,21 +1,5 @@
-/*++
-
-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:
-
- Dispatcher.c
-
-Abstract:
-
- Tiano DXE Dispatcher.
+/**@file
+ DXE Dispatcher.
Step #1 - When a FV protocol is added to the system every driver in the FV
is added to the mDiscoveredList. The SOR, Before, and After Depex are
@@ -42,7 +26,16 @@ Abstract:
Depex - Dependency Expresion.
SOR - Schedule On Request - Don't schedule if this bit is set.
---*/
+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.
+
+**/
#include <DxeMain.h>
@@ -490,9 +483,15 @@ Returns:
CoreReleaseDispatcherLock ();
- CoreReportProgressCodeSpecific (EFI_SOFTWARE_DXE_CORE | EFI_SW_PC_INIT_BEGIN, DriverEntry->ImageHandle);
+ CoreReportProgressCodeSpecific (
+ FixedPcdGet32(PcdStatusCodeValueDxeDriverBegin),
+ DriverEntry->ImageHandle
+ );
Status = CoreStartImage (DriverEntry->ImageHandle, NULL, NULL);
- CoreReportProgressCodeSpecific (EFI_SOFTWARE_DXE_CORE | EFI_SW_PC_INIT_END, DriverEntry->ImageHandle);
+ CoreReportProgressCodeSpecific (
+ FixedPcdGet32(PcdStatusCodeValueDxeDriverEnd),
+ DriverEntry->ImageHandle
+ );
ReturnStatus = EFI_SUCCESS;
}
diff --git a/MdeModulePkg/Core/Dxe/DxeMain.h b/MdeModulePkg/Core/Dxe/DxeMain.h
index 2490979a70..765db57f0c 100644
--- a/MdeModulePkg/Core/Dxe/DxeMain.h
+++ b/MdeModulePkg/Core/Dxe/DxeMain.h
@@ -1,5 +1,6 @@
-/*++
-
+/**@file
+ Header file of DxeCore
+
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
@@ -9,15 +10,7 @@ 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:
-
- DxeMain.h
-
-Abstract:
-
-Revision History
-
---*/
+**/
#ifndef _DXE_MAIN_H_
#define _DXE_MAIN_H_
@@ -25,11 +18,9 @@ Revision History
#include <PiDxe.h>
-#include <FrameworkPei.h>
#include <Protocol/LoadedImage.h>
#include <Protocol/GuidedSectionExtraction.h>
-#include <Protocol/SectionExtraction.h>
#include <Guid/DebugImageInfoTable.h>
#include <Protocol/DevicePath.h>
#include <Protocol/Runtime.h>
@@ -69,7 +60,6 @@ Revision History
#include <Protocol/Capsule.h>
#include <Protocol/BusSpecificDriverOverride.h>
#include <Protocol/Performance.h>
-#include <Guid/StatusCodeDataTypeId.h>
#include <Library/DxeCoreEntryPoint.h>
#include <Library/DebugLib.h>
@@ -82,6 +72,7 @@ Revision History
#include <Library/CacheMaintenanceLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/PeCoffLib.h>
+#include <Library/PcdLib.h>
#include <Library/MemoryAllocationLib.h>
#include "DebugImageInfo.h"
@@ -133,6 +124,13 @@ typedef struct {
BOOLEAN Present;
} ARCHITECTURAL_PROTOCOL_ENTRY;
+typedef struct {
+ EFI_STATUS_CODE_DATA DataHeader;
+ EFI_HANDLE Handle;
+} EFI_DXE_DEVICE_HANDLE_EXTENDED_DATA;
+
+#define EFI_STATUS_CODE_DXE_CORE_GUID \
+ { 0x335984bd, 0xe805, 0x409a, { 0xb8, 0xf8, 0xd2, 0x7e, 0xce, 0x5f, 0xf7, 0xa6 } }
//
// DXE Dispatcher Data structures
@@ -2839,4 +2837,30 @@ DxeMainCustomDecompress (
IN UINT32 ScratchSize
);
+EFI_STATUS
+EFIAPI
+OpenSectionStream (
+ IN UINTN SectionStreamLength,
+ IN VOID *SectionStream,
+ OUT UINTN *SectionStreamHandle
+ );
+
+EFI_STATUS
+EFIAPI
+GetSection (
+ 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
+ );
+
+EFI_STATUS
+EFIAPI
+CloseSectionStream (
+ IN UINTN StreamHandleToClose
+ );
+
#endif
diff --git a/MdeModulePkg/Core/Dxe/DxeMain.inf b/MdeModulePkg/Core/Dxe/DxeMain.inf
index ce6d55f654..3bd6762c63 100644
--- a/MdeModulePkg/Core/Dxe/DxeMain.inf
+++ b/MdeModulePkg/Core/Dxe/DxeMain.inf
@@ -73,7 +73,6 @@
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
- IntelFrameworkPkg/IntelFrameworkPkg.dec
[LibraryClasses]
BaseMemoryLib
@@ -134,4 +133,10 @@
gEfiDevicePathProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiLoadedImageProtocolGuid # PROTOCOL ALWAYS_PRODUCED
gEfiEbcProtocolGuid # PROTOCOL SOMETIMES_CONSUMED
- gEfiSectionExtractionProtocolGuid # PROTOCOL ALWAYS_PRODUCED
+
+[FixedPcd.common]
+ gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValueDxeCoreEntry | 0x3041000 # EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_PC_ENTRY_POINT
+ gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValueDxeCoreHandoffToBds | 0x3041001 # EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_PC_HANDOFF_TO_NEXT
+ gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValueBootServiceExit | 0x3100019 # EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_BS_PC_EXIT_BOOT_SERVICES
+ gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValueDxeDriverBegin | 0x3040002 # EFI_SOFTWARE_DXE_CORE | EFI_SW_PC_INIT_BEGIN
+ gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValueDxeDriverEnd | 0x3040003 # EFI_SOFTWARE_DXE_CORE | EFI_SW_PC_INIT_END \ No newline at end of file
diff --git a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
index 58bdb8b8c0..87d98e8b02 100644
--- a/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
+++ b/MdeModulePkg/Core/Dxe/DxeMain/DxeMain.c
@@ -1,5 +1,6 @@
-/*++
+/**@file
+ DXE Core Main Entry Point
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
@@ -9,15 +10,7 @@ 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:
-
- DxeMain.c
-
-Abstract:
-
- DXE Core Main Entry Point
-
---*/
+**/
#include <DxeMain.h>
@@ -328,7 +321,7 @@ Returns:
//
// Report Status Code here for DXE_ENTRY_POINT once it is available
//
- CoreReportProgressCode ((EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_PC_ENTRY_POINT));
+ CoreReportProgressCode (FixedPcdGet32(PcdStatusCodeValueDxeCoreEntry));
//
// Create the aligned system table pointer structure that is used by external
@@ -423,7 +416,7 @@ Returns:
//
// Report Status code before transfer control to BDS
//
- CoreReportProgressCode ((EFI_SOFTWARE_DXE_CORE | EFI_SW_DXE_CORE_PC_HANDOFF_TO_NEXT));
+ CoreReportProgressCode (FixedPcdGet32 (PcdStatusCodeValueDxeCoreHandoffToBds));
//
// Display any drivers that were not dispatched because dependency expression
// evaluated to false if this is a debug build
@@ -789,7 +782,7 @@ Returns:
//
// We are using gEfiCallerIdGuid as the caller ID for Dxe Core
//
- CoreReportProgressCode ((EFI_SOFTWARE_EFI_BOOT_SERVICE | EFI_SW_BS_PC_EXIT_BOOT_SERVICES));
+ CoreReportProgressCode (FixedPcdGet32 (PcdStatusCodeValueBootServiceExit));
//
// Clear the non-runtime values of the EFI System Table
diff --git a/MdeModulePkg/Core/Dxe/FwVol/FwVol.c b/MdeModulePkg/Core/Dxe/FwVol/FwVol.c
index c89dc8c2ed..60c5fa19a2 100644
--- a/MdeModulePkg/Core/Dxe/FwVol/FwVol.c
+++ b/MdeModulePkg/Core/Dxe/FwVol/FwVol.c
@@ -151,7 +151,7 @@ Returns:
//
// Close stream and free resources from SEP
//
- FfsFileEntry->Sep->CloseSectionStream (FfsFileEntry->Sep, FfsFileEntry->StreamHandle);
+ CloseSectionStream (FfsFileEntry->StreamHandle);
}
CoreFreePool (FfsFileEntry);
@@ -281,7 +281,7 @@ Returns:
//
// Scan to check the free space & File list
//
- if (FvbAttributes & EFI_FVB_ERASE_POLARITY) {
+ if (FvbAttributes & EFI_FVB2_ERASE_POLARITY) {
FvDevice->ErasePolarity = 1;
} else {
FvDevice->ErasePolarity = 0;
diff --git a/MdeModulePkg/Core/Dxe/FwVol/FwVolRead.c b/MdeModulePkg/Core/Dxe/FwVol/FwVolRead.c
index 59df02e11d..becc19e999 100644
--- a/MdeModulePkg/Core/Dxe/FwVol/FwVolRead.c
+++ b/MdeModulePkg/Core/Dxe/FwVol/FwVolRead.c
@@ -413,7 +413,6 @@ FvReadFileSection (
EFI_FV_FILE_ATTRIBUTES FileAttributes;
UINTN FileSize;
UINT8 *FileBuffer;
- EFI_SECTION_EXTRACTION_PROTOCOL *Sep;
FFS_FILE_LIST_ENTRY *FfsEntry;
if (NULL == NameGuid || Buffer == NULL) {
@@ -456,17 +455,7 @@ FvReadFileSection (
// Use FfsEntry to cache Section Extraction Protocol Inforomation
//
if (FfsEntry->StreamHandle == 0) {
- //
- // Located the protocol
- //
- Status = CoreLocateProtocol (&gEfiSectionExtractionProtocolGuid, NULL, (VOID **)&Sep);
- //
- // Section Extraction Protocol is part of Dxe Core so this should never fail
- //
- ASSERT_EFI_ERROR (Status);
-
- Status = Sep->OpenSectionStream (
- Sep,
+ Status = OpenSectionStream (
FileSize,
FileBuffer,
&FfsEntry->StreamHandle
@@ -474,28 +463,20 @@ FvReadFileSection (
if (EFI_ERROR (Status)) {
goto Done;
}
-
- FfsEntry->Sep = Sep;
- } else {
- //
- // Get cached copy of Sep
- //
- Sep = FfsEntry->Sep;
}
//
// If SectionType == 0 We need the whole section stream
//
- Status = Sep->GetSection (
- Sep,
- FfsEntry->StreamHandle,
- (SectionType == 0) ? NULL : &SectionType,
- NULL,
- (SectionType == 0) ? 0 : SectionInstance,
- Buffer,
- BufferSize,
- AuthenticationStatus
- );
+ Status = GetSection (
+ FfsEntry->StreamHandle,
+ (SectionType == 0) ? NULL : &SectionType,
+ NULL,
+ (SectionType == 0) ? 0 : SectionInstance,
+ Buffer,
+ BufferSize,
+ AuthenticationStatus
+ );
//
// Close of stream defered to close of FfsHeader list to allow SEP to cache data
diff --git a/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c b/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c
index e90a10bfdc..bdac781776 100644
--- a/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c
+++ b/MdeModulePkg/Core/Dxe/FwVolBlock/FwVolBlock.c
@@ -1,5 +1,10 @@
-/*++
+/**@file
+ Firmware Volume Block protocol.. Consumes FV hobs and creates
+ appropriate block protocols.
+ Also consumes NT_NON_MM_FV envinronment variable and produces appropriate
+ block protocols fro them also... (this is TBD)
+
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
@@ -9,19 +14,7 @@ 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:
-
- FwVolBlock.c
-
-Abstract:
-
- Firmware Volume Block protocol.. Consumes FV hobs and creates
- appropriate block protocols.
-
- Also consumes NT_NON_MM_FV envinronment variable and produces appropriate
- block protocols fro them also... (this is TBD)
-
---*/
+**/
#include <DxeMain.h>
@@ -202,7 +195,7 @@ Returns:
//
// Check if This FW can be read
//
- if ((FvbDevice->FvbAttributes & EFI_FVB_READ_STATUS) == 0) {
+ if ((FvbDevice->FvbAttributes & EFI_FVB2_READ_STATUS) == 0) {
return EFI_ACCESS_DENIED;
}
@@ -310,7 +303,7 @@ Returns:
FvbDevice = FVB_DEVICE_FROM_THIS (This);
- if (FvbDevice->FvbAttributes & EFI_FVB_MEMORY_MAPPED) {
+ if (FvbDevice->FvbAttributes & EFI_FVB2_MEMORY_MAPPED) {
*Address = FvbDevice->BaseAddress;
return EFI_SUCCESS;
}
diff --git a/MdeModulePkg/Core/Dxe/FwVolDriver.h b/MdeModulePkg/Core/Dxe/FwVolDriver.h
index fe70090630..27492b8077 100644
--- a/MdeModulePkg/Core/Dxe/FwVolDriver.h
+++ b/MdeModulePkg/Core/Dxe/FwVolDriver.h
@@ -1,5 +1,7 @@
-/*++
-
+/**@file
+ Firmware File System protocol. Layers on top of Firmware
+ Block protocol to produce a file abstraction of FV based files.
+
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
@@ -9,16 +11,7 @@ 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:
-
- FwVolDriver.h
-
-Abstract:
-
- Firmware File System protocol. Layers on top of Firmware
- Block protocol to produce a file abstraction of FV based files.
-
---*/
+**/
#ifndef __FWVOL_H
#define __FWVOL_H
@@ -33,7 +26,6 @@ typedef struct {
LIST_ENTRY Link;
EFI_FFS_FILE_HEADER *FfsHeader;
UINTN StreamHandle;
- EFI_SECTION_EXTRACTION_PROTOCOL *Sep;
} FFS_FILE_LIST_ENTRY;
typedef struct {
diff --git a/MdeModulePkg/Core/Dxe/Library/Library.c b/MdeModulePkg/Core/Dxe/Library/Library.c
index b7c9097000..b0f9a0f55d 100644
--- a/MdeModulePkg/Core/Dxe/Library/Library.c
+++ b/MdeModulePkg/Core/Dxe/Library/Library.c
@@ -1,6 +1,7 @@
-/*++
-
-Copyright (c) 2006, Intel Corporation
+/**@file
+ DXE Core library services.
+
+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
@@ -9,25 +10,17 @@ 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:
-
- Library.c
-
-Abstract:
-
- DXE Core library services.
-
---*/
+**/
#include <DxeMain.h>
UINTN mErrorLevel = EFI_D_ERROR | EFI_D_LOAD;
-EFI_DEVICE_HANDLE_EXTENDED_DATA mStatusCodeData = {
+EFI_DXE_DEVICE_HANDLE_EXTENDED_DATA mStatusCodeData = {
{
sizeof (EFI_STATUS_CODE_DATA),
0,
- EFI_STATUS_CODE_SPECIFIC_DATA_GUID
+ EFI_STATUS_CODE_DXE_CORE_GUID
},
NULL
};
@@ -57,7 +50,7 @@ Returns:
--*/
{
- mStatusCodeData.DataHeader.Size = sizeof (EFI_DEVICE_HANDLE_EXTENDED_DATA) - sizeof (EFI_STATUS_CODE_DATA);
+ mStatusCodeData.DataHeader.Size = sizeof (EFI_DXE_DEVICE_HANDLE_EXTENDED_DATA) - sizeof (EFI_STATUS_CODE_DATA);
mStatusCodeData.Handle = Handle;
if ((gStatusCode != NULL) && (gStatusCode->ReportStatusCode != NULL) ) {
diff --git a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c
index 1a98e97e9a..fcc5565040 100644
--- a/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c
+++ b/MdeModulePkg/Core/Dxe/SectionExtraction/CoreSectionExtraction.c
@@ -1,20 +1,4 @@
-/*++
-
-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:
-
- CoreSectionExtraction.c
-
-Abstract:
-
+/**@file
Section Extraction Protocol implementation.
Stream database is implemented as a linked list of section streams,
@@ -42,8 +26,17 @@ Abstract:
3) A support protocol is not found, and the data is not available to be read
without it. This results in EFI_PROTOCOL_ERROR.
-
---*/
+
+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.
+
+**/
#include <DxeMain.h>
@@ -133,38 +126,6 @@ CreateGuidedExtractionRpnEvent (
STATIC
EFI_STATUS
-EFIAPI
-OpenSectionStream (
- IN EFI_SECTION_EXTRACTION_PROTOCOL *This,
- IN UINTN SectionStreamLength,
- IN VOID *SectionStream,
- OUT UINTN *SectionStreamHandle
- );
-
-STATIC
-EFI_STATUS
-EFIAPI
-GetSection (
- 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
- );
-
-STATIC
-EFI_STATUS
-EFIAPI
-CloseSectionStream (
- IN EFI_SECTION_EXTRACTION_PROTOCOL *This,
- IN UINTN StreamHandleToClose
- );
-
-STATIC
-EFI_STATUS
FindStreamNode (
IN UINTN SearchHandle,
OUT CORE_SECTION_STREAM_NODE **FoundStream
@@ -214,8 +175,9 @@ IsValidSectionStream (
);
EFI_STATUS
+EFIAPI
CustomGuidedSectionExtract (
- IN CONST EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *This,
+ IN CONST EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *This,
IN CONST VOID *InputSection,
OUT VOID **OutputBuffer,
OUT UINTN *OutputSize,
@@ -228,12 +190,6 @@ LIST_ENTRY mStreamRoot = INITIALIZE_LIST_HEAD_VARIABLE (mStreamRoot);
EFI_HANDLE mSectionExtractionHandle = NULL;
-EFI_SECTION_EXTRACTION_PROTOCOL mSectionExtraction = {
- OpenSectionStream,
- GetSection,
- CloseSectionStream
-};
-
EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL mCustomGuidedSectionExtractionProtocol = {
CustomGuidedSectionExtract
};
@@ -265,21 +221,11 @@ Returns:
UINTN ExtractHandlerNumber;
//
- // Install SEP to a new handle
- //
- Status = CoreInstallProtocolInterface (
- &mSectionExtractionHandle,
- &gEfiSectionExtractionProtocolGuid,
- EFI_NATIVE_INTERFACE,
- &mSectionExtraction
- );
- ASSERT_EFI_ERROR (Status);
-
- //
// Get custom extract guided section method guid list
//
ExtractHandlerNumber = ExtractGuidedSectionGetGuidList (&ExtractHandlerGuidTable);
-
+
+ Status = EFI_SUCCESS;
//
// Install custom guided extraction protocol
//
@@ -296,11 +242,9 @@ Returns:
return Status;
}
-STATIC
EFI_STATUS
EFIAPI
OpenSectionStream (
- IN EFI_SECTION_EXTRACTION_PROTOCOL *This,
IN UINTN SectionStreamLength,
IN VOID *SectionStream,
OUT UINTN *SectionStreamHandle
@@ -342,11 +286,9 @@ Returns:
);
}
-STATIC
EFI_STATUS
EFIAPI
GetSection (
- IN EFI_SECTION_EXTRACTION_PROTOCOL *This,
IN UINTN SectionStreamHandle,
IN EFI_SECTION_TYPE *SectionType,
IN EFI_GUID *SectionDefinitionGuid,
@@ -361,7 +303,6 @@ Routine Description:
SEP member function. Retrieves requested section from section stream.
Arguments:
- This: Pointer to SEP instance.
SectionStreamHandle: The section stream from which to extract the requested
section.
SectionType: A pointer to the type of section to search for.
@@ -485,11 +426,9 @@ GetSection_Done:
}
-STATIC
EFI_STATUS
EFIAPI
CloseSectionStream (
- IN EFI_SECTION_EXTRACTION_PROTOCOL *This,
IN UINTN StreamHandleToClose
)
/*++
@@ -922,7 +861,7 @@ Returns:
//
// OR in the parent stream's aggregate status.
//
- AuthenticationStatus |= Stream->AuthenticationStatus & EFI_AGGREGATE_AUTH_STATUS_ALL;
+ AuthenticationStatus |= Stream->AuthenticationStatus & EFI_AUTH_STATUS_ALL;
} else {
//
// since there's no authentication data contributed by the section,
@@ -959,23 +898,6 @@ Returns:
// Figure out the proper authentication status
//
AuthenticationStatus = Stream->AuthenticationStatus;
- if (GuidedHeader->Attributes & EFI_GUIDED_SECTION_AUTH_STATUS_VALID) {
- //
- // The local status of the new stream is contained in
- // AuthenticaionStatus. This value needs to be ORed into the
- // Aggregate bits also...
- //
-
- //
- // Clear out and initialize the local status
- //
- AuthenticationStatus &= ~EFI_LOCAL_AUTH_STATUS_ALL;
- AuthenticationStatus |= EFI_LOCAL_AUTH_STATUS_IMAGE_SIGNED | EFI_LOCAL_AUTH_STATUS_NOT_TESTED;
- //
- // OR local status into aggregate status
- //
- AuthenticationStatus |= AuthenticationStatus >> 16;
- }
SectionLength = SECTION_SIZE (GuidedHeader);
Status = OpenSectionStreamEx (
@@ -991,17 +913,6 @@ Returns:
}
}
- if ((AuthenticationStatus & EFI_LOCAL_AUTH_STATUS_ALL) ==
- (EFI_LOCAL_AUTH_STATUS_IMAGE_SIGNED | EFI_LOCAL_AUTH_STATUS_NOT_TESTED)) {
- //
- // Need to register for RPN for when the required GUIDed extraction
- // protocol becomes available. This will enable us to refresh the
- // AuthenticationStatus cached in the Stream if it's ever requested
- // again.
- //
- CreateGuidedExtractionRpnEvent (Stream, Node);
- }
-
break;
default:
@@ -1097,7 +1008,7 @@ Returns:
Context = RpnContext;
- Status = CloseSectionStream (&mSectionExtraction, Context->ChildNode->EncapsulatedStreamHandle);
+ Status = CloseSectionStream (Context->ChildNode->EncapsulatedStreamHandle);
if (!EFI_ERROR (Status)) {
//
// The stream closed successfully, so re-open the stream with correct AuthenticationStatus
@@ -1122,7 +1033,7 @@ Returns:
//
// OR in the parent stream's aggregagate status.
//
- AuthenticationStatus |= Context->ParentStream->AuthenticationStatus & EFI_AGGREGATE_AUTH_STATUS_ALL;
+ AuthenticationStatus |= Context->ParentStream->AuthenticationStatus & EFI_AUTH_STATUS_ALL;
Status = OpenSectionStreamEx (
NewStreamBufferSize,
NewStreamBuffer,
@@ -1173,7 +1084,7 @@ Returns:
// If it's an encapsulating section, we close the resulting section stream.
// CloseSectionStream will free all memory associated with the stream.
//
- CloseSectionStream (&mSectionExtraction, ChildNode->EncapsulatedStreamHandle);
+ CloseSectionStream (ChildNode->EncapsulatedStreamHandle);
}
//
// Last, free the child node itself
@@ -1454,6 +1365,7 @@ Returns:
**/
EFI_STATUS
+EFIAPI
CustomGuidedSectionExtract (
IN CONST EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *This,
IN CONST VOID *InputSection,
diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.h b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.h
index bd7e905099..67e8114034 100644
--- a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.h
+++ b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.h
@@ -1,6 +1,6 @@
-/*++
+/**@file
-Copyright (c) 2006, Intel Corporation
+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
@@ -9,13 +9,7 @@ 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:
-
- DxeIpl.h
-
-Abstract:
-
---*/
+**/
#ifndef __PEI_DXEIPL_H__
#define __PEI_DXEIPL_H__
@@ -26,9 +20,6 @@ Abstract:
#include <Ppi/EndOfPeiPhase.h>
#include <Protocol/CustomizedDecompress.h>
#include <Protocol/Decompress.h>
-#include <Ppi/Security.h>
-#include <Ppi/SectionExtraction.h>
-#include <Ppi/FvLoadFile.h>
#include <Ppi/MemoryDiscovered.h>
#include <Ppi/ReadOnlyVariable2.h>
#include <Guid/MemoryTypeInformation.h>
diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
index b9b4b32aeb..9b960923a7 100644
--- a/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
+++ b/MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
@@ -59,7 +59,6 @@
[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
- IntelFrameworkPkg/IntelFrameworkPkg.dec
[LibraryClasses]
PeCoffLib
@@ -102,7 +101,8 @@
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplEnableIdt
gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode
-
+[FixedPcd.common]
+ gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValuePeiHandoffToDxe
[Depex]
gEfiPeiMemoryDiscoveredPpiGuid
diff --git a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
index 65d0e86d75..7358d49f3c 100644
--- a/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
+++ b/MdeModulePkg/Core/DxeIplPeim/DxeLoad.c
@@ -15,7 +15,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "DxeIpl.h"
#include <Ppi/GuidedSectionExtraction.h>
-#include <FrameworkPei.h>
EFI_STATUS
CustomGuidedSectionExtract (
@@ -258,7 +257,7 @@ DxeLoadCore (
//
REPORT_STATUS_CODE (
EFI_PROGRESS_CODE,
- EFI_SOFTWARE_PEI_MODULE | EFI_SW_PEI_CORE_PC_HANDOFF_TO_NEXT
+ PcdGet32(PcdStatusCodeValuePeiHandoffToDxe)
);
DEBUG_CODE_BEGIN ();
diff --git a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
index 5a140ed7bd..73a6245b7e 100644
--- a/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
+++ b/MdeModulePkg/Core/Pei/Dispatcher/Dispatcher.c
@@ -23,6 +23,11 @@ Revision History
#include <PeiMain.h>
+typedef struct {
+ EFI_STATUS_CODE_DATA DataHeader;
+ EFI_HANDLE Handle;
+} PEIM_FILE_HANDLE_EXTENDED_DATA;
+
STATIC
VOID
InvokePeiCore (
@@ -223,7 +228,7 @@ Returns:
UINTN PeimCount;
UINT32 AuthenticationState;
EFI_PHYSICAL_ADDRESS EntryPoint;
- EFI_PEIM_ENTRY_POINT PeimEntryPoint;
+ EFI_PEIM_ENTRY_POINT2 PeimEntryPoint;
BOOLEAN PeimNeedingDispatch;
BOOLEAN PeimDispatchOnThisPass;
UINTN SaveCurrentPeimCount;
@@ -231,7 +236,7 @@ Returns:
EFI_PEI_FILE_HANDLE SaveCurrentFileHandle;
VOID *TopOfStack;
PEI_CORE_PARAMETERS PeiCoreParameters;
- EFI_DEVICE_HANDLE_EXTENDED_DATA ExtendedData;
+ PEIM_FILE_HANDLE_EXTENDED_DATA ExtendedData;
EFI_FV_FILE_INFO FvFileInfo;
@@ -270,10 +275,10 @@ Returns:
//
// Call the PEIM entry point
//
- PeimEntryPoint = (EFI_PEIM_ENTRY_POINT)(UINTN)EntryPoint;
+ PeimEntryPoint = (EFI_PEIM_ENTRY_POINT2)(UINTN)EntryPoint;
PERF_START (0, "PEIM", NULL, 0);
- PeimEntryPoint(PeimFileHandle, &Private->PS);
+ PeimEntryPoint(PeimFileHandle, (const EFI_PEI_SERVICES **) &Private->PS);
PERF_END (0, "PEIM", NULL, 0);
}
@@ -357,7 +362,7 @@ Returns:
REPORT_STATUS_CODE_WITH_EXTENDED_DATA (
EFI_PROGRESS_CODE,
- EFI_SOFTWARE_PEI_CORE | EFI_SW_PC_INIT_BEGIN,
+ FixedPcdGet32(PcdStatusCodeValuePeimDispatch),
(VOID *)(&ExtendedData),
sizeof (ExtendedData)
);
@@ -373,18 +378,16 @@ Returns:
//
// Call the PEIM entry point for PEIM driver
//
- PeimEntryPoint = (EFI_PEIM_ENTRY_POINT)(UINTN)EntryPoint;
- PeimEntryPoint (PeimFileHandle, PeiServices);
+ PeimEntryPoint = (EFI_PEIM_ENTRY_POINT2)(UINTN)EntryPoint;
+ PeimEntryPoint (PeimFileHandle, (const EFI_PEI_SERVICES **) PeiServices);
}
- //
- // One module has been dispatched.
- //
+
PeimDispatchOnThisPass = TRUE;
}
REPORT_STATUS_CODE_WITH_EXTENDED_DATA (
EFI_PROGRESS_CODE,
- EFI_SOFTWARE_PEI_CORE | EFI_SW_PC_INIT_END,
+ FixedPcdGet32(PcdStatusCodeValuePeimDispatch),
(VOID *)(&ExtendedData),
sizeof (ExtendedData)
);
@@ -483,7 +486,7 @@ Returns:
// We call the entry point a 2nd time so the module knows it's shadowed.
//
//PERF_START (PeiServices, L"PEIM", PeimFileHandle, 0);
- PeimEntryPoint (PeimFileHandle, PeiServices);
+ PeimEntryPoint (PeimFileHandle, (const EFI_PEI_SERVICES **) PeiServices);
//PERF_END (PeiServices, L"PEIM", PeimFileHandle, 0);
//
diff --git a/MdeModulePkg/Core/Pei/FwVol/FwVol.c b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
index 621fb16f18..358889213e 100644
--- a/MdeModulePkg/Core/Pei/FwVol/FwVol.c
+++ b/MdeModulePkg/Core/Pei/FwVol/FwVol.c
@@ -198,7 +198,7 @@ Returns:
FileHeader = (EFI_FFS_FILE_HEADER **)FileHandle;
FvLength = FwVolHeader->FvLength;
- if (FwVolHeader->Attributes & EFI_FVB_ERASE_POLARITY) {
+ if (FwVolHeader->Attributes & EFI_FVB2_ERASE_POLARITY) {
ErasePolarity = 1;
} else {
ErasePolarity = 0;
@@ -781,7 +781,7 @@ Returns:
return EFI_INVALID_PARAMETER;
}
- if (((EFI_FIRMWARE_VOLUME_HEADER*)VolumeHandle)->Attributes & EFI_FVB_ERASE_POLARITY) {
+ if (((EFI_FIRMWARE_VOLUME_HEADER*)VolumeHandle)->Attributes & EFI_FVB2_ERASE_POLARITY) {
ErasePolarity = 1;
} else {
ErasePolarity = 0;
diff --git a/MdeModulePkg/Core/Pei/PeiMain.h b/MdeModulePkg/Core/Pei/PeiMain.h
index 84d187ed97..4876851cbe 100644
--- a/MdeModulePkg/Core/Pei/PeiMain.h
+++ b/MdeModulePkg/Core/Pei/PeiMain.h
@@ -25,8 +25,6 @@ Revision History
#define _PEI_MAIN_H_
#include <PiPei.h>
-#include <FrameworkPei.h>
-#include <Guid/StatusCodeDataTypeId.h>
#include <Ppi/DxeIpl.h>
#include <Ppi/MemoryDiscovered.h>
#include <Ppi/StatusCode.h>
diff --git a/MdeModulePkg/Core/Pei/PeiMain.inf b/MdeModulePkg/Core/Pei/PeiMain.inf
index 0d58f9555a..1d2c8fc5df 100644
--- a/MdeModulePkg/Core/Pei/PeiMain.inf
+++ b/MdeModulePkg/Core/Pei/PeiMain.inf
@@ -65,7 +65,6 @@
[Packages]
MdeModulePkg/MdeModulePkg.dec
MdePkg/MdePkg.dec
- IntelFrameworkPkg/IntelFrameworkPkg.dec
[LibraryClasses]
TimerLib
@@ -101,6 +100,8 @@
[FixedPcd.common]
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxFvSupported
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeimPerFv
+ gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValuePeimDispatch
+ gEfiMdePkgTokenSpaceGuid.PcdStatusCodeValuePeiCoreEntry
[FeaturePcd.common]
gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreImageLoaderSearchTeSectionFirst
diff --git a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
index 1dd7ed3d4f..4e2d9b10aa 100644
--- a/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
+++ b/MdeModulePkg/Core/Pei/PeiMain/PeiMain.c
@@ -213,7 +213,7 @@ Returns:
//
REPORT_STATUS_CODE (
EFI_PROGRESS_CODE,
- EFI_SOFTWARE_PEI_CORE | EFI_SW_PC_INIT
+ FixedPcdGet32 (PcdStatusCodeValuePeiCoreEntry)
);
PERF_START (NULL,"PEI", NULL, mTick);