]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/GuidedSectionExtaction.h
Updated headers to follow coding standard
[mirror_edk2.git] / MdePkg / Include / Protocol / GuidedSectionExtaction.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
7 Copyright (c) 2006 - 2007, Intel Corporation \r
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
65 @param This Indicates the\r
66 EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL instance.\r
67 \r
68 @param InputSection Buffer containing the input GUIDed section\r
69 to be processed. OutputBuffer OutputBuffer\r
70 is allocated from boot services pool\r
71 memory and contains the new section\r
72 stream. The caller is responsible for\r
73 freeing this buffer.\r
74\r
75 @param OutputSize A pointer to a caller-allocated UINTN in\r
76 which the size of OutputBuffer allocation\r
77 is stored. If the function returns\r
78 anything other than EFI_SUCCESS, the value\r
79 of OutputSize is undefined.\r
80\r
81 @param AuthenticationStatus A pointer to a caller-allocated\r
82 UINT32 that indicates the\r
83 authentication status of the\r
84 output buffer. If the input\r
85 section's\r
86 GuidedSectionHeader.Attributes\r
87 field has the\r
88 EFI_GUIDED_SECTION_AUTH_STATUS_VAL\r
89 bit as clear, AuthenticationStatus\r
90 must return zero. Both local bits\r
91 (19:16) and aggregate bits (3:0)\r
92 in AuthenticationStatus are\r
93 returned by ExtractSection().\r
94 These bits reflect the status of\r
95 the extraction operation. The bit\r
96 pattern in both regions must be\r
97 the same, as the local and\r
98 aggregate authentication statuses\r
99 have equivalent meaning at this\r
100 level. If the function returns\r
101 anything other than EFI_SUCCESS,\r
102 the value of AuthenticationStatus\r
103 is undefined.\r
104\r
105\r
106 @retval EFI_SUCCESS The InputSection was successfully\r
107 processed and the section contents were\r
108 returned.\r
109\r
110 @retval EFI_OUT_OF_RESOURCES The system has insufficient\r
111 resources to process the\r
112 request.\r
113\r
114 @retval EFI_INVALID_PARAMETER The GUID in InputSection does\r
115 not match this instance of the\r
116 GUIDed Section Extraction\r
117 Protocol.\r
118\r
119**/\r
120typedef\r
121EFI_STATUS\r
122(EFIAPI *EFI_EXTRACT_GUIDED_SECTION)(\r
123 IN CONST EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL *This,\r
124 IN CONST VOID *InputSection,\r
125 OUT VOID **OutputBuffer,\r
126 OUT UINTN *OutputSize,\r
127 OUT UINT32 *AuthenticationStatus\r
128);\r
129\r
130\r
131/**\r
132 \r
133 Takes the GUIDed section as input and produces the section\r
134 stream data. See the ExtractSection() function description.\r
135\r
136**/\r
137struct _EFI_GUIDED_SECTION_EXTRACTION_PROTOCOL {\r
138 EFI_EXTRACT_GUIDED_SECTION ExtractSection;\r
139};\r
140\r
141\r
142#endif\r