summaryrefslogtreecommitdiff
path: root/EdkCompatibilityPkg
diff options
context:
space:
mode:
authorqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2008-05-29 08:50:42 +0000
committerqwang12 <qwang12@6f19259b-4bc3-4df7-8a09-765794883524>2008-05-29 08:50:42 +0000
commit001d920c76fd669593503099c75733b692c84287 (patch)
treed02c82b04b20087c5ff05091ac854540ed0a4457 /EdkCompatibilityPkg
parent67ef3cad3ba4db14d209c7bb4fe225b57b7fd33d (diff)
downloadedk2-001d920c76fd669593503099c75733b692c84287.zip
edk2-001d920c76fd669593503099c75733b692c84287.tar.gz
edk2-001d920c76fd669593503099c75733b692c84287.tar.bz2
1) Add in FvFileLoaderToLoadFileThunk.
2) Update some doxygen comments. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5309 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'EdkCompatibilityPkg')
-rw-r--r--EdkCompatibilityPkg/Compatibility/FvFileLoaderToLoadFileThunk/FvFileLoaderToLoadFileThunk.c132
-rw-r--r--EdkCompatibilityPkg/Compatibility/FvFileLoaderToLoadFileThunk/FvFileLoaderToLoadFileThunk.inf58
-rw-r--r--EdkCompatibilityPkg/Compatibility/ReadOnlyVariableToReadOnlyVariable2Thunk/ReadOnlyVariableToReadOnlyVariable2Thunk.c28
-rw-r--r--EdkCompatibilityPkg/EdkCompatibilityPkg.dsc1
4 files changed, 201 insertions, 18 deletions
diff --git a/EdkCompatibilityPkg/Compatibility/FvFileLoaderToLoadFileThunk/FvFileLoaderToLoadFileThunk.c b/EdkCompatibilityPkg/Compatibility/FvFileLoaderToLoadFileThunk/FvFileLoaderToLoadFileThunk.c
new file mode 100644
index 0000000..35621cd
--- /dev/null
+++ b/EdkCompatibilityPkg/Compatibility/FvFileLoaderToLoadFileThunk/FvFileLoaderToLoadFileThunk.c
@@ -0,0 +1,132 @@
+/** @file
+Module produce Framework's EFI_PEI_FV_FILE_LOADER_PPI top of EFI_PEI_LOAD_FILE_PPI.
+
+UEFI PI Spec supersedes Intel's Framework Specs.
+EFI_PEI_FV_FILE_LOADER_PPI defined in Intel Framework Pkg is replaced by EFI_PEI_LOAD_FILE_PPI
+in MdePkg.
+This module produces EFI_PEI_FV_FILE_LOADER_PPI on top of EFI_PEI_LOAD_FILE_PPI .
+This module is used on platform when both of these two conditions are true:
+1) Framework module consumes EFI_PEI_FV_FILE_LOADER_PPI is present.
+2) The platform has PI modules that produce EFI_PEI_LOAD_FILE_PPI.
+
+Copyright (c) 2008, 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:
+
+**/
+
+#include <PiPei.h>
+#include <Ppi/LoadFile.h>
+#include <Ppi/FvLoadFile.h>
+#include <Library/DebugLib.h>
+#include <Library/PeiServicesLib.h>
+
+/**
+
+ Wrap the call to PI's EFI_PEI_LOAD_FILE_PPI.
+
+ @param This A pointer to EFI_PEI_FV_FILE_LOADER_PPI.
+ @param FileHeader The pointer to the file header to be loaded by the Pe/Coff loader.
+ @param ImageAddress The loaded address of the Image.
+ @param ImageSize Pointer to the size of the loaded image.
+ @param EntryPoint Pointer to the entry point of the image.
+
+ @retval EFI_SUCCESS The image was loaded successfully.
+ @retval EFI_OUT_OF_RESOURCE There was not enought memory.
+ @retval EFI_INVALID_PARAMETER The contents of the FFS file did not contain a valid PE/COFF image that could be loaded.
+--*/
+EFI_STATUS
+EFIAPI
+FrameworkLoadFile (
+ IN EFI_PEI_FV_FILE_LOADER_PPI *This,
+ IN EFI_FFS_FILE_HEADER *FfsHeader,
+ OUT EFI_PHYSICAL_ADDRESS *ImageAddress,
+ OUT UINT64 *ImageSize,
+ OUT EFI_PHYSICAL_ADDRESS *EntryPoint
+ )
+;
+
+EFI_PEI_FV_FILE_LOADER_PPI mLoadFilePpi = {
+ FrameworkLoadFile
+};
+
+EFI_PEI_PPI_DESCRIPTOR mPpiFrameworkLoadFile = {
+ (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
+ &gEfiPeiFvFileLoaderPpiGuid,
+ &mLoadFilePpi
+};
+
+/**
+ Standard entry point of a PEIM.
+
+ @param FfsHeadher The FFS file header
+ @param PeiServices General purpose services available to every PEIM.
+
+ @retval EFI_SUCCESS If the gEfiPeiReadOnlyVariablePpiGuid interface could be successfully installed.
+
+--*/
+EFI_STATUS
+EFIAPI
+InitPeim (
+ IN EFI_FFS_FILE_HEADER *FfsHeader,
+ IN CONST EFI_PEI_SERVICES **PeiServices
+ )
+{
+ return (*PeiServices)->InstallPpi (PeiServices, &mPpiFrameworkLoadFile);
+}
+
+
+/**
+
+ Wrap the call to PI's EFI_PEI_LOAD_FILE_PPI.
+
+ @param This A pointer to EFI_PEI_FV_FILE_LOADER_PPI.
+ @param FileHeader The pointer to the file header to be loaded by the Pe/Coff loader.
+ @param ImageAddress The loaded address of the Image.
+ @param ImageSize Pointer to the size of the loaded image.
+ @param EntryPoint Pointer to the entry point of the image.
+
+ @retval EFI_SUCCESS The image was loaded successfully.
+ @retval EFI_OUT_OF_RESOURCE There was not enought memory.
+ @retval EFI_INVALID_PARAMETER The contents of the FFS file did not contain a valid PE/COFF image that could be loaded.
+--*/
+EFI_STATUS
+EFIAPI
+FrameworkLoadFile (
+ IN EFI_PEI_FV_FILE_LOADER_PPI *This,
+ IN EFI_FFS_FILE_HEADER *FfsHeader,
+ OUT EFI_PHYSICAL_ADDRESS *ImageAddress,
+ OUT UINT64 *ImageSize,
+ OUT EFI_PHYSICAL_ADDRESS *EntryPoint
+ )
+{
+ EFI_STATUS Status;
+ EFI_PEI_LOAD_FILE_PPI *PiLoadFile;
+ UINT32 AuthenticationState;
+
+ Status = PeiServicesLocatePpi (
+ &gEfiPeiLoadFilePpiGuid,
+ 0,
+ NULL,
+ (VOID **) &PiLoadFile
+ );
+ ASSERT_EFI_ERROR (Status);
+
+ return PiLoadFile->LoadFile (
+ PiLoadFile,
+ (EFI_PEI_FILE_HANDLE) FfsHeader,
+ ImageAddress,
+ ImageSize,
+ EntryPoint,
+ &AuthenticationState
+ );
+
+}
+
diff --git a/EdkCompatibilityPkg/Compatibility/FvFileLoaderToLoadFileThunk/FvFileLoaderToLoadFileThunk.inf b/EdkCompatibilityPkg/Compatibility/FvFileLoaderToLoadFileThunk/FvFileLoaderToLoadFileThunk.inf
new file mode 100644
index 0000000..c637491
--- /dev/null
+++ b/EdkCompatibilityPkg/Compatibility/FvFileLoaderToLoadFileThunk/FvFileLoaderToLoadFileThunk.inf
@@ -0,0 +1,58 @@
+#/** @file
+# Module produce Framework's EFI_PEI_FV_FILE_LOADER_PPI top of EFI_PEI_LOAD_FILE_PPI.
+#
+# UEFI PI Spec supersedes Intel's Framework Specs.
+# EFI_PEI_FV_FILE_LOADER_PPI defined in Intel Framework Pkg is replaced by EFI_PEI_LOAD_FILE_PPI
+# in MdePkg.
+# This module produces EFI_PEI_FV_FILE_LOADER_PPI on top of EFI_PEI_LOAD_FILE_PPI .
+# This module is used on platform when both of these two conditions are true:
+# 1) Framework module consumes EFI_PEI_FV_FILE_LOADER_PPI is present.
+# 2) The platform has PI modules that produce EFI_PEI_LOAD_FILE_PPI.
+#
+# Copyright (c) 2008, 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.
+#
+#
+#**/
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = FvFileLoaderToLoadFileThunk
+ FILE_GUID = 6CDDBF28-89AC-4e01-9692-616B8A1009C8
+ MODULE_TYPE = PEIM
+ VERSION_STRING = 1.0
+ EDK_RELEASE_VERSION = 0x00020000
+ EFI_SPECIFICATION_VERSION = 0x00020000
+
+ ENTRY_POINT = InitPeim
+
+#
+# The following information is for reference only and not required by the build tools.
+#
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC
+#
+
+[Sources.common]
+ FvFileLoaderToLoadFileThunk.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+ IntelFrameworkPkg/IntelFrameworkPkg.dec
+
+[LibraryClasses]
+ PeimEntryPoint
+ PeiServicesLib
+ DebugLib
+
+[Ppis]
+ gEfiPeiLoadFilePpiGuid #ALWAYS_CONSUME
+ gEfiPeiFvFileLoaderPpiGuid #ALWAYS_PRODUCE
+
+[Depex]
+ gEfiPeiLoadFilePpiGuid
diff --git a/EdkCompatibilityPkg/Compatibility/ReadOnlyVariableToReadOnlyVariable2Thunk/ReadOnlyVariableToReadOnlyVariable2Thunk.c b/EdkCompatibilityPkg/Compatibility/ReadOnlyVariableToReadOnlyVariable2Thunk/ReadOnlyVariableToReadOnlyVariable2Thunk.c
index 4810349..06dd4cc 100644
--- a/EdkCompatibilityPkg/Compatibility/ReadOnlyVariableToReadOnlyVariable2Thunk/ReadOnlyVariableToReadOnlyVariable2Thunk.c
+++ b/EdkCompatibilityPkg/Compatibility/ReadOnlyVariableToReadOnlyVariable2Thunk/ReadOnlyVariableToReadOnlyVariable2Thunk.c
@@ -66,29 +66,21 @@ EFI_PEI_PPI_DESCRIPTOR mPpiListVariable = {
&mVariablePpi
};
+/**
+ Standard entry point of a PEIM.
+
+ @param FfsHeadher The FFS file header
+ @param PeiServices General purpose services available to every PEIM.
+
+ @retval EFI_SUCCESS If the gEfiPeiReadOnlyVariablePpiGuid interface could be successfully installed.
+
+--*/
EFI_STATUS
EFIAPI
PeimInitializeReadOnlyVariable (
- IN EFI_FFS_FILE_HEADER *FfsHeader,
+ IN EFI_PEI_FILE_HANDLE FfsHeader,
IN CONST EFI_PEI_SERVICES **PeiServices
)
-/*++
-
-Routine Description:
-
- Provide the functionality of the variable services.
-
-Arguments:
-
- FfsHeadher - The FFS file header
- PeiServices - General purpose services available to every PEIM.
-
-Returns:
-
- Status - EFI_SUCCESS if the interface could be successfully
- installed
-
---*/
{
VOID *Interface;
EFI_STATUS Status;
diff --git a/EdkCompatibilityPkg/EdkCompatibilityPkg.dsc b/EdkCompatibilityPkg/EdkCompatibilityPkg.dsc
index d20c3a5..f2bfa2c 100644
--- a/EdkCompatibilityPkg/EdkCompatibilityPkg.dsc
+++ b/EdkCompatibilityPkg/EdkCompatibilityPkg.dsc
@@ -217,6 +217,7 @@ define GCC_MACRO = -DEFI_SPECIFICATION_VERSION=0x0002000A -DPI_S
#
EdkCompatibilityPkg/Compatibility/DeviceIoToPciRootBridgeIoThunk/DeviceIoToPciRootBridgeIoThunk.inf
EdkCompatibilityPkg/Compatibility/FrameworkHiiToUefiHiiThunk/FrameworkHiiToUefiHiiThunk.inf
+ EdkCompatibilityPkg/Compatibility/FvFileLoaderToLoadFileThunk/FvFileLoaderToLoadFileThunk.inf
EdkCompatibilityPkg/Compatibility/FvToFv2Thunk/FvToFv2Thunk.inf
EdkCompatibilityPkg/Compatibility/Fv2ToFvThunk/Fv2ToFvThunk.inf
EdkCompatibilityPkg/Compatibility/PciCfg2ToPciCfgThunk/PciCfg2ToPciCfgThunk.inf