16#define PRE_PI_EXTRACT_GUIDED_SECTION_DATA_GUID { 0x385A982C, 0x2F49, 0x4043, { 0xA5, 0x1E, 0x49, 0x01, 0x02, 0x5C, 0x8B, 0x6B }}
19 UINT32 NumberOfExtractHandler;
20 GUID *ExtractHandlerGuidTable;
31 GUID SavedDataGuid = PRE_PI_EXTRACT_GUIDED_SECTION_DATA_GUID;
53 if (SectionGuid ==
NULL) {
57 SavedData = GetSavedData ();
62 for (Index = 0; Index < SavedData->NumberOfExtractHandler; Index++) {
63 if (
CompareGuid (&SavedData->ExtractHandlerGuidTable[Index], SectionGuid)) {
71 if (Index < SavedData->NumberOfExtractHandler) {
72 SavedData->ExtractDecodeHandlerTable[Index] = DecodeHandler;
73 SavedData->ExtractGetInfoHandlerTable[Index] = GetInfoHandler;
80 if (SavedData->NumberOfExtractHandler >=
PcdGet32 (PcdMaximumGuidedExtractHandler)) {
87 CopyGuid (&SavedData->ExtractHandlerGuidTable[SavedData->NumberOfExtractHandler], SectionGuid);
88 SavedData->ExtractDecodeHandlerTable[SavedData->NumberOfExtractHandler] = DecodeHandler;
89 SavedData->ExtractGetInfoHandlerTable[SavedData->NumberOfExtractHandler++] = GetInfoHandler;
96ExtractGuidedSectionGetGuidList (
102 ASSERT (ExtractHandlerGuidTable !=
NULL);
104 SavedData = GetSavedData ();
106 *ExtractHandlerGuidTable = SavedData->ExtractHandlerGuidTable;
107 return SavedData->NumberOfExtractHandler;
114 OUT UINT32 *OutputBufferSize,
115 OUT UINT32 *ScratchBufferSize,
116 OUT UINT16 *SectionAttribute
123 if (InputSection ==
NULL) {
127 ASSERT (OutputBufferSize !=
NULL);
128 ASSERT (ScratchBufferSize !=
NULL);
129 ASSERT (SectionAttribute !=
NULL);
131 SavedData = GetSavedData ();
133 if (IS_SECTION2 (InputSection)) {
142 for (Index = 0; Index < SavedData->NumberOfExtractHandler; Index++) {
143 if (
CompareGuid (&SavedData->ExtractHandlerGuidTable[Index], SectionDefinitionGuid)) {
151 if (Index == SavedData->NumberOfExtractHandler) {
158 return SavedData->ExtractGetInfoHandlerTable[Index](
168ExtractGuidedSectionDecode (
170 OUT VOID **OutputBuffer,
171 OUT VOID *ScratchBuffer OPTIONAL,
172 OUT UINT32 *AuthenticationStatus
179 if (InputSection ==
NULL) {
183 ASSERT (OutputBuffer !=
NULL);
184 ASSERT (AuthenticationStatus !=
NULL);
186 SavedData = GetSavedData ();
188 if (IS_SECTION2 (InputSection)) {
197 for (Index = 0; Index < SavedData->NumberOfExtractHandler; Index++) {
198 if (
CompareGuid (&SavedData->ExtractHandlerGuidTable[Index], SectionDefinitionGuid)) {
206 if (Index == SavedData->NumberOfExtractHandler) {
213 return SavedData->ExtractDecodeHandlerTable[Index](
223ExtractGuidedSectionLibConstructor (
228 GUID HobGuid = PRE_PI_EXTRACT_GUIDED_SECTION_DATA_GUID;
234 if (SavedData.ExtractHandlerGuidTable ==
NULL) {
239 if (SavedData.ExtractDecodeHandlerTable ==
NULL) {
244 if (SavedData.ExtractGetInfoHandlerTable ==
NULL) {
251 SavedData.NumberOfExtractHandler = 0;
VOID *EFIAPI GetFirstGuidHob(IN CONST EFI_GUID *Guid)
VOID *EFIAPI BuildGuidDataHob(IN CONST EFI_GUID *Guid, IN VOID *Data, IN UINTN DataLength)
BOOLEAN EFIAPI CompareGuid(IN CONST GUID *Guid1, IN CONST GUID *Guid2)
GUID *EFIAPI CopyGuid(OUT GUID *DestinationGuid, IN CONST GUID *SourceGuid)
#define RETURN_OUT_OF_RESOURCES
#define RETURN_INVALID_PARAMETER
#define PcdGet32(TokenName)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)