From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) by mx.groups.io with SMTP id smtpd.web08.9743.1661854489139790730 for ; Tue, 30 Aug 2022 03:14:55 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20210112 header.b=O5kT15Gj; spf=pass (domain: gmail.com, ip: 209.85.167.45, mailfrom: aladyshev22@gmail.com) Received: by mail-lf1-f45.google.com with SMTP id j14so4504161lfu.4 for ; Tue, 30 Aug 2022 03:14:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=GxZKbm3lZHOXVFwaTyaJSN9Ri1fJghazkud+uM4oovQ=; b=O5kT15GjFFoEN/ymqeAL1Sh5cWLEwIrcTJk78uVfK4MIIjje3tWhXj/nV9+z5TswZ3 RFo3xFOxhMhHhZtKWR1pccIroxxMspvxIHSa+qmqydGT3OkAWMWBG6ksqk7HnptbAoJQ 1+a3HsFfqvj0vOpEzKT1POAkQ6OBzaXDhnQx3MWc3hc3Q2vUXd+5LdDXd3BOdqYt32zi AicPSw/WN2ZH28F6xIo4b7l0wCdth7Ceje7XGZpNIQeFHcRuLhiUxJ5mwRWPMtlpi8/2 rV+7YElWmfB0hlkp3WKTgU6v3K0j7paieusXRD5VHfGZWjM9vvpt+NXV14b/uwTUe9IZ r3zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=GxZKbm3lZHOXVFwaTyaJSN9Ri1fJghazkud+uM4oovQ=; b=OFWqN+DR/P1ppK0j308e3hofq6bz3S5TBcyw3ArSTbx6fCHT+7zdkxIi/0jQmbW7W4 i19frWcOokplaZLzpO9S0DW+ANzLXXy67AEqYVG2wPNPWDFtNzYWb8AWdGUck9jvF1yH 4hRwyoCHqxCqUcay6uYb27jizoZhVNFDjO5QViM8g8X3XRBVU5Vzao6ucjlvqeuszoRH x/pYeNeHJFwtccDgvfcYXihnA/K8Uu7tHyKq9MFhqeAonnmVoKhNbfMXSovIsow3EkVv yzwIvDh+dip+tqlqWSDSKqveGQH0ILSdVm+8tqjfhns+ZU/12jGoJapHcyNdnyjFhpU0 +44g== X-Gm-Message-State: ACgBeo17ehYEUSQy9S6uGCTuyB0D0ReU3+2xjRHtiu6VkKcorvn/J9F9 UtHrHEykuvkLyjJ51Yp/mKpLJj6N+tc= X-Google-Smtp-Source: AA6agR6LgVG6jYuXrWiYegsNdmHTmjuymYx9L/B9YFPgS2hjPPcuoLnBTfHEAXw9v6EwjG1Yq6CZ5w== X-Received: by 2002:a05:6512:259e:b0:494:61c3:6c2 with SMTP id bf30-20020a056512259e00b0049461c306c2mr4493506lfb.153.1661854494118; Tue, 30 Aug 2022 03:14:54 -0700 (PDT) Return-Path: Received: from PC10319.67 ([82.97.198.254]) by smtp.googlemail.com with ESMTPSA id u9-20020a05651c130900b0026008acb55asm1716755lja.113.2022.08.30.03.14.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Aug 2022 03:14:53 -0700 (PDT) From: "Konstantin Aladyshev" To: devel@edk2.groups.io Cc: bob.c.feng@intel.com, gaoliming@byosoft.com.cn, yuwei.chen@intel.com, Konstantin Aladyshev Subject: [PATCH 5/6] BaseTools/VolInfo: Parse apriori files Date: Tue, 30 Aug 2022 13:14:44 +0300 Message-Id: <20220830101445.18110-5-aladyshev22@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220830101445.18110-1-aladyshev22@gmail.com> References: <20220830101445.18110-1-aladyshev22@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Output file GUIDs from the DXE and PEI apriori files. Signed-off-by: Konstantin Aladyshev --- BaseTools/Source/C/VolInfo/VolInfo.c | 74 ++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/BaseTools/Source/C/VolInfo/VolInfo.c b/BaseTools/Source/C/VolI= nfo/VolInfo.c index 2d7c6212b3..28c6806cf0 100644 --- a/BaseTools/Source/C/VolInfo/VolInfo.c +++ b/BaseTools/Source/C/VolInfo/VolInfo.c @@ -43,6 +43,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent //=0D =0D EFI_GUID gEfiCrc32GuidedSectionExtractionProtocolGuid =3D EFI_CRC32_GUIDE= D_SECTION_EXTRACTION_PROTOCOL_GUID;=0D +EFI_GUID gPeiAprioriFileNameGuid =3D { 0x1b45cc0a, 0x156a, 0x428a, { 0XAF= , 0x62, 0x49, 0x86, 0x4d, 0xa0, 0xe6, 0xe6 }};=0D +EFI_GUID gAprioriGuid =3D { 0xFC510EE7, 0xFFDC, 0x11D4, { 0xBD, 0x41, 0x0= 0, 0x80, 0xC7, 0x3C, 0x88, 0x81 }};=0D =0D #define UTILITY_MAJOR_VERSION 1=0D #define UTILITY_MINOR_VERSION 0=0D @@ -107,6 +109,12 @@ ReadHeader ( OUT BOOLEAN *ErasePolarity=0D );=0D =0D +STATIC=0D +EFI_STATUS=0D +PrintAprioriFile (=0D + EFI_FFS_FILE_HEADER *FileHeader=0D + );=0D +=0D STATIC=0D EFI_STATUS=0D PrintFileInfo (=0D @@ -1083,6 +1091,53 @@ Returns: return EFI_SUCCESS;=0D }=0D =0D +STATIC=0D +EFI_STATUS=0D +PrintAprioriFile (=0D + EFI_FFS_FILE_HEADER *FileHeader=0D + )=0D +/*++=0D +=0D +Routine Description:=0D +=0D + Print GUIDs from the APRIORI file=0D +=0D +Arguments:=0D +=0D + FileHeader - The file header=0D +=0D +Returns:=0D +=0D + EFI_SUCCESS - The APRIORI file was parsed correctly=0D + EFI_SECTION_ERROR - Problem with file parsing=0D +=0D +--*/=0D +{=0D + UINT8 GuidBuffer[PRINTED_GUID_BUFFER_SIZE];=0D + UINT32 HeaderSize;=0D +=0D + HeaderSize =3D FvBufGetFfsHeaderSize (FileHeader);=0D +=0D + if (FileHeader->Type !=3D EFI_FV_FILETYPE_FREEFORM)=0D + return EFI_SECTION_ERROR;=0D +=0D + EFI_COMMON_SECTION_HEADER* SectionHeader =3D (EFI_COMMON_SECTION_HEADER = *) ((UINTN) FileHeader + HeaderSize);=0D + if (SectionHeader->Type !=3D EFI_SECTION_RAW)=0D + return EFI_SECTION_ERROR;=0D +=0D + UINT32 SectionLength =3D GetSectionFileLength (SectionHeader);=0D + EFI_GUID* FileName =3D (EFI_GUID *) ((UINT8 *) SectionHeader + sizeof (E= FI_COMMON_SECTION_HEADER));=0D + while (((UINT8 *) FileName) < ((UINT8 *) SectionHeader + SectionLength))= {=0D + PrintGuidToBuffer (FileName, GuidBuffer, sizeof (GuidBuffer), TRUE);=0D + printf ("%s ", GuidBuffer);=0D + PrintGuidName (GuidBuffer);=0D + printf ("\n");=0D + FileName++;=0D + }=0D +=0D + return EFI_SUCCESS;=0D +}=0D +=0D STATIC=0D EFI_STATUS=0D PrintFileInfo (=0D @@ -1339,6 +1394,25 @@ Returns: break;=0D }=0D =0D + if (!CompareGuid (=0D + &FileHeader->Name,=0D + &gPeiAprioriFileNameGuid=0D + ))=0D + {=0D + printf("\n");=0D + printf("PEI APRIORI FILE:\n");=0D + return PrintAprioriFile (FileHeader);=0D + }=0D + if (!CompareGuid (=0D + &FileHeader->Name,=0D + &gAprioriGuid=0D + ))=0D + {=0D + printf("\n");=0D + printf("DXE APRIORI FILE:\n");=0D + return PrintAprioriFile (FileHeader);=0D + }=0D +=0D return EFI_SUCCESS;=0D }=0D =0D --=20 2.25.1