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