add some framework definitions
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / GuidedSectionExtraction.h
1 /** @file
2 This file declares GUIDed section extraction protocol.
3
4 This interface provides a means of decoding a GUID defined encapsulation
5 section. There may be multiple different GUIDs associated with the GUIDed
6 section extraction protocol. That is, all instances of the GUIDed section
7 extraction protocol must have the same interface structure.
8
9 Copyright (c) 2006, Intel Corporation
10 All rights reserved. This program and the accompanying materials
11 are licensed and made available under the terms and conditions of the BSD License
12 which accompanies this distribution. The full text of the license may be found at
13 http://opensource.org/licenses/bsd-license.php
14
15 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
16 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17
18 Module Name: GuidedSectionExtraction.h
19
20 @par Revision Reference:
21 This protocol is defined in Firmware Volume Specification.
22 Version 0.9
23
24 **/
25
26 #ifndef __GUIDED_SECTION_EXTRACTION_PROTOCOL_H__
27 #define __GUIDED_SECTION_EXTRACTION_PROTOCOL_H__
28
29
30 //
31 // Protocol GUID definition. Each GUIDed section extraction protocol has the
32 // same interface but with different GUID. All the GUIDs is defined here.
33 // May add multiple GUIDs here.
34 //
35 #define EFI_CRC32_GUIDED_SECTION_EXTRACTION_PROTOCOL_GUID \
36 { \
37 0xFC1BCDB0, 0x7D31, 0x49aa, {0x93, 0x6A, 0xA4, 0x60, 0x0D, 0x9D, 0xD0, 0x83 } \
38 }
39
40 //
41 // Forward reference for pure ANSI compatability
42 //
43 typedef struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL;
44
45 //
46 // Protocol member functions
47 //
48 /**
49 Processes the input section and returns the data contained therein along
50 with the authentication status.
51
52 @param This Indicates the EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL instance.
53 @param InputSection Buffer containing the input GUIDed section to be processed.
54 @param OutputBuffer *OutputBuffer is allocated from boot services pool memory
55 and contains the new section stream.
56 @param OutputSize A pointer to a caller-allocated UINTN in which the size
57 of *OutputBuffer allocation is stored.
58 @param AuthenticationStatus A pointer to a caller-allocated UINT32 that
59 indicates the authentication status of the output buffer.
60
61 @retval EFI_SUCCESS The InputSection was successfully processed and the
62 section contents were returned.
63 @retval EFI_OUT_OF_RESOURCES The system has insufficient resources to
64 process the request.
65 @retval EFI_INVALID_PARAMETER The GUID in InputSection does not match
66 this instance of the GUIDed Section Extraction Protocol.
67
68 **/
69
70 typedef
71 EFI_STATUS
72 (EFIAPI *EFI_EXTRACT_GUIDED_SECTION) (
73 IN EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *This,
74 IN VOID *InputSection,
75 OUT VOID **OutputBuffer,
76 OUT UINTN *OutputSize,
77 OUT UINT32 *AuthenticationStatus
78 );
79
80 //
81 // Protocol definition
82 //
83 /**
84 @par Protocol Description:
85 If a GUID-defined section is encountered when doing section extraction,
86 the section extraction driver calls the appropriate instance of the GUIDed
87 Section Extraction Protocol to extract the section stream contained therein.
88
89 @param ExtractSection
90 Takes the GUIDed section as input and produces the section stream data.
91
92 **/
93 struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL {
94 EFI_EXTRACT_GUIDED_SECTION ExtractSection;
95 };
96
97 //
98 // may add other GUID here
99 //
100 extern EFI_GUID gEfiCrc32GuidedSectionExtractionProtocolGuid;
101
102 #endif