From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web10.980.1626210081208940964 for ; Tue, 13 Jul 2021 14:01:21 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=vBJGCWTI; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: guo.dong@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10044"; a="189926422" X-IronPort-AV: E=Sophos;i="5.84,237,1620716400"; d="scan'208";a="189926422" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2021 14:01:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.84,237,1620716400"; d="scan'208";a="459721595" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga008.jf.intel.com with ESMTP; 13 Jul 2021 14:01:20 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Tue, 13 Jul 2021 14:01:20 -0700 Received: from fmsmsx605.amr.corp.intel.com (10.18.126.85) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.10; Tue, 13 Jul 2021 14:01:19 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx605.amr.corp.intel.com (10.18.126.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4 via Frontend Transport; Tue, 13 Jul 2021 14:01:19 -0700 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.102) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.10; Tue, 13 Jul 2021 14:00:56 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QXQ3/KVOxDuhxTzK4DUxl42Bd1pWLXueGW7iFtQz2W82nX+P5uuSRYmw0O27a2HVDWtQomvaeMlkYPNwxy3IvVXgpsD0ZHog4OOdi6FJ8Dl3ruWHUYoAcXXxrRHmSAxZtyKpDAjCRDTuoGrSKgPBmhVEfPi0sZGh0FSqHo88V8Gd1sJb8J9/ynuAU5O6Zg5Aty41MHmWXBIqkZR2Jt+KrOF4FrhhEyJxZ7YIda0DlPvgADXiVRImSCi0RI4Vw4Acs/dvU1cA190MD9S2/D6RqzmAggrvSPfZ2SkYxNkjjGjyuhQ9nb1Np9gbiY/PEc59MKOIIlJfnFPHNfTH0zWc0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=d0dquH+uBj52MuaGeiBDEQeIzANfAxJNTwBuWHK7Rzk=; b=MOMR130Lycnv8apU5yt8t7LsjfXNW+oE/xfnYX1Hyd3CHkYZEPSvAsyqKNbk+29/t9JPC4gSnA7KSe95obZLlB93wiUoQwtwHkctQqvP41AhHO5j/NAm7RUsr7whc1S/xLnfziHUfaRwmlVs9bz38GxkVdCD6O6QoMr65Qk+vVsVDX0qDtweH4KPqhfFs74kZDea4dBth7PMGEqcu4wzKr7mxCCS03NsaDucWpb1fZ/Eyc6mbY9zuy1mpybfdj7WKpBcanYD7soMxEFZC8HS3H514ak7Nqp8UKxTFrm6t8NkGA6mZQRWX7AZNxUtCibE4wJ6xAgq1FzethLdfwkq2Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=d0dquH+uBj52MuaGeiBDEQeIzANfAxJNTwBuWHK7Rzk=; b=vBJGCWTI8k9fetS/2wy5JIMbNsXrufdjNkdtp/KcHKxTIGPusJjiJ9CryzFLSdOLMYuXIhR1i8KgXFG9+DIiOcLVmVL1HfTJO3M/x3QBiY6YdLzER8++OPQxHlUKmvVMiPi1Venlpcw7fTXe3NhDOYRJIGUNJl65dHerDNpjeRo= Received: from BYAPR11MB3622.namprd11.prod.outlook.com (2603:10b6:a03:fe::30) by BYAPR11MB2917.namprd11.prod.outlook.com (2603:10b6:a03:89::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20; Tue, 13 Jul 2021 21:00:54 +0000 Received: from BYAPR11MB3622.namprd11.prod.outlook.com ([fe80::7520:e237:98fd:6442]) by BYAPR11MB3622.namprd11.prod.outlook.com ([fe80::7520:e237:98fd:6442%4]) with mapi id 15.20.4308.027; Tue, 13 Jul 2021 21:00:54 +0000 From: "Guo Dong" To: "Liu, Zhiguang" , "devel@edk2.groups.io" CC: "Ma, Maurice" , "Ni, Ray" , "You, Benjamin" , "Kesavan Balakrishnan, ThiyaguX" Subject: Re: [Patch V3] UefiPayloadPkg: Dump hob information from boot loader Thread-Topic: [Patch V3] UefiPayloadPkg: Dump hob information from boot loader Thread-Index: AQHXd7ZZMzL65mUK+Umw7LcydFkaGatBZMUw Date: Tue, 13 Jul 2021 21:00:54 +0000 Message-ID: References: <20210713071042.2007-1-zhiguang.liu@intel.com> In-Reply-To: <20210713071042.2007-1-zhiguang.liu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c3615119-6947-4eff-466b-08d946414ddd x-ms-traffictypediagnostic: BYAPR11MB2917: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3513; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: JeEFyxlgkgzPs+zLLWTEkT9VICmgLHaWg4pIQRiptxMO4akQpkOwYGRz59ZCsIqPnUWiKUyUZfJDI+whRje2yTkjYg1hZqUcZdGpbozd4Qw1XCiVdb4Lw01ZmyMqiBPpEipiD2ZelAjgq4kdD++83v18kJ0Wiv3eZY+W98zaxn16Cju0npM3vxaAOjnWdozDg8aXwMAXXFWsTVC4PxkvKARw44vgNyDDJxTdjQXYjWnOaVB0NLY9gydblpBOo2ZTZHPj91ZSOKD1rbouSfqRW2SWPgSp6DIRelYa6tqC7aFf9H9LT/SSevdHK3LbjyDQUNhY2sZ1fUsQEFzaKPTyD2FDD25+GwvTYXo/whAS5TozSo3HyQC+liQYHHMLnONItS70O/cTCa2xz775ZWl++5XidUQl2mEZ4XM5p0Fr6dBQwfxKBCV29ACuLoHuCBlrym/SVk7i4NRtOAbA+OFSyjYFUN27m6JYXpf+wV7dFvY/HCvsR9qBJEC11tDE0KGirPwqoWuNxFrXJVZrLSX+4V2rb7hAA3IsGdLUmAIjgD/mPg5+3AgIivYjLkU0dxy8usj7ExzWTlBSJvPFXbpkMumPFREEmUko5AOw3RScOgHJnY+5iu7DK3yP0eEdQ9Il/fN1J5RyIeEpionAeRU/zg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BYAPR11MB3622.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(136003)(39860400002)(366004)(396003)(376002)(346002)(66476007)(76116006)(66446008)(83380400001)(110136005)(55016002)(107886003)(64756008)(66556008)(186003)(316002)(478600001)(66946007)(19627235002)(5660300002)(6506007)(53546011)(71200400001)(30864003)(9686003)(33656002)(122000001)(54906003)(8676002)(86362001)(7696005)(4326008)(2906002)(52536014)(38100700002)(8936002)(559001)(579004);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?2gNBda3cDAl7EJ4U/rE0/A992O8I9OFswZaEV4Gi8NBGOWmwBEL/nNvj+zvk?= =?us-ascii?Q?XvkDks5nukv9w+ZL9vTlJrfjUT4Eea2b56Nmi5atl1X1K/WM5aBbsui4fFBM?= =?us-ascii?Q?mvZkQo+y4jHG2zDoQJkwKhz9gI+utqwpFgSb6JieyFptUwkt8TMmmRaVbnfy?= =?us-ascii?Q?LtT1DOkx0VSJsKex57dX1CPEg8Sx0n3mf1pqgtQvl3FKa3a0TrfP2hFhaPwe?= =?us-ascii?Q?DYf16Et1mcOot+SzWHBYZmLYE8jTo/RFSy50SCqQYrhpeGTynnN6dtJHnTII?= =?us-ascii?Q?E12w/jz1BoLzp8EsfO1Tz5yvTrKU2ab8GfER9oSNv4ec10d/s2IyuePH22jv?= =?us-ascii?Q?nYiiPy9N3rW2K2inAfyVLReWx129aMHAxgw2dBcu4OhOcrVQo+5bZ0iZ9F3r?= =?us-ascii?Q?nryjYLC1YratgPwgkvyCmD82QnJ8PCav+G+gAbeIj4bYZs1TdfD6RGxSH55x?= =?us-ascii?Q?boahuzSPgV7biF/u5oZDwU5Ida/3rhtErfX6qJBTFJLRjdVbw1xhyEJeIvAn?= =?us-ascii?Q?T3bmQyz30p7BxTj4wrxjhl9hBZ+s6xVDAYNixc397Tyg3ZoNIzzphk3xaTLt?= =?us-ascii?Q?urpuJtL4cZ6Z/ZSCshpJZTh46ngnC0kVOC1GQB2V6QrUDgPjcD2htNp83oCK?= =?us-ascii?Q?dDzQ+Wq2UHS0CAFDX+1fkfCgin80eigMm0mqSStW4Jn1fCSWEPb091+J0jMm?= =?us-ascii?Q?U/R+/2pLLBd5UPD0i5ASBlFYw30KpL+c6BzfI0UNcVlavfO6+mQTqA2b8ikh?= =?us-ascii?Q?JOLNRLzK+ibALbSK8WqvSq6Mzp0iG/r/8UKyHYf+KKHrvGbBENzJ5O0vXqvK?= =?us-ascii?Q?P8elyfjHd7ex0/Ufw8ydKP3uSNn+Ym0KaFqLZgSPTiz5GMnWwLf0w148/pHi?= =?us-ascii?Q?3RoSwHCKeRbT+FCK7UBPbkH1RSPaoteaXWGkO5nrS55EAeO0s9urDrEKOEkT?= =?us-ascii?Q?HKrVtOJYAf0t21So2nxChm7W6boEHTYXIpE843zvSHO/Nz7b43aoxdu+IlfV?= =?us-ascii?Q?Q3876Vh3M+6KRsANsX40OCcoh5TMBpMOjEMPJ9UGNmsHZmHMaxCBm92skJb/?= =?us-ascii?Q?XdhiLUJr/+fUF9K2qSpVDwgjnK+qHKMCQ5cW9Ey9ymAFnLD3I36ZHzrwT110?= =?us-ascii?Q?XcAOCkrsXilGstDl6EvBvAmQj5YSW91z2fg/YBAiOVaG9K0Ag/6BZmPWQZrp?= =?us-ascii?Q?gt7YnpGeSn7BbwRu1USAN9SidfGaEG/nlbtvPrDiE3a/1kB/Te6ViKyNGMe+?= =?us-ascii?Q?JIr39OumzhrNjo3v8F7rH3xgtv9gPugp0GooR6fGXtGJ2D7L3UilNypZBzZ5?= =?us-ascii?Q?G5Z7HFl78kdpzYRTQBJ4tFziKw5cddiM39cY61xXYFCIK4RD1OxCVAB6F/3S?= =?us-ascii?Q?ZBMVhtVAdXTMeq19QikTdnGhZn6N?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BYAPR11MB3622.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: c3615119-6947-4eff-466b-08d946414ddd X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jul 2021 21:00:54.1272 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: mGN18mXlQn5ip4GhznvTKAlvAv+u0g/Sz5iVQ6Kaor23Q0XIa6bht7Y05dfR3V0t+5dh62LvbpN8ARAHh8IRsw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB2917 Return-Path: guo.dong@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Signed-off-by: Guo Dong > -----Original Message----- > From: Liu, Zhiguang > Sent: Tuesday, July 13, 2021 12:11 AM > To: devel@edk2.groups.io > Cc: Ma, Maurice ; Dong, Guo > ; Ni, Ray ; You, Benjamin > ; Kesavan Balakrishnan, ThiyaguX > > Subject: [Patch V3] UefiPayloadPkg: Dump hob information from boot loader >=20 > V1: > Universal Payload will consume Hobs from boot loader. > Dump all hobs in the Universal Payload entry. > V2: > Add function comments >=20 > V3: > minor change, for example Hobsize -> HobLength, SMBiosTable -> > SmBiosTable >=20 > Cc: Maurice Ma > Cc: Guo Dong > Cc: Ray Ni > Cc: Benjamin You >=20 > Signed-off-by: Thiyagu Kesavan Balakrishnan > > Signed-off-by: Zhiguang Liu > --- > UefiPayloadPkg/UefiPayloadEntry/PrintHob.c | 641 > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > +++ > UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c | 17 > +++++++++++++++++ > UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf | 6 ++++++ > 3 files changed, 664 insertions(+) >=20 > diff --git a/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c > b/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c > new file mode 100644 > index 0000000000..5fb638d4a4 > --- /dev/null > +++ b/UefiPayloadPkg/UefiPayloadEntry/PrintHob.c > @@ -0,0 +1,641 @@ > +/** @file >=20 > + Copyright (c) 2021, Intel Corporation. All rights reserved.
>=20 > + SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > +**/ >=20 > + >=20 > +#include "UefiPayloadEntry.h" >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > +#include >=20 > + >=20 > +#define ROW_LIMITER 16 >=20 > + >=20 > +typedef >=20 > +EFI_STATUS >=20 > +(*HOB_PRINT_HANDLER) ( >=20 > + IN VOID *Hob, >=20 > + IN UINT16 HobLength >=20 > +); >=20 > + >=20 > +typedef struct{ >=20 > + UINT16 Type; >=20 > + CHAR8 *Name; >=20 > + HOB_PRINT_HANDLER PrintHandler; >=20 > +} HOB_PRINT_HANDLER_TABLE; >=20 > + >=20 > +CHAR8 * mMemoryTypeStr[] =3D { >=20 > + "EfiReservedMemoryType", >=20 > + "EfiLoaderCode", >=20 > + "EfiLoaderData", >=20 > + "EfiBootServicesCode", >=20 > + "EfiBootServicesData", >=20 > + "EfiRuntimeServicesCode", >=20 > + "EfiRuntimeServicesData", >=20 > + "EfiConventionalMemory", >=20 > + "EfiUnusableMemory", >=20 > + "EfiACPIReclaimMemory", >=20 > + "EfiACPIMemoryNVS", >=20 > + "EfiMemoryMappedIO", >=20 > + "EfiMemoryMappedIOPortSpace", >=20 > + "EfiPalCode", >=20 > + "EfiPersistentMemory", >=20 > + "EfiMaxMemoryType" >=20 > +}; >=20 > + >=20 > +CHAR8 * mResource_Type_List[] =3D { >=20 > + "EFI_RESOURCE_SYSTEM_MEMORY ", //0x00000000 >=20 > + "EFI_RESOURCE_MEMORY_MAPPED_IO ", //0x00000001 >=20 > + "EFI_RESOURCE_IO ", //0x00000002 >=20 > + "EFI_RESOURCE_FIRMWARE_DEVICE ", //0x00000003 >=20 > + "EFI_RESOURCE_MEMORY_MAPPED_IO_PORT ", //0x00000004 >=20 > + "EFI_RESOURCE_MEMORY_RESERVED ", //0x00000005 >=20 > + "EFI_RESOURCE_IO_RESERVED ", //0x00000006 >=20 > + "EFI_RESOURCE_MAX_MEMORY_TYPE " //0x00000007 >=20 > +}; >=20 > + >=20 > +typedef >=20 > +EFI_STATUS >=20 > +(*GUID_HOB_PRINT) ( >=20 > + IN UINT8 *HobRaw, >=20 > + IN UINT16 HobLength >=20 > +); >=20 > + >=20 > +typedef struct { >=20 > + EFI_GUID *Guid; >=20 > + GUID_HOB_PRINT PrintHandler; >=20 > + CHAR8 *GuidName; >=20 > +} GUID_HOB_PRINT_HANDLE; >=20 > + >=20 > +typedef struct{ >=20 > + EFI_GUID *Guid; >=20 > + CHAR8 *Type; >=20 > +} PRINT_MEMORY_ALLOCCATION_HOB; >=20 > + >=20 > + >=20 > +/** >=20 > + Print the Hex value of a given range. >=20 > + @param[in] DataStart A pointer to the start of data to be printe= d. >=20 > + @param[in] DataSize The length of the data to be printed. >=20 > + @retval EFI_SUCCESS If it completed successfully. >=20 > +**/ >=20 > +EFI_STATUS >=20 > +PrintHex ( >=20 > + IN UINT8 *DataStart, >=20 > + IN UINT16 DataSize >=20 > + ) >=20 > +{ >=20 > + UINTN Index1; >=20 > + UINTN Index2; >=20 > + UINT8 *StartAddr; >=20 > + >=20 > + StartAddr =3D DataStart; >=20 > + for (Index1 =3D 0; Index1 * ROW_LIMITER < DataSize; Index1++) { >=20 > + DEBUG ((DEBUG_VERBOSE, " 0x%04p:", (DataStart - StartAddr))); >=20 > + for (Index2 =3D 0; (Index2 < ROW_LIMITER) && (Index1 * ROW_LIMITER + > Index2 < DataSize); Index2++){ >=20 > + DEBUG ((DEBUG_VERBOSE, " %02x", *DataStart)); >=20 > + DataStart++; >=20 > + } >=20 > + DEBUG ((DEBUG_VERBOSE, "\n")); >=20 > + } >=20 > + >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > +/** >=20 > + Print the information in HandOffHob. >=20 > + >=20 > + @param[in] HobStart A pointer to the HOB of type > EFI_HOB_TYPE_HANDOFF. >=20 > + @param[in] HobLength The length in bytes of HOB of type > EFI_HOB_TYPE_HANDOFF. >=20 > + @retval EFI_SUCCESS If it completed successfully. >=20 > +**/ >=20 > +EFI_STATUS >=20 > +PrintHandOffHob( >=20 > + IN VOID *HobStart, >=20 > + IN UINT16 HobLength >=20 > + ) >=20 > +{ >=20 > + EFI_PEI_HOB_POINTERS Hob; >=20 > + Hob.Raw =3D (UINT8 *) HobStart; >=20 > + ASSERT (HobLength >=3D sizeof (*Hob.HandoffInformationTable)); >=20 > + DEBUG ((DEBUG_INFO, " BootMode =3D 0x%x\n", > Hob.HandoffInformationTable->BootMode)); >=20 > + DEBUG ((DEBUG_INFO, " EfiMemoryTop =3D 0x%lx\n", > Hob.HandoffInformationTable->EfiMemoryTop)); >=20 > + DEBUG ((DEBUG_INFO, " EfiMemoryBottom =3D 0x%lx\n", > Hob.HandoffInformationTable->EfiMemoryBottom)); >=20 > + DEBUG ((DEBUG_INFO, " EfiFreeMemoryTop =3D 0x%lx\n", > Hob.HandoffInformationTable->EfiFreeMemoryTop)); >=20 > + DEBUG ((DEBUG_INFO, " EfiFreeMemoryBottom =3D 0x%lx\n", > Hob.HandoffInformationTable->EfiFreeMemoryBottom)); >=20 > + DEBUG ((DEBUG_INFO, " EfiEndOfHobList =3D 0x%lx\n", > Hob.HandoffInformationTable->EfiEndOfHobList)); >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > +/** >=20 > + Print the information in Memory Allocation Hob. >=20 > + @param[in] HobStart A pointer to the HOB of type > EFI_HOB_TYPE_MEMORY_ALLOCATION. >=20 > + @param[in] HobLength The length in bytes of HOB of type > EFI_HOB_TYPE_MEMORY_ALLOCATION. >=20 > + @retval EFI_SUCCESS If it completed successfully. >=20 > +**/ >=20 > +EFI_STATUS >=20 > +PrintMemoryAllocationHob ( >=20 > + IN VOID *HobStart, >=20 > + IN UINT16 HobLength >=20 > + ) >=20 > +{ >=20 > + EFI_PEI_HOB_POINTERS Hob; >=20 > + >=20 > + Hob.Raw =3D (UINT8 *) HobStart; >=20 > + >=20 > + if(CompareGuid (&Hob.MemoryAllocation->AllocDescriptor.Name, > &gEfiHobMemoryAllocStackGuid)) { >=20 > + ASSERT (HobLength >=3D sizeof (*Hob.MemoryAllocationStack)); >=20 > + DEBUG ((DEBUG_INFO, " Type =3D > EFI_HOB_MEMORY_ALLOCATION_STACK\n")); >=20 > + } else if (CompareGuid (&Hob.MemoryAllocation->AllocDescriptor.Name, > &gEfiHobMemoryAllocBspStoreGuid)) { >=20 > + ASSERT (HobLength >=3D sizeof (*Hob.MemoryAllocationBspStore)); >=20 > + DEBUG ((DEBUG_INFO, " Type =3D > EFI_HOB_MEMORY_ALLOCATION_BSP_STORE\n")); >=20 > + } else if (CompareGuid (&Hob.MemoryAllocation->AllocDescriptor.Name, > &gEfiHobMemoryAllocModuleGuid)) { >=20 > + ASSERT (HobLength >=3D sizeof (*Hob.MemoryAllocationModule)); >=20 > + DEBUG ((DEBUG_INFO, " Type =3D > EFI_HOB_MEMORY_ALLOCATION_MODULE\n")); >=20 > + DEBUG ((DEBUG_INFO, " Module Name =3D %g\n", > Hob.MemoryAllocationModule->ModuleName)); >=20 > + DEBUG ((DEBUG_INFO, " Physical Address =3D 0x%lx\n", > Hob.MemoryAllocationModule->EntryPoint)); >=20 > + } else { >=20 > + ASSERT (HobLength >=3D sizeof (*Hob.MemoryAllocation)); >=20 > + DEBUG ((DEBUG_INFO, " Type =3D > EFI_HOB_TYPE_MEMORY_ALLOCATION\n")); >=20 > + } >=20 > + DEBUG ((DEBUG_INFO, " MemoryBaseAddress =3D 0x%lx\n", > Hob.MemoryAllocationStack->AllocDescriptor.MemoryBaseAddress)); >=20 > + DEBUG ((DEBUG_INFO, " MemoryLength =3D 0x%lx\n", > Hob.MemoryAllocationStack->AllocDescriptor.MemoryLength)); >=20 > + DEBUG ((DEBUG_INFO, " MemoryType =3D %a \n", > mMemoryTypeStr[Hob.MemoryAllocationStack- > >AllocDescriptor.MemoryType])); >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > +/** >=20 > + Print the information in Resource Discriptor Hob. >=20 > + @param[in] HobStart A pointer to HOB of type > EFI_HOB_TYPE_RESOURCE_DESCRIPTOR. >=20 > + @param[in] HobLength The Length in bytes of HOB of type > EFI_HOB_TYPE_RESOURCE_DESCRIPTOR. >=20 > + @retval EFI_SUCCESS If it completed successfully. >=20 > +**/ >=20 > +EFI_STATUS >=20 > +PrintResourceDiscriptorHob ( >=20 > + IN VOID *HobStart, >=20 > + IN UINT16 HobLength >=20 > + ) >=20 > +{ >=20 > + EFI_PEI_HOB_POINTERS Hob; >=20 > + >=20 > + Hob.Raw =3D (UINT8 *) HobStart; >=20 > + ASSERT (HobLength >=3D sizeof (*Hob.ResourceDescriptor)); >=20 > + >=20 > + DEBUG ((DEBUG_INFO, " ResourceType =3D %a\n", > mResource_Type_List[Hob.ResourceDescriptor->ResourceType])); >=20 > + if(!IsZeroGuid (&Hob.ResourceDescriptor->Owner)) { >=20 > + DEBUG ((DEBUG_INFO, " Owner =3D %g\n", Hob.ResourceDescr= iptor- > >Owner)); >=20 > + } >=20 > + DEBUG ((DEBUG_INFO, " ResourceAttribute =3D 0x%x\n", > Hob.ResourceDescriptor->ResourceAttribute)); >=20 > + DEBUG ((DEBUG_INFO, " PhysicalStart =3D 0x%lx\n", > Hob.ResourceDescriptor->PhysicalStart)); >=20 > + DEBUG ((DEBUG_INFO, " ResourceLength =3D 0x%lx\n", > Hob.ResourceDescriptor->ResourceLength)); >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > +/** >=20 > + Print the information in Acpi Guid Hob. >=20 > + @param[in] HobRaw A pointer to the start of > gUniversalPayloadAcpiTableGuid HOB. >=20 > + @retval EFI_SUCCESS If it completed successfully. >=20 > +**/ >=20 > +EFI_STATUS >=20 > +PrintAcpiGuidHob ( >=20 > + IN UINT8 *HobRaw, >=20 > + IN UINT16 HobLength >=20 > + ) >=20 > +{ >=20 > + UNIVERSAL_PAYLOAD_ACPI_TABLE *AcpiTableHob; >=20 > + AcpiTableHob =3D (UNIVERSAL_PAYLOAD_ACPI_TABLE *) > GET_GUID_HOB_DATA (HobRaw); >=20 > + ASSERT (HobLength >=3D AcpiTableHob->Header.Length); >=20 > + DEBUG ((DEBUG_INFO, " Revision =3D 0x%x\n", AcpiTableHob- > >Header.Revision)); >=20 > + DEBUG ((DEBUG_INFO, " Length =3D 0x%x\n", AcpiTableHob- > >Header.Length)); >=20 > + DEBUG ((DEBUG_INFO, " Rsdp =3D 0x%p\n", (UINT64) AcpiTableHob- > >Rsdp)); >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > +/** >=20 > + Print the information in Serial Guid Hob. >=20 > + @param[in] HobRaw A pointer to the start of > gUniversalPayloadSerialPortInfoGuid HOB. >=20 > + @retval EFI_SUCCESS If it completed successfully. >=20 > +**/ >=20 > +EFI_STATUS >=20 > +PrintSerialGuidHob ( >=20 > + IN UINT8 *HobRaw, >=20 > + IN UINT16 HobLength >=20 > + ) >=20 > +{ >=20 > + UNIVERSAL_PAYLOAD_SERIAL_PORT_INFO *SerialPortInfo; >=20 > + SerialPortInfo =3D (UNIVERSAL_PAYLOAD_SERIAL_PORT_INFO *) > GET_GUID_HOB_DATA (HobRaw); >=20 > + ASSERT (HobLength >=3D SerialPortInfo->Header.Length); >=20 > + DEBUG ((DEBUG_INFO, " Revision =3D 0x%x\n", SerialPortInfo- > >Header.Revision)); >=20 > + DEBUG ((DEBUG_INFO, " Length =3D 0x%x\n", SerialPortInfo- > >Header.Length)); >=20 > + DEBUG ((DEBUG_INFO, " UseMmio =3D 0x%x\n", SerialPortInfo- > >UseMmio)); >=20 > + DEBUG ((DEBUG_INFO, " RegisterStride =3D 0x%x\n", SerialPortInfo- > >RegisterStride)); >=20 > + DEBUG ((DEBUG_INFO, " BaudRate =3D %d\n", SerialPortInfo- > >BaudRate)); >=20 > + DEBUG ((DEBUG_INFO, " RegisterBase =3D 0x%lx\n", SerialPortInfo- > >RegisterBase)); >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > +/** >=20 > + Print the information in Smbios Guid Hob. >=20 > + @param[in] HobRaw A pointer to the start of > gUniversalPayloadSmbios3TableGuid HOB. >=20 > + @retval EFI_SUCCESS If it completed successfully. >=20 > +**/ >=20 > +EFI_STATUS >=20 > +PrintSmbios3GuidHob ( >=20 > + IN UINT8 *HobRaw, >=20 > + IN UINT16 HobLength >=20 > + ) >=20 > +{ >=20 > + UNIVERSAL_PAYLOAD_SMBIOS_TABLE *SmBiosTable; >=20 > + SmBiosTable =3D (UNIVERSAL_PAYLOAD_SMBIOS_TABLE *) > GET_GUID_HOB_DATA (HobRaw); >=20 > + ASSERT (HobLength >=3D SmBiosTable->Header.Length); >=20 > + DEBUG ((DEBUG_INFO, " Revision =3D 0x%x\n", SmBiosTable- > >Header.Revision)); >=20 > + DEBUG ((DEBUG_INFO, " Length =3D 0x%x\n", SmBiosTable- > >Header.Length)); >=20 > + DEBUG ((DEBUG_INFO, " SmBiosEntryPoint =3D 0x%lx\n", (UINT64) > SmBiosTable->SmBiosEntryPoint)); >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > +/** >=20 > + Print the information in Smbios Guid Hob. >=20 > + @param[in] HobRaw A pointer to the start of > gUniversalPayloadSmbiosTableGuid HOB. >=20 > + @retval EFI_SUCCESS If it completed successfully. >=20 > +**/ >=20 > +EFI_STATUS >=20 > +PrintSmbiosTablGuidHob ( >=20 > + IN UINT8 *HobRaw, >=20 > + IN UINT16 HobLength >=20 > + ) >=20 > +{ >=20 > + UNIVERSAL_PAYLOAD_SMBIOS_TABLE *SmBiosTable; >=20 > + SmBiosTable =3D (UNIVERSAL_PAYLOAD_SMBIOS_TABLE *) > GET_GUID_HOB_DATA (HobRaw); >=20 > + ASSERT (HobLength >=3D SmBiosTable->Header.Length); >=20 > + DEBUG ((DEBUG_INFO, " Revision =3D 0x%x\n", SmBiosTable- > >Header.Revision)); >=20 > + DEBUG ((DEBUG_INFO, " Length =3D 0x%x\n", SmBiosTable- > >Header.Length)); >=20 > + DEBUG ((DEBUG_INFO, " SmBiosEntryPoint =3D 0x%lx\n", (UINT64) > SmBiosTable->SmBiosEntryPoint)); >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > +/** >=20 > + Print the information in Acpi BoardInfo Guid Hob. >=20 > + @param[in] HobRaw A pointer to the start of gUefiAcpiBoardInf= oGuid > HOB. >=20 > + @retval EFI_SUCCESS If it completed successfully. >=20 > +**/ >=20 > +EFI_STATUS >=20 > +PrintAcpiBoardInfoGuidHob ( >=20 > + IN UINT8 *HobRaw, >=20 > + IN UINT16 HobLength >=20 > + ) >=20 > +{ >=20 > + ACPI_BOARD_INFO *AcpBoardInfo; >=20 > + AcpBoardInfo =3D (ACPI_BOARD_INFO *) GET_GUID_HOB_DATA (HobRaw); >=20 > + ASSERT (HobLength >=3D sizeof (*AcpBoardInfo)); >=20 > + DEBUG ((DEBUG_INFO, " Revision =3D 0x%x\n", AcpBoardInfo- > >Revision)); >=20 > + DEBUG ((DEBUG_INFO, " Reserved0 =3D 0x%x\n", AcpBoardInfo- > >Reserved0)); >=20 > + DEBUG ((DEBUG_INFO, " ResetValue =3D 0x%x\n", AcpBoardInfo- > >ResetValue)); >=20 > + DEBUG ((DEBUG_INFO, " PmEvtBase =3D 0x%lx\n", AcpBoardInfo- > >PmEvtBase)); >=20 > + DEBUG ((DEBUG_INFO, " PmGpeEnBase =3D 0x%lx\n", AcpBoardInfo- > >PmGpeEnBase)); >=20 > + DEBUG ((DEBUG_INFO, " PmCtrlRegBase =3D 0x%lx\n", AcpBoardInfo- > >PmCtrlRegBase)); >=20 > + DEBUG ((DEBUG_INFO, " PmTimerRegBase =3D 0x%lx\n", AcpBoardInfo- > >PmTimerRegBase)); >=20 > + DEBUG ((DEBUG_INFO, " ResetRegAddress =3D 0x%lx\n", AcpBoardInfo- > >ResetRegAddress)); >=20 > + DEBUG ((DEBUG_INFO, " PcieBaseAddress =3D 0x%lx\n", AcpBoardInfo- > >PcieBaseAddress)); >=20 > + DEBUG ((DEBUG_INFO, " PcieBaseSize =3D 0x%lx\n", AcpBoardInfo- > >PcieBaseSize)); >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > +/** >=20 > + Print the information in Pci RootBridge Info Guid Hob. >=20 > + @param[in] HobRaw A pointer to the start of > gUniversalPayloadPciRootBridgeInfoGuid HOB. >=20 > + >=20 > + @retval EFI_SUCCESS If it completed successfully. >=20 > +**/ >=20 > +EFI_STATUS >=20 > +PrintPciRootBridgeInfoGuidHob ( >=20 > + IN UINT8 *HobRaw, >=20 > + IN UINT16 HobLength >=20 > + ) >=20 > +{ >=20 > + UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES *PciRootBridges; >=20 > + UINTN Index; >=20 > + Index =3D 0; >=20 > + PciRootBridges =3D (UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES *) > GET_GUID_HOB_DATA (HobRaw); >=20 > + ASSERT (HobLength >=3D sizeof > (UNIVERSAL_PAYLOAD_PCI_ROOT_BRIDGES)); >=20 > + DEBUG ((DEBUG_INFO, " Revision =3D 0x%x\n", PciRootBridges- > >Header.Revision)); >=20 > + DEBUG ((DEBUG_INFO, " Length =3D 0x%x\n", PciRootBridges- > >Header.Length)); >=20 > + DEBUG ((DEBUG_INFO, " Count =3D 0x%x\n", PciRootBridges->= Count)); >=20 > + DEBUG ((DEBUG_INFO, " ResourceAssigned =3D %a\n", (PciRootBridges- > >ResourceAssigned ? "True" : "False"))); >=20 > + >=20 > + while(Index < PciRootBridges->Count) { >=20 > + DEBUG ((DEBUG_INFO, " Root Bridge Index[%d]:\n", Index)); >=20 > + DEBUG ((DEBUG_INFO, " Segment =3D 0x%x\n", PciRoo= tBridges- > >RootBridge[Index].Segment)); >=20 > + DEBUG ((DEBUG_INFO, " Supports =3D 0x%lx\n", PciRoo= tBridges- > >RootBridge[Index].Supports)); >=20 > + DEBUG ((DEBUG_INFO, " Attributes =3D 0x%lx\n", PciRoo= tBridges- > >RootBridge[Index].Attributes)); >=20 > + DEBUG ((DEBUG_INFO, " DmaAbove4G =3D 0x%x\n", > PciRootBridges->RootBridge[Index].DmaAbove4G)); >=20 > + DEBUG ((DEBUG_INFO, " NoExtendedConfigSpace =3D 0x%x\n", > PciRootBridges->RootBridge[Index].NoExtendedConfigSpace)); >=20 > + DEBUG ((DEBUG_INFO, " AllocationAttributes =3D 0x%lx\n", > PciRootBridges->RootBridge[Index].AllocationAttributes)); >=20 > + DEBUG ((DEBUG_INFO, " Bus.Base =3D 0x%lx\n", PciRoo= tBridges- > >RootBridge[Index].Bus.Base)); >=20 > + DEBUG ((DEBUG_INFO, " Bus.Limit =3D 0x%lx\n", PciRoo= tBridges- > >RootBridge[Index].Bus.Limit)); >=20 > + DEBUG ((DEBUG_INFO, " Bus.Translation =3D 0x%lx\n", > PciRootBridges->RootBridge[Index].Bus.Translation)); >=20 > + DEBUG ((DEBUG_INFO, " Io.Base =3D 0x%lx\n", PciRoo= tBridges- > >RootBridge[Index].Io.Base)); >=20 > + DEBUG ((DEBUG_INFO, " Io.Limit =3D 0x%lx\n", PciRoo= tBridges- > >RootBridge[Index].Io.Limit)); >=20 > + DEBUG ((DEBUG_INFO, " Io.Translation =3D 0x%lx\n", PciRoo= tBridges- > >RootBridge[Index].Io.Translation)); >=20 > + DEBUG ((DEBUG_INFO, " Mem.Base =3D 0x%lx\n", PciRoo= tBridges- > >RootBridge[Index].Mem.Base)); >=20 > + DEBUG ((DEBUG_INFO, " Mem.Limit =3D 0x%lx\n", PciRoo= tBridges- > >RootBridge[Index].Mem.Limit)); >=20 > + DEBUG ((DEBUG_INFO, " Mem.Translation =3D 0x%lx\n", > PciRootBridges->RootBridge[Index].Mem.Translation)); >=20 > + DEBUG ((DEBUG_INFO, " MemAbove4G.Base =3D 0x%lx\n", > PciRootBridges->RootBridge[Index].MemAbove4G.Base)); >=20 > + DEBUG ((DEBUG_INFO, " MemAbove4G.Limit =3D 0x%lx\n", > PciRootBridges->RootBridge[Index].MemAbove4G.Limit)); >=20 > + DEBUG ((DEBUG_INFO, " MemAbove4G.Translation =3D 0x%lx\n", > PciRootBridges->RootBridge[Index].MemAbove4G.Translation)); >=20 > + DEBUG ((DEBUG_INFO, " PMem.Base =3D 0x%lx\n", PciRoo= tBridges- > >RootBridge[Index].PMem.Base)); >=20 > + DEBUG ((DEBUG_INFO, " PMem.Limit =3D 0x%lx\n", PciRoo= tBridges- > >RootBridge[Index].PMem.Limit)); >=20 > + DEBUG ((DEBUG_INFO, " PMem.Translation =3D 0x%lx\n", > PciRootBridges->RootBridge[Index].PMem.Translation)); >=20 > + DEBUG ((DEBUG_INFO, " PMemAbove4G.Base =3D 0x%lx\n", > PciRootBridges->RootBridge[Index].PMemAbove4G.Base)); >=20 > + DEBUG ((DEBUG_INFO, " PMemAbove4G.Limit =3D 0x%lx\n", > PciRootBridges->RootBridge[Index].PMemAbove4G.Limit)); >=20 > + DEBUG ((DEBUG_INFO, " PMemAbove4G.Translation =3D 0x%lx\n", > PciRootBridges->RootBridge[Index].PMemAbove4G.Translation)); >=20 > + Index+=3D1; >=20 > + } >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > +/** >=20 > + Print the information in Extra Data Guid Hob. >=20 > + @param[in] HobRaw A pointer to the start of > gUniversalPayloadExtraDataGuid HOB. >=20 > + @retval EFI_SUCCESS If it completed successfully. >=20 > +**/ >=20 > +EFI_STATUS >=20 > +PrintExtraDataGuidHob ( >=20 > + IN UINT8 *HobRaw, >=20 > + IN UINT16 HobLength >=20 > + ) >=20 > +{ >=20 > + UNIVERSAL_PAYLOAD_EXTRA_DATA *ExtraData; >=20 > + UINTN Index; >=20 > + >=20 > + Index =3D 0; >=20 > + ExtraData =3D (UNIVERSAL_PAYLOAD_EXTRA_DATA *) > GET_GUID_HOB_DATA (HobRaw); >=20 > + ASSERT (HobLength >=3D ExtraData->Header.Length); >=20 > + DEBUG ((DEBUG_INFO, " Revision =3D 0x%x\n", ExtraData- > >Header.Revision)); >=20 > + DEBUG ((DEBUG_INFO, " Length =3D 0x%x\n", ExtraData- > >Header.Length)); >=20 > + DEBUG ((DEBUG_INFO, " Count =3D 0x%x\n", ExtraData->Count)); >=20 > + >=20 > + while (Index < ExtraData->Count) { >=20 > + DEBUG ((DEBUG_INFO, " Id[%d] =3D %a\n", Index,ExtraData- > >Entry[Index].Identifier)); >=20 > + DEBUG ((DEBUG_INFO, " Base[%d] =3D 0x%lx\n", Index,ExtraData- > >Entry[Index].Base)); >=20 > + DEBUG ((DEBUG_INFO, " Size[%d] =3D 0x%lx\n", Index,ExtraData- > >Entry[Index].Size)); >=20 > + Index+=3D1; >=20 > + } >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > +/** >=20 > + Print the information in MemoryTypeInfoGuidHob. >=20 > + @param[in] HobRaw A pointer to the start of > gEfiMemoryTypeInformationGuid HOB. >=20 > + @retval EFI_SUCCESS If it completed successfully. >=20 > +**/ >=20 > +EFI_STATUS >=20 > +PrintMemoryTypeInfoGuidHob ( >=20 > + IN UINT8 *HobRaw, >=20 > + IN UINT16 HobLength >=20 > + ) >=20 > +{ >=20 > + EFI_MEMORY_TYPE_INFORMATION *MemoryTypeInfo; >=20 > + >=20 > + MemoryTypeInfo =3D (EFI_MEMORY_TYPE_INFORMATION *) > GET_GUID_HOB_DATA (HobRaw); >=20 > + ASSERT (HobLength >=3D sizeof (*MemoryTypeInfo)); >=20 > + DEBUG ((DEBUG_INFO, " Type =3D 0x%x\n", MemoryTypeInfo- > >Type)); >=20 > + DEBUG ((DEBUG_INFO, " NumberOfPages =3D 0x%x\n", MemoryTypeInfo- > >NumberOfPages)); >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > +// >=20 > +// Mappint table for dump Guid Hob information. >=20 > +// This table can be easily extented. >=20 > +// >=20 > +GUID_HOB_PRINT_HANDLE GuidHobPrintHandleTable[] =3D { >=20 > + {&gUniversalPayloadAcpiTableGuid, PrintAcpiGuidHob, > "gUniversalPayloadAcpiTableGuid(ACPI table Guid)"}, >=20 > + {&gUniversalPayloadSerialPortInfoGuid, PrintSerialGuidHob, > "gUniversalPayloadSerialPortInfoGuid(Serial Port Info)"}, >=20 > + {&gUniversalPayloadSmbios3TableGuid, PrintSmbios3GuidHob, > "gUniversalPayloadSmbios3TableGuid(SmBios Guid)"}, >=20 > + {&gUniversalPayloadSmbiosTableGuid, PrintSmbiosTablGuidHob, > "gUniversalPayloadSmbiosTableGuid(SmBios Guid)"}, >=20 > + {&gUefiAcpiBoardInfoGuid, PrintAcpiBoardInfoGuidHob, > "gUefiAcpiBoardInfoGuid(Acpi Guid)"}, >=20 > + {&gUniversalPayloadPciRootBridgeInfoGuid, > PrintPciRootBridgeInfoGuidHob, > "gUniversalPayloadPciRootBridgeInfoGuid(Pci Guid)"}, >=20 > + {&gEfiMemoryTypeInformationGuid, PrintMemoryTypeInfoGuidHob, > "gEfiMemoryTypeInformationGuid(Memory Type Information Guid)"}, >=20 > + {&gUniversalPayloadExtraDataGuid, PrintExtraDataGuidHob, > "gUniversalPayloadExtraDataGuid(PayLoad Extra Data Guid)"} >=20 > +}; >=20 > + >=20 > +/** >=20 > + Print the Guid Hob using related print handle function. >=20 > + @param[in] HobStart A pointer to the HOB of type > EFI_HOB_TYPE_GUID_EXTENSION. >=20 > + @param[in] HobLength The length in bytes of the HOB of type > EFI_HOB_TYPE_GUID_EXTENSION. >=20 > + @retval EFI_SUCCESS If it completed successfully. >=20 > +**/ >=20 > +EFI_STATUS >=20 > +PrintGuidHob ( >=20 > + IN VOID *HobStart, >=20 > + IN UINT16 HobLength >=20 > + ) >=20 > +{ >=20 > + EFI_PEI_HOB_POINTERS Hob; >=20 > + UINTN Index; >=20 > + EFI_STATUS Status; >=20 > + >=20 > + Hob.Raw =3D (UINT8 *) HobStart; >=20 > + ASSERT (HobLength >=3D sizeof (Hob.Guid)); >=20 > + >=20 > + for (Index =3D 0; Index < ARRAY_SIZE (GuidHobPrintHandleTable); Index+= +) { >=20 > + if (CompareGuid (&Hob.Guid->Name, > GuidHobPrintHandleTable[Index].Guid)) { >=20 > + DEBUG ((DEBUG_INFO, " Guid =3D %a\n", > GuidHobPrintHandleTable[Index].GuidName)); >=20 > + Status =3D GuidHobPrintHandleTable[Index].PrintHandler (Hob.Raw, > Hob.Header->HobLength); >=20 > + return Status; >=20 > + } >=20 > + } >=20 > + DEBUG ((DEBUG_INFO, " Name =3D %g\n", &Hob.Guid->Name)); >=20 > + PrintHex (GET_GUID_HOB_DATA (Hob.Raw), GET_GUID_HOB_DATA_SIZE > (Hob.Raw)); >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > +/** >=20 > + Print the information in FV Hob. >=20 > + @param[in] HobStart A pointer to the HOB of type EFI_HOB_TYPE_F= V. >=20 > + @param[in] HobLength The length in bytes of the HOB of type > EFI_HOB_TYPE_FV. >=20 > + @retval EFI_SUCCESS If it completed successfully. >=20 > +**/ >=20 > +EFI_STATUS >=20 > +PrintFvHob ( >=20 > + IN VOID *HobStart, >=20 > + IN UINT16 HobLength >=20 > + ) >=20 > +{ >=20 > + EFI_PEI_HOB_POINTERS Hob; >=20 > + >=20 > + Hob.Raw =3D (UINT8 *) HobStart; >=20 > + ASSERT (HobLength >=3D sizeof (*Hob.FirmwareVolume)); >=20 > + >=20 > + DEBUG ((DEBUG_INFO, " BaseAddress =3D 0x%lx\n", > Hob.FirmwareVolume->BaseAddress)); >=20 > + DEBUG ((DEBUG_INFO, " Length =3D 0x%lx\n", Hob.FirmwareVolume- > >Length)); >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > +/** >=20 > + Print the information in Cpu Hob. >=20 > + @param[in] HobStart A pointer to the HOB of type EFI_HOB_TYPE_C= PU. >=20 > + @param[in] HobLength The length in bytes of the HOB of type > EFI_HOB_TYPE_CPU. >=20 > + @retval EFI_SUCCESS If it completed successfully. >=20 > +**/ >=20 > +EFI_STATUS >=20 > +PrintCpuHob ( >=20 > + IN VOID *HobStart, >=20 > + IN UINT16 HobLength >=20 > + ) >=20 > +{ >=20 > + EFI_PEI_HOB_POINTERS Hob; >=20 > + >=20 > + Hob.Raw =3D (UINT8 *) HobStart; >=20 > + ASSERT (HobLength >=3D sizeof (*Hob.Cpu)); >=20 > + >=20 > + DEBUG ((DEBUG_INFO, " SizeOfMemorySpace =3D 0x%lx\n", Hob.Cpu- > >SizeOfMemorySpace)); >=20 > + DEBUG ((DEBUG_INFO, " SizeOfIoSpace =3D 0x%lx\n", Hob.Cpu- > >SizeOfIoSpace)); >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > +/** >=20 > + Print the information in MemoryPoolHob. >=20 > + @param[in] HobStart A pointer to the HOB of type > EFI_HOB_TYPE_MEMORY_POOL. >=20 > + @param[in] HobLength The length in bytes of the HOB of type > EFI_HOB_TYPE_MEMORY_POOL. >=20 > + @retval EFI_SUCCESS If it completed successfully. >=20 > +**/ >=20 > +EFI_STATUS >=20 > +PrintMemoryPoolHob ( >=20 > + IN VOID *HobStart, >=20 > + IN UINT16 HobLength >=20 > + ) >=20 > +{ >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > +/** >=20 > + Print the information in Fv2Hob. >=20 > + @param[in] HobStart A pointer to the HOB of type EFI_HOB_TYPE_F= V2. >=20 > + @param[in] HobLength The length in bytes of the HOB of type > EFI_HOB_TYPE_FV2. >=20 > + @retval EFI_SUCCESS If it completed successfully. >=20 > +**/ >=20 > +EFI_STATUS >=20 > +PrintFv2Hob ( >=20 > + IN VOID *HobStart, >=20 > + IN UINT16 HobLength >=20 > + ) >=20 > +{ >=20 > + EFI_PEI_HOB_POINTERS Hob; >=20 > + >=20 > + Hob.Raw =3D (UINT8 *) HobStart; >=20 > + ASSERT (HobLength >=3D sizeof (*Hob.FirmwareVolume2)); >=20 > + >=20 > + DEBUG ((DEBUG_INFO, " BaseAddress =3D 0x%lx\n", > Hob.FirmwareVolume2->BaseAddress)); >=20 > + DEBUG ((DEBUG_INFO, " Length =3D 0x%lx\n", Hob.FirmwareVolume2- > >Length)); >=20 > + DEBUG ((DEBUG_INFO, " FvName =3D %g\n", &Hob.FirmwareVolume2= - > >FvName)); >=20 > + DEBUG ((DEBUG_INFO, " FileName =3D %g\n", &Hob.FirmwareVolume2= - > >FileName)); >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > +/** >=20 > + Print the information in Capsule Hob. >=20 > + @param[in] HobStart A pointer to the HOB of type > EFI_HOB_TYPE_UEFI_CAPSULE. >=20 > + @param[in] HobLength The length in bytes of the HOB of type > EFI_HOB_TYPE_UEFI_CAPSULE. >=20 > + @retval EFI_SUCCESS If it completed successfully. >=20 > +**/ >=20 > +EFI_STATUS >=20 > +PrintCapsuleHob ( >=20 > + IN VOID *HobStart, >=20 > + IN UINT16 HobLength >=20 > + ) >=20 > +{ >=20 > + EFI_PEI_HOB_POINTERS Hob; >=20 > + >=20 > + Hob.Raw =3D (UINT8 *) HobStart; >=20 > + ASSERT (HobLength >=3D sizeof (*Hob.Capsule)); >=20 > + >=20 > + DEBUG ((DEBUG_INFO, " BaseAddress =3D 0x%lx\n", Hob.Capsule- > >BaseAddress)); >=20 > + DEBUG ((DEBUG_INFO, " Length =3D 0x%lx\n", Hob.Capsule->Length)= ); >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > +/** >=20 > + Print the information in Fv3 Hob. >=20 > + @param[in] HobStart A pointer to the HOB of type EFI_HOB_TYPE_F= V3. >=20 > + @param[in] HobLength The length in bytes of the HOB of type > EFI_HOB_TYPE_FV3. >=20 > + @retval EFI_SUCCESS If it completed successfully. >=20 > +**/ >=20 > +EFI_STATUS >=20 > +PrintFv3Hob ( >=20 > + IN VOID *HobStart, >=20 > + IN UINT16 HobLength >=20 > + ) >=20 > +{ >=20 > + EFI_PEI_HOB_POINTERS Hob; >=20 > + Hob.Raw =3D (UINT8 *) HobStart; >=20 > + ASSERT (HobLength >=3D sizeof (*Hob.FirmwareVolume3)); >=20 > + >=20 > + DEBUG ((DEBUG_INFO, " BaseAddress =3D 0x%lx\n", > Hob.FirmwareVolume3->BaseAddress)); >=20 > + DEBUG ((DEBUG_INFO, " Length =3D 0x%lx\n", > Hob.FirmwareVolume3->Length)); >=20 > + DEBUG ((DEBUG_INFO, " AuthenticationStatus =3D 0x%x\n", > Hob.FirmwareVolume3->AuthenticationStatus)); >=20 > + DEBUG ((DEBUG_INFO, " ExtractedFv =3D %a\n", > (Hob.FirmwareVolume3->ExtractedFv ? "True" : "False"))); >=20 > + DEBUG ((DEBUG_INFO, " FVName =3D %g\n", > &Hob.FirmwareVolume3->FvName)); >=20 > + DEBUG ((DEBUG_INFO, " FileName =3D %g\n", > &Hob.FirmwareVolume3->FileName)); >=20 > + return EFI_SUCCESS; >=20 > +} >=20 > + >=20 > +// >=20 > +// Mappint table from Hob type to Hob print function. >=20 > +// >=20 > +HOB_PRINT_HANDLER_TABLE mHobHandles[] =3D { >=20 > + {EFI_HOB_TYPE_HANDOFF, "EFI_HOB_TYPE_HANDOFF", > PrintHandOffHob}, >=20 > + {EFI_HOB_TYPE_MEMORY_ALLOCATION, > "EFI_HOB_TYPE_MEMORY_ALLOCATION", PrintMemoryAllocationHob}, >=20 > + {EFI_HOB_TYPE_RESOURCE_DESCRIPTOR, > "EFI_HOB_TYPE_RESOURCE_DESCRIPTOR", PrintResourceDiscriptorHob}, >=20 > + {EFI_HOB_TYPE_GUID_EXTENSION, "EFI_HOB_TYPE_GUID_EXTENSION", > PrintGuidHob}, >=20 > + {EFI_HOB_TYPE_FV, "EFI_HOB_TYPE_FV", = PrintFvHob}, >=20 > + {EFI_HOB_TYPE_CPU, "EFI_HOB_TYPE_CPU", > PrintCpuHob}, >=20 > + {EFI_HOB_TYPE_MEMORY_POOL, "EFI_HOB_TYPE_MEMORY_POOL", > PrintMemoryPoolHob}, >=20 > + {EFI_HOB_TYPE_FV2, "EFI_HOB_TYPE_FV2", = PrintFv2Hob}, >=20 > + {EFI_HOB_TYPE_UEFI_CAPSULE, "EFI_HOB_TYPE_UEFI_CAPSULE", > PrintCapsuleHob}, >=20 > + {EFI_HOB_TYPE_FV3, "EFI_HOB_TYPE_FV3", = PrintFv3Hob} >=20 > +}; >=20 > + >=20 > + >=20 > +/** >=20 > + Print all HOBs info from the HOB list. >=20 > + @param[in] HobStart A pointer to the HOB list >=20 > + @return The pointer to the HOB list. >=20 > +**/ >=20 > +VOID >=20 > +PrintHob ( >=20 > + IN CONST VOID *HobStart >=20 > + ) >=20 > +{ >=20 > + EFI_PEI_HOB_POINTERS Hob; >=20 > + UINTN Count; >=20 > + UINTN Index; >=20 > + ASSERT (HobStart !=3D NULL); >=20 > + >=20 > + Hob.Raw =3D (UINT8 *) HobStart; >=20 > + DEBUG ((DEBUG_INFO, "Print all Hob information from Hob 0x%p\n", > Hob.Raw)); >=20 > + >=20 > + Count =3D 0; >=20 > + // >=20 > + // Parse the HOB list to see which type it is, and print the informati= on. >=20 > + // >=20 > + while (!END_OF_HOB_LIST (Hob)) { >=20 > + for (Index =3D 0; Index < ARRAY_SIZE (mHobHandles); Index++) { >=20 > + if (Hob.Header->HobType =3D=3D mHobHandles[Index].Type) { >=20 > + DEBUG ((DEBUG_INFO, "HOB[%d]: Type =3D %a, Offset =3D 0x%p, Leng= th =3D > 0x%x\n", Count, mHobHandles[Index].Name, (Hob.Raw - (UINT8 *) > HobStart), Hob.Header->HobLength)); >=20 > + mHobHandles[Index].PrintHandler (Hob.Raw, Hob.Header- > >HobLength); >=20 > + break; >=20 > + } >=20 > + } >=20 > + if (Index =3D=3D ARRAY_SIZE (mHobHandles)) { >=20 > + DEBUG ((DEBUG_INFO, "HOB[%d]: Type =3D %d, Offset =3D 0x%p, Length= =3D > 0x%x\n", Count, Hob.Header->HobType, (Hob.Raw - (UINT8 *)HobStart), > Hob.Header->HobLength)); >=20 > + DEBUG ((DEBUG_INFO, " Unkown Hob type\n")); >=20 > + PrintHex (Hob.Raw, Hob.Header->HobLength); >=20 > + } >=20 > + Count++; >=20 > + Hob.Raw =3D GET_NEXT_HOB (Hob); >=20 > + } >=20 > + DEBUG ((DEBUG_INFO, "There are totally %d Hobs, the End Hob address > is %p\n", Count, Hob.Raw)); >=20 > +} >=20 > diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c > b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c > index 7a00a56ab9..09dd1e8378 100644 > --- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c > +++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.c > @@ -25,6 +25,16 @@ >=20 >=20 > extern VOID *mHobList; >=20 >=20 >=20 > +/** >=20 > + Print all HOBs info from the HOB list. >=20 > + >=20 > + @return The pointer to the HOB list. >=20 > +**/ >=20 > +VOID >=20 > +PrintHob ( >=20 > + IN CONST VOID *HobStart >=20 > + ); >=20 > + >=20 > /** >=20 > Some bootloader may pass a pcd database, and UPL also contain a PCD > database. >=20 > Dxe PCD driver has the assumption that the two PCD database can be > catenated and >=20 > @@ -375,6 +385,13 @@ _ModuleEntryPoint ( > DEBUG ((DEBUG_INFO, "Entering Universal Payload...\n")); >=20 > DEBUG ((DEBUG_INFO, "sizeof(UINTN) =3D 0x%x\n", sizeof(UINTN))); >=20 >=20 >=20 > + DEBUG_CODE ( >=20 > + // >=20 > + // Dump the Hobs from boot loader >=20 > + // >=20 > + PrintHob (mHobList); >=20 > + ); >=20 > + >=20 > // Initialize floating point operating environment to be compliant wit= h UEFI > spec. >=20 > InitializeFloatingPointUnits (); >=20 >=20 >=20 > diff --git a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf > b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf > index 76d7e4791c..416a620598 100644 > --- a/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf > +++ b/UefiPayloadPkg/UefiPayloadEntry/UniversalPayloadEntry.inf > @@ -24,6 +24,7 @@ > UniversalPayloadEntry.c >=20 > LoadDxeCore.c >=20 > MemoryAllocation.c >=20 > + PrintHob.c >=20 >=20 >=20 > [Sources.Ia32] >=20 > X64/VirtualMemory.h >=20 > @@ -64,6 +65,11 @@ > gUefiSerialPortInfoGuid >=20 > gUniversalPayloadExtraDataGuid >=20 > gPcdDataBaseHobGuid >=20 > + gUniversalPayloadSmbiosTableGuid >=20 > + gEfiHobMemoryAllocBspStoreGuid >=20 > + gUniversalPayloadAcpiTableGuid >=20 > + gUniversalPayloadPciRootBridgeInfoGuid >=20 > + gUniversalPayloadSmbios3TableGuid >=20 >=20 >=20 > [FeaturePcd.IA32] >=20 > gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSwitchToLongMode ## > CONSUMES >=20 > -- > 2.30.0.windows.2