From ba2377328775b10caa4c2091a8997eb8685c39b8 Mon Sep 17 00:00:00 2001 From: AJFISH Date: Tue, 3 Jul 2007 18:34:24 +0000 Subject: Removed IntelframeworkPkg contamination from MdeModulePkg modules. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3019 6f19259b-4bc3-4df7-8a09-765794883524 --- MdePkg/Include/Pi/PiMultiPhase.h | 9 ++ MdePkg/Include/Ppi/GuidedSectionExtraction.h | 7 -- MdePkg/Include/Ppi/ReadOnlyVariable2.h | 4 +- MdePkg/Include/Protocol/GuidedSectionExtaction.h | 142 ---------------------- MdePkg/Include/Protocol/GuidedSectionExtraction.h | 142 ++++++++++++++++++++++ MdePkg/Include/Protocol/SectionExtraction.h | 142 ++++++++++++++++++++++ 6 files changed, 295 insertions(+), 151 deletions(-) delete mode 100644 MdePkg/Include/Protocol/GuidedSectionExtaction.h create mode 100644 MdePkg/Include/Protocol/GuidedSectionExtraction.h create mode 100644 MdePkg/Include/Protocol/SectionExtraction.h (limited to 'MdePkg/Include') 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/GuidedSectionExtaction.h deleted file mode 100644 index 55692e8080..0000000000 --- a/MdePkg/Include/Protocol/GuidedSectionExtaction.h +++ /dev/null @@ -1,142 +0,0 @@ -/** @file - If a GUID-defined section is encountered when doing section - extraction, the section extraction driver calls the appropriate - instance of the GUIDed Section Extraction Protocol to extract - the section stream contained therein. - - 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. - - @par Revision Reference: PI - Version 1.00. - -**/ - -#ifndef __GUID_SECTION_EXTRACTION_PROTOCOL_H__ -#define __GUID_SECTION_EXTRACTION_PROTOCOL_H__ - -// -// The protocol interface structures are identified by associating -// them with a GUID. Each instance of a protocol with a given -// GUID must have the same interface structure. While all instances -// of the GUIDed Section Extraction Protocol must have the same -// interface structure, they do not all have the same GUID. The -// GUID that is associated with an instance of the GUIDed Section -// Extraction Protocol is used to correlate it with the GUIDed -// section type that it is intended to process. -// - -typedef struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL; - - -/** - The ExtractSection() function processes the input section and - allocates a buffer from the pool in which it returns the section - contents. If the section being extracted contains - authentication information (the section's - GuidedSectionHeader.Attributes field has the - EFI_GUIDED_SECTION_AUTH_STATUS_VALID bit set), the values - returned in AuthenticationStatus must reflect the results of - the authentication operation. Depending on the algorithm and - size of the encapsulated data, the time that is required to do - a full authentication may be prohibitively long for some - classes of systems. To indicate this, use - EFI_SECURITY_POLICY_PROTOCOL_GUID, which may be published by - the security policy driver (see the Platform Initialization - Driver Execution Environment Core Interface Specification for - more details and the GUID definition). If the - EFI_SECURITY_POLICY_PROTOCOL_GUID exists in the handle - database, then, if possible, full authentication should be - skipped and the section contents simply returned in the - OutputBuffer. In this case, the - EFI_AUTH_STATUS_PLATFORM_OVERRIDE bit AuthenticationStatus - must be set on return. ExtractSection() is callable only from - TPL_NOTIFY and below. Behavior of ExtractSection() at any - EFI_TPL above TPL_NOTIFY is undefined. Type EFI_TPL is - defined in RaiseTPL() in the UEFI 2.0 specification. - - - @param This Indicates the - EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL instance. - - @param InputSection Buffer containing the input GUIDed section - to be processed. OutputBuffer OutputBuffer - is allocated from boot services pool - memory and contains the new section - stream. The caller is responsible for - freeing this buffer. - - @param OutputSize A pointer to a caller-allocated UINTN in - which the size of OutputBuffer allocation - is stored. If the function returns - anything other than EFI_SUCCESS, the value - of OutputSize is undefined. - - @param AuthenticationStatus A pointer to a caller-allocated - UINT32 that indicates the - authentication status of the - output buffer. If the input - section's - GuidedSectionHeader.Attributes - field has the - EFI_GUIDED_SECTION_AUTH_STATUS_VAL - bit as clear, AuthenticationStatus - must return zero. Both local bits - (19:16) and aggregate bits (3:0) - in AuthenticationStatus are - returned by ExtractSection(). - These bits reflect the status of - the extraction operation. The bit - pattern in both regions must be - the same, as the local and - aggregate authentication statuses - have equivalent meaning at this - level. If the function returns - anything other than EFI_SUCCESS, - the value of AuthenticationStatus - is undefined. - - - @retval EFI_SUCCESS The InputSection was successfully - processed and the section contents were - returned. - - @retval EFI_OUT_OF_RESOURCES The system has insufficient - resources to process the - request. - - @retval EFI_INVALID_PARAMETER The GUID in InputSection does - not match this instance of the - GUIDed Section Extraction - Protocol. - -**/ -typedef -EFI_STATUS -(EFIAPI *EFI_EXTRACT_GUIDED_SECTION)( - IN CONST EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *This, - IN CONST VOID *InputSection, - OUT VOID **OutputBuffer, - OUT UINTN *OutputSize, - OUT UINT32 *AuthenticationStatus -); - - -/** - - Takes the GUIDed section as input and produces the section - stream data. See the ExtractSection() function description. - -**/ -struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL { - EFI_EXTRACT_GUIDED_SECTION ExtractSection; -}; - - -#endif diff --git a/MdePkg/Include/Protocol/GuidedSectionExtraction.h b/MdePkg/Include/Protocol/GuidedSectionExtraction.h new file mode 100644 index 0000000000..55692e8080 --- /dev/null +++ b/MdePkg/Include/Protocol/GuidedSectionExtraction.h @@ -0,0 +1,142 @@ +/** @file + If a GUID-defined section is encountered when doing section + extraction, the section extraction driver calls the appropriate + instance of the GUIDed Section Extraction Protocol to extract + the section stream contained therein. + + 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. + + @par Revision Reference: PI + Version 1.00. + +**/ + +#ifndef __GUID_SECTION_EXTRACTION_PROTOCOL_H__ +#define __GUID_SECTION_EXTRACTION_PROTOCOL_H__ + +// +// The protocol interface structures are identified by associating +// them with a GUID. Each instance of a protocol with a given +// GUID must have the same interface structure. While all instances +// of the GUIDed Section Extraction Protocol must have the same +// interface structure, they do not all have the same GUID. The +// GUID that is associated with an instance of the GUIDed Section +// Extraction Protocol is used to correlate it with the GUIDed +// section type that it is intended to process. +// + +typedef struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL; + + +/** + The ExtractSection() function processes the input section and + allocates a buffer from the pool in which it returns the section + contents. If the section being extracted contains + authentication information (the section's + GuidedSectionHeader.Attributes field has the + EFI_GUIDED_SECTION_AUTH_STATUS_VALID bit set), the values + returned in AuthenticationStatus must reflect the results of + the authentication operation. Depending on the algorithm and + size of the encapsulated data, the time that is required to do + a full authentication may be prohibitively long for some + classes of systems. To indicate this, use + EFI_SECURITY_POLICY_PROTOCOL_GUID, which may be published by + the security policy driver (see the Platform Initialization + Driver Execution Environment Core Interface Specification for + more details and the GUID definition). If the + EFI_SECURITY_POLICY_PROTOCOL_GUID exists in the handle + database, then, if possible, full authentication should be + skipped and the section contents simply returned in the + OutputBuffer. In this case, the + EFI_AUTH_STATUS_PLATFORM_OVERRIDE bit AuthenticationStatus + must be set on return. ExtractSection() is callable only from + TPL_NOTIFY and below. Behavior of ExtractSection() at any + EFI_TPL above TPL_NOTIFY is undefined. Type EFI_TPL is + defined in RaiseTPL() in the UEFI 2.0 specification. + + + @param This Indicates the + EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL instance. + + @param InputSection Buffer containing the input GUIDed section + to be processed. OutputBuffer OutputBuffer + is allocated from boot services pool + memory and contains the new section + stream. The caller is responsible for + freeing this buffer. + + @param OutputSize A pointer to a caller-allocated UINTN in + which the size of OutputBuffer allocation + is stored. If the function returns + anything other than EFI_SUCCESS, the value + of OutputSize is undefined. + + @param AuthenticationStatus A pointer to a caller-allocated + UINT32 that indicates the + authentication status of the + output buffer. If the input + section's + GuidedSectionHeader.Attributes + field has the + EFI_GUIDED_SECTION_AUTH_STATUS_VAL + bit as clear, AuthenticationStatus + must return zero. Both local bits + (19:16) and aggregate bits (3:0) + in AuthenticationStatus are + returned by ExtractSection(). + These bits reflect the status of + the extraction operation. The bit + pattern in both regions must be + the same, as the local and + aggregate authentication statuses + have equivalent meaning at this + level. If the function returns + anything other than EFI_SUCCESS, + the value of AuthenticationStatus + is undefined. + + + @retval EFI_SUCCESS The InputSection was successfully + processed and the section contents were + returned. + + @retval EFI_OUT_OF_RESOURCES The system has insufficient + resources to process the + request. + + @retval EFI_INVALID_PARAMETER The GUID in InputSection does + not match this instance of the + GUIDed Section Extraction + Protocol. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_EXTRACT_GUIDED_SECTION)( + IN CONST EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *This, + IN CONST VOID *InputSection, + OUT VOID **OutputBuffer, + OUT UINTN *OutputSize, + OUT UINT32 *AuthenticationStatus +); + + +/** + + Takes the GUIDed section as input and produces the section + stream data. See the ExtractSection() function description. + +**/ +struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL { + EFI_EXTRACT_GUIDED_SECTION ExtractSection; +}; + + +#endif 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 -- cgit v1.2.3