summaryrefslogtreecommitdiff
path: root/MdePkg
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2013-10-11 03:54:13 +0000
committerlzeng14 <lzeng14@6f19259b-4bc3-4df7-8a09-765794883524>2013-10-11 03:54:13 +0000
commitc79351059ee7ee24ebed312413cb5e57076c5b56 (patch)
treed93c9f8f4d87bd568aef4da644888348e2a147fc /MdePkg
parent71fd9fae8bda10f41a9c6445f01eed82b99883da (diff)
downloadjuice-c79351059ee7ee24ebed312413cb5e57076c5b56.tar.gz
1. Enable use-cases in PEI using SecurityPPI co-equal to the use-cases in DXE using the Security Arch Protocol
2. Add support to find section by instance rather than only 0 at PEI phase. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14763 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg')
-rw-r--r--MdePkg/Include/Library/PeiServicesLib.h90
-rw-r--r--MdePkg/Include/Pi/PiPeiCis.h92
-rw-r--r--MdePkg/Include/Ppi/FirmwareVolume.h76
-rw-r--r--MdePkg/Include/Ppi/FirmwareVolumeInfo2.h72
-rw-r--r--MdePkg/Include/Ppi/Security2.h4
-rw-r--r--MdePkg/Library/PeiServicesLib/PeiServicesLib.c222
-rw-r--r--MdePkg/Library/PeiServicesLib/PeiServicesLib.inf3
-rw-r--r--MdePkg/MdePkg.dec3
8 files changed, 521 insertions, 41 deletions
diff --git a/MdePkg/Include/Library/PeiServicesLib.h b/MdePkg/Include/Library/PeiServicesLib.h
index 358c9cddf..2b51d374c 100644
--- a/MdePkg/Include/Library/PeiServicesLib.h
+++ b/MdePkg/Include/Library/PeiServicesLib.h
@@ -221,6 +221,30 @@ PeiServicesFfsFindSectionData (
);
/**
+ This service enables PEIMs to discover sections of a given instance and type within a valid FFS file.
+
+ @param SectionType The value of the section type to find.
+ @param SectionInstance Section instance to find.
+ @param FileHandle A pointer to the file header that contains the set
+ of sections to be searched.
+ @param SectionData A pointer to the discovered section, if successful.
+ @param AuthenticationStatus A pointer to the authentication status for this section.
+
+ @retval EFI_SUCCESS The section was found.
+ @retval EFI_NOT_FOUND The section was not found.
+
+**/
+EFI_STATUS
+EFIAPI
+PeiServicesFfsFindSectionData3 (
+ IN EFI_SECTION_TYPE SectionType,
+ IN UINTN SectionInstance,
+ IN EFI_PEI_FILE_HANDLE FileHandle,
+ OUT VOID **SectionData,
+ OUT UINT32 *AuthenticationStatus
+ );
+
+/**
This service enables PEIMs to register the permanent memory configuration
that has been initialized with the PEI Foundation.
@@ -349,6 +373,31 @@ PeiServicesFfsGetFileInfo (
);
/**
+ This service is a wrapper for the PEI Service FfsGetFileInfo2(), except the pointer to the PEI Services
+ Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface
+ Specification for details.
+
+ @param FileHandle Handle of the file.
+
+ @param FileInfo Upon exit, points to the file's
+ information.
+
+ @retval EFI_SUCCESS File information returned.
+
+ @retval EFI_INVALID_PARAMETER If FileHandle does not
+ represent a valid file.
+
+ @retval EFI_INVALID_PARAMETER If FileInfo is NULL.
+
+**/
+EFI_STATUS
+EFIAPI
+PeiServicesFfsGetFileInfo2 (
+ IN CONST EFI_PEI_FILE_HANDLE FileHandle,
+ OUT EFI_FV_FILE_INFO2 *FileInfo
+ );
+
+/**
This service is a wrapper for the PEI Service FfsGetVolumeInfo(), except the pointer to the PEI Services
Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface
Specification for details.
@@ -431,4 +480,45 @@ PeiServicesInstallFvInfoPpi (
IN CONST EFI_GUID *ParentFileName OPTIONAL
);
+/**
+ Install a EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI instance so the PEI Core will be notified about a new firmware volume.
+
+ This function allocates, initializes, and installs a new EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI using
+ the parameters passed in to initialize the fields of the EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI instance.
+ If the resources can not be allocated for EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI, then ASSERT().
+ If the EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI can not be installed, then ASSERT().
+
+ @param FvFormat Unique identifier of the format of the memory-mapped
+ firmware volume. This parameter is optional and
+ may be NULL. If NULL is specified, the
+ EFI_FIRMWARE_FILE_SYSTEM2_GUID format is assumed.
+ @param FvInfo Points to a buffer which allows the
+ EFI_PEI_FIRMWARE_VOLUME_PPI to process the volume.
+ The format of this buffer is specific to the FvFormat.
+ For memory-mapped firmware volumes, this typically
+ points to the first byte of the firmware volume.
+ @param FvInfoSize The size, in bytes, of FvInfo. For memory-mapped
+ firmware volumes, this is typically the size of
+ the firmware volume.
+ @param ParentFvName If the new firmware volume originated from a file
+ in a different firmware volume, then this parameter
+ specifies the GUID name of the originating firmware
+ volume. Otherwise, this parameter must be NULL.
+ @param ParentFileName If the new firmware volume originated from a file
+ in a different firmware volume, then this parameter
+ specifies the GUID file name of the originating
+ firmware file. Otherwise, this parameter must be NULL.
+ @param AuthenticationStatus Authentication Status
+**/
+VOID
+EFIAPI
+PeiServicesInstallFvInfo2Ppi (
+ IN CONST EFI_GUID *FvFormat, OPTIONAL
+ IN CONST VOID *FvInfo,
+ IN UINT32 FvInfoSize,
+ IN CONST EFI_GUID *ParentFvName, OPTIONAL
+ IN CONST EFI_GUID *ParentFileName, OPTIONAL
+ IN UINT32 AuthenticationStatus
+ );
+
#endif
diff --git a/MdePkg/Include/Pi/PiPeiCis.h b/MdePkg/Include/Pi/PiPeiCis.h
index c3d147ac1..f2da20a23 100644
--- a/MdePkg/Include/Pi/PiPeiCis.h
+++ b/MdePkg/Include/Pi/PiPeiCis.h
@@ -1,7 +1,7 @@
/** @file
PI PEI master include file. This file should match the PI spec.
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
@@ -396,6 +396,38 @@ EFI_STATUS
);
/**
+ Searches for the next matching section within the specified file.
+
+ This service enables PEI modules to discover the section of a given type within a valid file.
+ This service will search within encapsulation sections (compression and GUIDed) as well. It will
+ search inside of a GUIDed section or a compressed section, but may not, for example, search a
+ GUIDed section inside a GUIDes section.
+ This service will not search within compression sections or GUIDed sections that require
+ extraction if memory is not present.
+
+ @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
+ @param SectionType The value of the section type to find.
+ @param SectionInstance Section instance to find.
+ @param FileHandle Handle of the firmware file to search.
+ @param SectionData A pointer to the discovered section, if successful.
+ @param AuthenticationStatus A pointer to the authentication status for this section.
+
+ @retval EFI_SUCCESS The section was found.
+ @retval EFI_NOT_FOUND The section was not found.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_FFS_FIND_SECTION_DATA3)(
+ IN CONST EFI_PEI_SERVICES **PeiServices,
+ IN EFI_SECTION_TYPE SectionType,
+ IN UINTN SectionInstance,
+ IN EFI_PEI_FILE_HANDLE FileHandle,
+ OUT VOID **SectionData,
+ OUT UINT32 *AuthenticationStatus
+ );
+
+/**
This function registers the found memory configuration with the PEI Foundation.
@param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
@@ -608,6 +640,38 @@ typedef struct {
UINT32 BufferSize;
} EFI_FV_FILE_INFO;
+///
+/// The information with authentication status of the FV file.
+///
+typedef struct {
+ ///
+ /// Name of the file.
+ ///
+ EFI_GUID FileName;
+ ///
+ /// File type.
+ ///
+ EFI_FV_FILETYPE FileType;
+ ///
+ /// Attributes of the file.
+ ///
+ EFI_FV_FILE_ATTRIBUTES FileAttributes;
+ ///
+ /// Points to the file's data (not the header).
+ /// Not valid if EFI_FV_FILE_ATTRIB_MEMORY_MAPPED
+ /// is zero.
+ ///
+ VOID *Buffer;
+ ///
+ /// Size of the file's data.
+ ///
+ UINT32 BufferSize;
+ ///
+ /// Authentication status for this file.
+ ///
+ UINT32 AuthenticationStatus;
+} EFI_FV_FILE_INFO2;
+
/**
Returns information about a specific file.
@@ -633,6 +697,30 @@ EFI_STATUS
OUT EFI_FV_FILE_INFO *FileInfo
);
+/**
+ Returns information about a specific file.
+
+ This function returns information about a specific file,
+ including its file name, type, attributes, starting address, size and authentication status.
+ If the firmware volume is not memory mapped, then the Buffer member will be NULL.
+
+ @param FileHandle The handle of the file.
+ @param FileInfo Upon exit, points to the file's
+ information.
+
+ @retval EFI_SUCCESS File information was returned.
+ @retval EFI_INVALID_PARAMETER FileHandle does not
+ represent a valid file.
+ @retval EFI_INVALID_PARAMETER FileInfo is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_FFS_GET_FILE_INFO2)(
+ IN EFI_PEI_FILE_HANDLE FileHandle,
+ OUT EFI_FV_FILE_INFO2 *FileInfo
+ );
+
///
/// The information of the FV volume.
///
@@ -813,6 +901,8 @@ struct _EFI_PEI_SERVICES {
EFI_PEI_FFS_GET_FILE_INFO FfsGetFileInfo;
EFI_PEI_FFS_GET_VOLUME_INFO FfsGetVolumeInfo;
EFI_PEI_REGISTER_FOR_SHADOW RegisterForShadow;
+ EFI_PEI_FFS_FIND_SECTION_DATA3 FindSectionData3;
+ EFI_PEI_FFS_GET_FILE_INFO2 FfsGetFileInfo2;
};
diff --git a/MdePkg/Include/Ppi/FirmwareVolume.h b/MdePkg/Include/Ppi/FirmwareVolume.h
index c8fc77b15..d8998fad1 100644
--- a/MdePkg/Include/Ppi/FirmwareVolume.h
+++ b/MdePkg/Include/Ppi/FirmwareVolume.h
@@ -1,7 +1,7 @@
/** @file
This file provides functions for accessing a memory-mapped firmware volume of a specific format.
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
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
@@ -154,6 +154,33 @@ EFI_STATUS
);
/**
+ Returns information about a specific file.
+
+ This function returns information about a specific
+ file, including its file name, type, attributes, starting
+ address, size and authentication status.
+
+ @param This Points to this instance of the
+ EFI_PEI_FIRMWARE_VOLUME_PPI.
+ @param FileHandle Handle of the file.
+ @param FileInfo Upon exit, points to the file's
+ information.
+
+ @retval EFI_SUCCESS File information returned.
+ @retval EFI_INVALID_PARAMETER If FileHandle does not
+ represent a valid file.
+ @retval EFI_INVALID_PARAMETER If FileInfo is NULL.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_FV_GET_FILE_INFO2)(
+ IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,
+ IN EFI_PEI_FILE_HANDLE FileHandle,
+ OUT EFI_FV_FILE_INFO2 *FileInfo
+);
+
+/**
This function returns information about the firmware volume.
@param This Points to this instance of the
@@ -203,6 +230,43 @@ EFI_STATUS
OUT VOID **SectionData
);
+/**
+ Find the next matching section in the firmware file.
+
+ This service enables PEI modules to discover sections
+ of a given instance and type within a valid file.
+
+ @param This Points to this instance of the
+ EFI_PEI_FIRMWARE_VOLUME_PPI.
+ @param SearchType A filter to find only sections of this
+ type.
+ @param SearchInstance A filter to find the specific instance
+ of sections.
+ @param FileHandle Handle of firmware file in which to
+ search.
+ @param SectionData Updated upon return to point to the
+ section found.
+ @param AuthenticationStatus Updated upon return to point to the
+ authentication status for this section.
+
+ @retval EFI_SUCCESS Section was found.
+ @retval EFI_NOT_FOUND Section of the specified type was not
+ found. SectionData contains NULL.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_PEI_FV_FIND_SECTION2)(
+ IN CONST EFI_PEI_FIRMWARE_VOLUME_PPI *This,
+ IN EFI_SECTION_TYPE SearchType,
+ IN UINTN SearchInstance,
+ IN EFI_PEI_FILE_HANDLE FileHandle,
+ OUT VOID **SectionData,
+ OUT UINT32 *AuthenticationStatus
+);
+
+#define EFI_PEI_FIRMWARE_VOLUME_PPI_SIGNATURE SIGNATURE_32 ('P', 'F', 'V', 'P')
+#define EFI_PEI_FIRMWARE_VOLUME_PPI_REVISION 0x00010030
+
///
/// This PPI provides functions for accessing a memory-mapped firmware volume of a specific format.
///
@@ -213,6 +277,16 @@ struct _EFI_PEI_FIRMWARE_VOLUME_PPI {
EFI_PEI_FV_GET_FILE_INFO GetFileInfo;
EFI_PEI_FV_GET_INFO GetVolumeInfo;
EFI_PEI_FV_FIND_SECTION FindSectionByType;
+ EFI_PEI_FV_GET_FILE_INFO2 GetFileInfo2;
+ EFI_PEI_FV_FIND_SECTION2 FindSectionByType2;
+ ///
+ /// Signature is used to keep backward-compatibility, set to {'P','F','V','P'}.
+ ///
+ UINT32 Signature;
+ ///
+ /// Revision for further extension.
+ ///
+ UINT32 Revision;
};
extern EFI_GUID gEfiPeiFirmwareVolumePpiGuid;
diff --git a/MdePkg/Include/Ppi/FirmwareVolumeInfo2.h b/MdePkg/Include/Ppi/FirmwareVolumeInfo2.h
new file mode 100644
index 000000000..6cb66b3c3
--- /dev/null
+++ b/MdePkg/Include/Ppi/FirmwareVolumeInfo2.h
@@ -0,0 +1,72 @@
+/** @file
+ This file provides location, format and authentication status of a firmware volume.
+
+ Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
+ 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.
+
+ @par Revision Reference:
+ This PPI is introduced in PI Version 1.3 errata.
+
+**/
+
+#ifndef __EFI_PEI_FIRMWARE_VOLUME_INFO2_H__
+#define __EFI_PEI_FIRMWARE_VOLUME_INFO2_H__
+
+
+
+#define EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI_GUID \
+{ 0xea7ca24b, 0xded5, 0x4dad, { 0xa3, 0x89, 0xbf, 0x82, 0x7e, 0x8f, 0x9b, 0x38 } }
+
+typedef struct _EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI;
+
+///
+/// This PPI describes the location and format of a firmware volume.
+/// The FvFormat can be EFI_FIRMWARE_FILE_SYSTEM2_GUID or the GUID for
+/// a user-defined format. The EFI_FIRMWARE_FILE_SYSTEM2_GUID is
+/// the PI Firmware Volume format.
+///
+struct _EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI {
+ ///
+ /// Unique identifier of the format of the memory-mapped firmware volume.
+ ///
+ EFI_GUID FvFormat;
+ ///
+ /// Points to a buffer which allows the EFI_PEI_FIRMWARE_VOLUME_PPI to process
+ /// the volume. The format of this buffer is specific to the FvFormat.
+ /// For memory-mapped firmware volumes, this typically points to the first byte
+ /// of the firmware volume.
+ ///
+ VOID *FvInfo;
+ ///
+ /// Size of the data provided by FvInfo. For memory-mapped firmware volumes,
+ /// this is typically the size of the firmware volume.
+ ///
+ UINT32 FvInfoSize;
+ ///
+ /// If the firmware volume originally came from a firmware file, then these
+ /// point to the parent firmware volume name and firmware volume file.
+ /// If it did not originally come from a firmware file, these should be NULL.
+ ///
+ EFI_GUID *ParentFvName;
+ ///
+ /// If the firmware volume originally came from a firmware file, then these
+ /// point to the parent firmware volume name and firmware volume file.
+ /// If it did not originally come from a firmware file, these should be NULL.
+ ///
+ EFI_GUID *ParentFileName;
+ ///
+ /// Authentication Status.
+ ///
+ UINT32 AuthenticationStatus;
+};
+
+extern EFI_GUID gEfiPeiFirmwareVolumeInfo2PpiGuid;
+
+#endif
+
diff --git a/MdePkg/Include/Ppi/Security2.h b/MdePkg/Include/Ppi/Security2.h
index eed56d753..f7aabfca3 100644
--- a/MdePkg/Include/Ppi/Security2.h
+++ b/MdePkg/Include/Ppi/Security2.h
@@ -5,7 +5,7 @@
policy to the PEI Foundation, namely the case of a PEIM's authentication
state being returned during the PEI section extraction process.
- Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
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
@@ -75,7 +75,7 @@ EFI_STATUS
IN CONST EFI_PEI_SECURITY2_PPI *This,
IN UINT32 AuthenticationStatus,
IN EFI_PEI_FV_HANDLE FvHandle,
- IN EFI_PEI_FV_HANDLE FileHandle,
+ IN EFI_PEI_FILE_HANDLE FileHandle,
IN OUT BOOLEAN *DeferExecution
);
diff --git a/MdePkg/Library/PeiServicesLib/PeiServicesLib.c b/MdePkg/Library/PeiServicesLib/PeiServicesLib.c
index 835325cc3..e10dd8800 100644
--- a/MdePkg/Library/PeiServicesLib/PeiServicesLib.c
+++ b/MdePkg/Library/PeiServicesLib/PeiServicesLib.c
@@ -1,7 +1,7 @@
/** @file
Implementation for PEI Services Library.
- Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>
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
@@ -16,6 +16,7 @@
#include <PiPei.h>
#include <Ppi/FirmwareVolumeInfo.h>
+#include <Ppi/FirmwareVolumeInfo2.h>
#include <Guid/FirmwareFileSystem2.h>
#include <Library/PeiServicesLib.h>
@@ -24,15 +25,6 @@
#include <Library/MemoryAllocationLib.h>
#include <Library/BaseMemoryLib.h>
-
-GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_PEI_PPI_DESCRIPTOR mPpiListTemplate[] = {
- {
- (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
- &gEfiPeiFirmwareVolumeInfoPpiGuid,
- NULL
- }
-};
-
/**
This service enables a given PEIM to register an interface into the PEI Foundation.
@@ -310,6 +302,36 @@ PeiServicesFfsFindSectionData (
}
/**
+ This service enables PEIMs to discover sections of a given instance and type within a valid FFS file.
+
+ @param SectionType The value of the section type to find.
+ @param SectionInstance Section instance to find.
+ @param FileHandle A pointer to the file header that contains the set
+ of sections to be searched.
+ @param SectionData A pointer to the discovered section, if successful.
+ @param AuthenticationStatus A pointer to the authentication status for this section.
+
+ @retval EFI_SUCCESS The section was found.
+ @retval EFI_NOT_FOUND The section was not found.
+
+**/
+EFI_STATUS
+EFIAPI
+PeiServicesFfsFindSectionData3 (
+ IN EFI_SECTION_TYPE SectionType,
+ IN UINTN SectionInstance,
+ IN EFI_PEI_FILE_HANDLE FileHandle,
+ OUT VOID **SectionData,
+ OUT UINT32 *AuthenticationStatus
+ )
+{
+ CONST EFI_PEI_SERVICES **PeiServices;
+
+ PeiServices = GetPeiServicesTablePointer ();
+ return (*PeiServices)->FindSectionData3 (PeiServices, SectionType, SectionInstance, FileHandle, SectionData, AuthenticationStatus);
+}
+
+/**
This service enables PEIMs to register the permanent memory configuration
that has been initialized with the PEI Foundation.
@@ -459,6 +481,30 @@ PeiServicesFfsGetFileInfo (
return (*GetPeiServicesTablePointer())->FfsGetFileInfo (FileHandle, FileInfo);
}
+/**
+ This service is a wrapper for the PEI Service FfsGetFileInfo2(), except the pointer to the PEI Services
+ Table has been removed. See the Platform Initialization Pre-EFI Initialization Core Interface
+ Specification for details.
+
+ @param FileHandle The handle of the file.
+ @param FileInfo Upon exit, points to the file's
+ information.
+
+ @retval EFI_SUCCESS File information returned.
+ @retval EFI_INVALID_PARAMETER If FileHandle does not
+ represent a valid file.
+ @retval EFI_INVALID_PARAMETER FileInfo is NULL.
+
+**/
+EFI_STATUS
+EFIAPI
+PeiServicesFfsGetFileInfo2 (
+ IN CONST EFI_PEI_FILE_HANDLE FileHandle,
+ OUT EFI_FV_FILE_INFO2 *FileInfo
+ )
+{
+ return (*GetPeiServicesTablePointer())->FfsGetFileInfo2 (FileHandle, FileInfo);
+}
/**
This service is a wrapper for the PEI Service FfsFindByName(), except the pointer to the PEI Services
@@ -522,43 +568,46 @@ PeiServicesFfsGetVolumeInfo (
}
/**
- Install a EFI_PEI_FIRMWARE_VOLUME_INFO_PPI instance so the PEI Core will be notified about a new firmware volume.
-
- This function allocates, initializes, and installs a new EFI_PEI_FIRMWARE_VOLUME_INFO_PPI using
- the parameters passed in to initialize the fields of the EFI_PEI_FIRMWARE_VOLUME_INFO_PPI instance.
- If the resources can not be allocated for EFI_PEI_FIRMWARE_VOLUME_INFO_PPI, then ASSERT().
- If the EFI_PEI_FIRMWARE_VOLUME_INFO_PPI can not be installed, then ASSERT().
+ Install a EFI_PEI_FIRMWARE_VOLUME_INFO(2)_PPI instance so the PEI Core will be notified about a new firmware volume.
-
- @param FvFormat Unique identifier of the format of the memory-mapped
- firmware volume. This parameter is optional and
- may be NULL. If NULL is specified, the
+ This function allocates, initializes, and installs a new EFI_PEI_FIRMWARE_VOLUME_INFO(2)_PPI using
+ the parameters passed in to initialize the fields of the EFI_PEI_FIRMWARE_VOLUME_INFO(2)_PPI instance.
+ If the resources can not be allocated for EFI_PEI_FIRMWARE_VOLUME_INFO(2)_PPI, then ASSERT().
+ If the EFI_PEI_FIRMWARE_VOLUME_INFO(2)_PPI can not be installed, then ASSERT().
+
+ @param InstallFvInfoPpi Install FvInfo Ppi if it is TRUE. Otherwise, install FvInfo2 Ppi.
+ @param FvFormat Unique identifier of the format of the memory-mapped
+ firmware volume. This parameter is optional and
+ may be NULL. If NULL is specified, the
EFI_FIRMWARE_FILE_SYSTEM2_GUID format is assumed.
- @param FvInfo Points to a buffer which allows the
- EFI_PEI_FIRMWARE_VOLUME_PPI to process the volume.
- The format of this buffer is specific to the FvFormat.
- For memory-mapped firmware volumes, this typically
+ @param FvInfo Points to a buffer which allows the
+ EFI_PEI_FIRMWARE_VOLUME_PPI to process the volume.
+ The format of this buffer is specific to the FvFormat.
+ For memory-mapped firmware volumes, this typically
points to the first byte of the firmware volume.
- @param FvInfoSize The size, in bytes, of FvInfo. For memory-mapped
- firmware volumes, this is typically the size of
+ @param FvInfoSize The size, in bytes, of FvInfo. For memory-mapped
+ firmware volumes, this is typically the size of
the firmware volume.
- @param ParentFvName If the new firmware volume originated from a file
- in a different firmware volume, then this parameter
+ @param ParentFvName If the new firmware volume originated from a file
+ in a different firmware volume, then this parameter
specifies the GUID name of the originating firmware
volume. Otherwise, this parameter must be NULL.
- @param ParentFileName If the new firmware volume originated from a file
- in a different firmware volume, then this parameter
- specifies the GUID file name of the originating
+ @param ParentFileName If the new firmware volume originated from a file
+ in a different firmware volume, then this parameter
+ specifies the GUID file name of the originating
firmware file. Otherwise, this parameter must be NULL.
+ @param AuthenticationStatus Authentication Status, it will be ignored if InstallFvInfoPpi is TRUE.
**/
VOID
EFIAPI
-PeiServicesInstallFvInfoPpi (
+InternalPeiServicesInstallFvInfoPpi (
+ IN BOOLEAN InstallFvInfoPpi,
IN CONST EFI_GUID *FvFormat, OPTIONAL
IN CONST VOID *FvInfo,
IN UINT32 FvInfoSize,
IN CONST EFI_GUID *ParentFvName, OPTIONAL
- IN CONST EFI_GUID *ParentFileName OPTIONAL
+ IN CONST EFI_GUID *ParentFileName, OPTIONAL
+ IN UINT32 AuthenticationStatus
)
{
EFI_STATUS Status;
@@ -566,11 +615,24 @@ PeiServicesInstallFvInfoPpi (
EFI_PEI_PPI_DESCRIPTOR *FvInfoPpiDescriptor;
EFI_GUID *ParentFvNameValue;
EFI_GUID *ParentFileNameValue;
+ EFI_GUID *PpiGuid;
ParentFvNameValue = NULL;
ParentFileNameValue = NULL;
- FvInfoPpi = AllocateZeroPool (sizeof (EFI_PEI_FIRMWARE_VOLUME_INFO_PPI));
- ASSERT(FvInfoPpi != NULL);
+ if (InstallFvInfoPpi) {
+ //
+ // To install FvInfo Ppi.
+ //
+ FvInfoPpi = AllocateZeroPool (sizeof (EFI_PEI_FIRMWARE_VOLUME_INFO_PPI));
+ PpiGuid = &gEfiPeiFirmwareVolumeInfoPpiGuid;
+ } else {
+ //
+ // To install FvInfo2 Ppi.
+ //
+ FvInfoPpi = AllocateZeroPool (sizeof (EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI));
+ ((EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI *) FvInfoPpi)->AuthenticationStatus = AuthenticationStatus;
+ PpiGuid = &gEfiPeiFirmwareVolumeInfo2PpiGuid;
+ }
if (FvFormat != NULL) {
CopyGuid (&FvInfoPpi->FvFormat, FvFormat);
@@ -590,12 +652,100 @@ PeiServicesInstallFvInfoPpi (
FvInfoPpi->ParentFileName = ParentFileNameValue;
}
- FvInfoPpiDescriptor = AllocateCopyPool (sizeof(EFI_PEI_PPI_DESCRIPTOR), mPpiListTemplate);
+ FvInfoPpiDescriptor = AllocatePool (sizeof (EFI_PEI_PPI_DESCRIPTOR));
ASSERT (FvInfoPpiDescriptor != NULL);
+ FvInfoPpiDescriptor->Guid = PpiGuid;
+ FvInfoPpiDescriptor->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;
FvInfoPpiDescriptor->Ppi = (VOID *) FvInfoPpi;
Status = PeiServicesInstallPpi (FvInfoPpiDescriptor);
ASSERT_EFI_ERROR (Status);
}
+/**
+ Install a EFI_PEI_FIRMWARE_VOLUME_INFO_PPI instance so the PEI Core will be notified about a new firmware volume.
+
+ This function allocates, initializes, and installs a new EFI_PEI_FIRMWARE_VOLUME_INFO_PPI using
+ the parameters passed in to initialize the fields of the EFI_PEI_FIRMWARE_VOLUME_INFO_PPI instance.
+ If the resources can not be allocated for EFI_PEI_FIRMWARE_VOLUME_INFO_PPI, then ASSERT().
+ If the EFI_PEI_FIRMWARE_VOLUME_INFO_PPI can not be installed, then ASSERT().
+
+ @param FvFormat Unique identifier of the format of the memory-mapped
+ firmware volume. This parameter is optional and
+ may be NULL. If NULL is specified, the
+ EFI_FIRMWARE_FILE_SYSTEM2_GUID format is assumed.
+ @param FvInfo Points to a buffer which allows the
+ EFI_PEI_FIRMWARE_VOLUME_PPI to process the volume.
+ The format of this buffer is specific to the FvFormat.
+ For memory-mapped firmware volumes, this typically
+ points to the first byte of the firmware volume.
+ @param FvInfoSize The size, in bytes, of FvInfo. For memory-mapped
+ firmware volumes, this is typically the size of
+ the firmware volume.
+ @param ParentFvName If the new firmware volume originated from a file
+ in a different firmware volume, then this parameter
+ specifies the GUID name of the originating firmware
+ volume. Otherwise, this parameter must be NULL.
+ @param ParentFileName If the new firmware volume originated from a file
+ in a different firmware volume, then this parameter
+ specifies the GUID file name of the originating
+ firmware file. Otherwise, this parameter must be NULL.
+**/
+VOID
+EFIAPI
+PeiServicesInstallFvInfoPpi (
+ IN CONST EFI_GUID *FvFormat, OPTIONAL
+ IN CONST VOID *FvInfo,
+ IN UINT32 FvInfoSize,
+ IN CONST EFI_GUID *ParentFvName, OPTIONAL
+ IN CONST EFI_GUID *ParentFileName OPTIONAL
+ )
+{
+ InternalPeiServicesInstallFvInfoPpi (TRUE, FvFormat, FvInfo, FvInfoSize, ParentFvName, ParentFileName, 0);
+}
+
+/**
+ Install a EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI instance so the PEI Core will be notified about a new firmware volume.
+
+ This function allocates, initializes, and installs a new EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI using
+ the parameters passed in to initialize the fields of the EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI instance.
+ If the resources can not be allocated for EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI, then ASSERT().
+ If the EFI_PEI_FIRMWARE_VOLUME_INFO2_PPI can not be installed, then ASSERT().
+
+ @param FvFormat Unique identifier of the format of the memory-mapped
+ firmware volume. This parameter is optional and
+ may be NULL. If NULL is specified, the
+ EFI_FIRMWARE_FILE_SYSTEM2_GUID format is assumed.
+ @param FvInfo Points to a buffer which allows the
+ EFI_PEI_FIRMWARE_VOLUME_PPI to process the volume.
+ The format of this buffer is specific to the FvFormat.
+ For memory-mapped firmware volumes, this typically
+ points to the first byte of the firmware volume.
+ @param FvInfoSize The size, in bytes, of FvInfo. For memory-mapped
+ firmware volumes, this is typically the size of
+ the firmware volume.
+ @param ParentFvName If the new firmware volume originated from a file
+ in a different firmware volume, then this parameter
+ specifies the GUID name of the originating firmware
+ volume. Otherwise, this parameter must be NULL.
+ @param ParentFileName If the new firmware volume originated from a file
+ in a different firmware volume, then this parameter
+ specifies the GUID file name of the originating
+ firmware file. Otherwise, this parameter must be NULL.
+ @param AuthenticationStatus Authentication Status
+**/
+VOID
+EFIAPI
+PeiServicesInstallFvInfo2Ppi (
+ IN CONST EFI_GUID *FvFormat, OPTIONAL
+ IN CONST VOID *FvInfo,
+ IN UINT32 FvInfoSize,
+ IN CONST EFI_GUID *ParentFvName, OPTIONAL
+ IN CONST EFI_GUID *ParentFileName, OPTIONAL
+ IN UINT32 AuthenticationStatus
+ )
+{
+ InternalPeiServicesInstallFvInfoPpi (FALSE, FvFormat, FvInfo, FvInfoSize, ParentFvName, ParentFileName, AuthenticationStatus);
+}
+
diff --git a/MdePkg/Library/PeiServicesLib/PeiServicesLib.inf b/MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
index cd70de780..1806042a2 100644
--- a/MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
+++ b/MdePkg/Library/PeiServicesLib/PeiServicesLib.inf
@@ -1,7 +1,7 @@
## @file
# PEI Services Library implementation.
#
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
@@ -43,6 +43,7 @@
[Ppis]
gEfiPeiFirmwareVolumeInfoPpiGuid ## PRODUCES
+ gEfiPeiFirmwareVolumeInfo2PpiGuid ## PRODUCES
diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec
index 916e53877..6f9dcf955 100644
--- a/MdePkg/MdePkg.dec
+++ b/MdePkg/MdePkg.dec
@@ -696,6 +696,9 @@
## Include/Ppi/I2cMaster.h
gEfiPeiI2cMasterPpiGuid = { 0xb3bfab9b, 0x9f9c, 0x4e8b, { 0xad, 0x37, 0x7f, 0x8c, 0x51, 0xfc, 0x62, 0x80 }}
+ ## Include/Ppi/FirmwareVolumeInfo2.h
+ gEfiPeiFirmwareVolumeInfo2PpiGuid = { 0xea7ca24b, 0xded5, 0x4dad, { 0xa3, 0x89, 0xbf, 0x82, 0x7e, 0x8f, 0x9b, 0x38 } }
+
[Protocols]
#
# Protocols defined in PI1.0.