2007-06-15 12:02:42 +02:00
|
|
|
/** @file
|
2009-06-10 19:07:59 +02:00
|
|
|
This file declares Section Extraction Protocol.
|
2007-06-15 12:02:42 +02:00
|
|
|
|
|
|
|
This interface provides a means of decoding a set of sections into a linked list of
|
|
|
|
leaf sections. This provides for an extensible and flexible file format.
|
|
|
|
|
2018-06-27 15:06:55 +02:00
|
|
|
Copyright (c) 2006 - 2018, 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.
|
2010-03-16 02:53:11 +01:00
|
|
|
The full text of the license may be found at
|
2018-06-27 15:06:55 +02:00
|
|
|
http://opensource.org/licenses/bsd-license.php.
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
2010-03-16 02:53:11 +01:00
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
2007-06-15 12:02:42 +02:00
|
|
|
|
|
|
|
@par Revision Reference:
|
|
|
|
This protocol is defined in Firmware Volume Specification.
|
2010-03-16 02:53:11 +01:00
|
|
|
Version 0.9.
|
2007-06-15 12:02:42 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef _SECTION_EXTRACTION_PROTOCOL_H_
|
|
|
|
#define _SECTION_EXTRACTION_PROTOCOL_H_
|
|
|
|
|
|
|
|
//
|
|
|
|
// Protocol GUID definition
|
|
|
|
//
|
|
|
|
#define EFI_SECTION_EXTRACTION_PROTOCOL_GUID \
|
|
|
|
{ \
|
|
|
|
0x448F5DA4, 0x6DD7, 0x4FE1, {0x93, 0x07, 0x69, 0x22, 0x41, 0x92, 0x21, 0x5D } \
|
|
|
|
}
|
|
|
|
|
|
|
|
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.
|
2010-03-16 02:53:11 +01:00
|
|
|
@param SectionStreamLength The size in bytes of the section stream.
|
|
|
|
@param SectionStream A buffer containing the new section stream.
|
2007-06-15 12:02:42 +02:00
|
|
|
@param SectionStreamHandle A pointer to a caller-allocated UINTN that,
|
|
|
|
on output, contains the new section stream handle.
|
|
|
|
|
2010-03-16 02:53:11 +01:00
|
|
|
@retval EFI_SUCCESS The SectionStream was successfully processed, and
|
2007-06-15 12:02:42 +02:00
|
|
|
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
|
2008-07-31 09:44:54 +02:00
|
|
|
(EFIAPI *EFI_OPEN_SECTION_STREAM)(
|
2007-06-15 12:02:42 +02:00
|
|
|
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.
|
2018-06-27 15:06:55 +02:00
|
|
|
@param SectionType The pointer to an EFI_SECTION_TYPE. If SectionType == NULL,
|
|
|
|
the contents of the entire section stream are returned
|
|
|
|
in Buffer. If SectionType is not NULL, only the
|
|
|
|
requested section is returned. EFI_SECTION_ALL
|
|
|
|
matches all section types and can be used as a
|
2010-03-16 02:53:11 +01:00
|
|
|
wild card to extract all sections in order.
|
|
|
|
@param SectionDefinitionGuid The pointer to an EFI_GUID. If SectionType ==
|
2018-06-27 15:06:55 +02:00
|
|
|
EFI_SECTION_GUID_DEFINED, SectionDefinitionGuid
|
|
|
|
indicates what section GUID to search for. If
|
2010-03-16 02:53:11 +01:00
|
|
|
SectionType !=EFI_SECTION_GUID_DEFINED, then
|
2007-06-15 12:02:42 +02:00
|
|
|
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.
|
2010-03-16 02:53:11 +01:00
|
|
|
@param BufferSize A pointer to a caller-allocated UINTN.
|
|
|
|
@param AuthenticationStatus A pointer to a caller-allocated UINT32 in
|
2018-06-27 15:06:55 +02:00
|
|
|
which any meta-data from encapsulation GUID-defined
|
2010-03-16 02:53:11 +01:00
|
|
|
sections is returned.
|
2007-06-15 12:02:42 +02:00
|
|
|
|
|
|
|
@retval EFI_SUCCESS The SectionStream was successfully processed and
|
|
|
|
the section contents were returned in Buffer.
|
2010-03-16 02:53:11 +01:00
|
|
|
@retval EFI_PROTOCOL_ERROR A GUID-defined section was encountered inthe section
|
2018-06-27 15:06:55 +02:00
|
|
|
stream with its EFI_GUIDED_SECTION_PROCESSING_REQUIRED
|
|
|
|
bit set, but there was no corresponding GUIDed
|
2010-03-16 02:53:11 +01:00
|
|
|
Section Extraction Protocol in the handle database.
|
2007-06-15 12:02:42 +02:00
|
|
|
@retval EFI_NOT_FOUND An error was encountered when parsing the SectionStream,
|
2018-06-27 15:06:55 +02:00
|
|
|
which indicates that the SectionStream is not
|
2010-03-16 02:53:11 +01:00
|
|
|
correctly formatted. Or, the requested section does not exist.
|
2007-06-15 12:02:42 +02:00
|
|
|
@retval EFI_OUT_OF_RESOURCES The system has insufficient resources to process
|
|
|
|
the request.
|
|
|
|
@retval EFI_INVALID_PARAMETER The SectionStreamHandle does not exist.
|
2018-06-27 15:06:55 +02:00
|
|
|
@retval EFI_WARN_BUFFER_TOO_SMALL The size of the input buffer is insufficient
|
|
|
|
to contain the requested section. The input
|
2010-03-16 02:53:11 +01:00
|
|
|
buffer is filled and section contents are truncated.
|
2007-06-15 12:02:42 +02:00
|
|
|
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2008-07-31 09:44:54 +02:00
|
|
|
(EFIAPI *EFI_GET_SECTION)(
|
2007-06-15 12:02:42 +02:00
|
|
|
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
|
2008-07-31 09:44:54 +02:00
|
|
|
(EFIAPI *EFI_CLOSE_SECTION_STREAM)(
|
2007-06-15 12:02:42 +02:00
|
|
|
IN EFI_SECTION_EXTRACTION_PROTOCOL *This,
|
|
|
|
IN UINTN SectionStreamHandle
|
|
|
|
);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Protocol definition
|
|
|
|
//
|
|
|
|
struct _EFI_SECTION_EXTRACTION_PROTOCOL {
|
2009-07-02 09:40:24 +02:00
|
|
|
///
|
|
|
|
/// Takes a bounded stream of sections and returns a section stream handle.
|
|
|
|
///
|
2007-06-15 12:02:42 +02:00
|
|
|
EFI_OPEN_SECTION_STREAM OpenSectionStream;
|
2009-07-02 09:40:24 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
/// Given a section stream handle, retrieves the requested section and
|
|
|
|
/// meta-data from the section stream.
|
|
|
|
///
|
2007-06-15 12:02:42 +02:00
|
|
|
EFI_GET_SECTION GetSection;
|
2009-07-02 09:40:24 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
/// Given a section stream handle, closes the section stream.
|
|
|
|
///
|
2007-06-15 12:02:42 +02:00
|
|
|
EFI_CLOSE_SECTION_STREAM CloseSectionStream;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern EFI_GUID gEfiSectionExtractionProtocolGuid;
|
|
|
|
|
|
|
|
#endif
|