]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/GuidedSectionExtraction.h
Formalize comments for Protocols and PPIs.
[mirror_edk2.git] / MdePkg / Include / Protocol / GuidedSectionExtraction.h
CommitLineData
d1f95000 1/** @file\r
2 If a GUID-defined section is encountered when doing section\r
3 extraction, the section extraction driver calls the appropriate\r
4 instance of the GUIDed Section Extraction Protocol to extract\r
5 the section stream contained therein.\r
6\r
4ca9b6c4 7 Copyright (c) 2006 - 2008, Intel Corporation \r
d1f95000 8 All rights reserved. This program and the accompanying materials \r
9 are licensed and made available under the terms and conditions of the BSD License \r
10 which accompanies this distribution. The full text of the license may be found at \r
11 http://opensource.org/licenses/bsd-license.php \r
12\r
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
15\r
d1f95000 16 @par Revision Reference: PI\r
17 Version 1.00.\r
18\r
19**/\r
20\r
21#ifndef __GUID_SECTION_EXTRACTION_PROTOCOL_H__\r
22#define __GUID_SECTION_EXTRACTION_PROTOCOL_H__\r
23\r
24//\r
25// The protocol interface structures are identified by associating \r
26// them with a GUID. Each instance of a protocol with a given \r
27// GUID must have the same interface structure. While all instances \r
28// of the GUIDed Section Extraction Protocol must have the same \r
29// interface structure, they do not all have the same GUID. The \r
30// GUID that is associated with an instance of the GUIDed Section \r
31// Extraction Protocol is used to correlate it with the GUIDed \r
32// section type that it is intended to process. \r
33//\r
34\r
35typedef struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL;\r
36\r
37\r
38/**\r
39 The ExtractSection() function processes the input section and\r
40 allocates a buffer from the pool in which it returns the section\r
41 contents. If the section being extracted contains\r
42 authentication information (the section's\r
43 GuidedSectionHeader.Attributes field has the\r
44 EFI_GUIDED_SECTION_AUTH_STATUS_VALID bit set), the values\r
45 returned in AuthenticationStatus must reflect the results of\r
46 the authentication operation. Depending on the algorithm and\r
47 size of the encapsulated data, the time that is required to do\r
48 a full authentication may be prohibitively long for some\r
49 classes of systems. To indicate this, use\r
50 EFI_SECURITY_POLICY_PROTOCOL_GUID, which may be published by\r
51 the security policy driver (see the Platform Initialization\r
52 Driver Execution Environment Core Interface Specification for\r
53 more details and the GUID definition). If the\r
54 EFI_SECURITY_POLICY_PROTOCOL_GUID exists in the handle\r
55 database, then, if possible, full authentication should be\r
56 skipped and the section contents simply returned in the\r
57 OutputBuffer. In this case, the\r
58 EFI_AUTH_STATUS_PLATFORM_OVERRIDE bit AuthenticationStatus\r
59 must be set on return. ExtractSection() is callable only from\r
50615d1f 60 TPL_NOTIFY and below. Behavior of ExtractSection() at any\r
61 EFI_TPL above TPL_NOTIFY is undefined. Type EFI_TPL is\r
d1f95000 62 defined in RaiseTPL() in the UEFI 2.0 specification.\r
63\r
64 \r
4ca9b6c4 65 @param This Indicates the EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL instance.\r
d1f95000 66 \r
67 @param InputSection Buffer containing the input GUIDed section\r
68 to be processed. OutputBuffer OutputBuffer\r
69 is allocated from boot services pool\r
70 memory and contains the new section\r
71 stream. The caller is responsible for\r
72 freeing this buffer.\r
73\r
74 @param OutputSize A pointer to a caller-allocated UINTN in\r
75 which the size of OutputBuffer allocation\r
76 is stored. If the function returns\r
77 anything other than EFI_SUCCESS, the value\r
78 of OutputSize is undefined.\r
79\r
80 @param AuthenticationStatus A pointer to a caller-allocated\r
81 UINT32 that indicates the\r
82 authentication status of the\r
83 output buffer. If the input\r
84 section's\r
85 GuidedSectionHeader.Attributes\r
86 field has the\r
87 EFI_GUIDED_SECTION_AUTH_STATUS_VAL\r
88 bit as clear, AuthenticationStatus\r
89 must return zero. Both local bits\r
90 (19:16) and aggregate bits (3:0)\r
91 in AuthenticationStatus are\r
92 returned by ExtractSection().\r
93 These bits reflect the status of\r
94 the extraction operation. The bit\r
95 pattern in both regions must be\r
96 the same, as the local and\r
97 aggregate authentication statuses\r
98 have equivalent meaning at this\r
99 level. If the function returns\r
100 anything other than EFI_SUCCESS,\r
101 the value of AuthenticationStatus\r
102 is undefined.\r
103\r
4ca9b6c4
LG
104 @retval EFI_SUCCESS The InputSection was successfully\r
105 processed and the section contents were\r
106 returned.\r
d1f95000 107\r
108 @retval EFI_OUT_OF_RESOURCES The system has insufficient\r
109 resources to process the\r
110 request.\r
111\r
112 @retval EFI_INVALID_PARAMETER The GUID in InputSection does\r
113 not match this instance of the\r
114 GUIDed Section Extraction\r
115 Protocol.\r
116\r
117**/\r
118typedef\r
119EFI_STATUS\r
120(EFIAPI *EFI_EXTRACT_GUIDED_SECTION)(\r
121 IN CONST EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *This,\r
122 IN CONST VOID *InputSection,\r
123 OUT VOID **OutputBuffer,\r
124 OUT UINTN *OutputSize,\r
125 OUT UINT32 *AuthenticationStatus\r
126);\r
127\r
128\r
44717a39 129///\r
130/// Typically, protocol interface structures are identified by associating them with a GUID. Each\r
131/// instance of a protocol with a given GUID must have the same interface structure. While all instances\r
132/// of the GUIDed Section Extraction Protocol must have the same interface structure, they do not all\r
133/// have the same GUID. The GUID that is associated with an instance of the GUIDed Section\r
134/// Extraction Protocol is used to correlate it with the GUIDed section type that it is intended to process.\r
135///\r
d1f95000 136struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL {\r
137 EFI_EXTRACT_GUIDED_SECTION ExtractSection;\r
138};\r
139\r
140\r
141#endif\r