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