From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web12.67425.1656898644170783666 for ; Sun, 03 Jul 2022 18:37:24 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=YZieJvpv; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: yuwei.chen@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656898644; x=1688434644; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=g/vuuJROq7EwfJ1wVsl3NddxO9gfbj975E7BY0sT6hg=; b=YZieJvpvPJ93J6mVcd/e0NCaSZdyBnVZMWviejBS091yq9NpbYf45XAy NXQrUWlY1SmlhuepucmY3iopuIt1MYaezuiS9Uzorful7GiYaAlJrtkdg 9+7ej5poVsueyjT1e26POPhA77a2hFr3tjJ0qqH+vTMveksLm9XfmFkP6 ODYASBJzs5eXwR1odkZqE/unoSYAm31anlvJmypZQ7eXz6DwnuBgFj7dL cJH9DbwHFPEW0DY4BePESwrqX8djV355TDXwTsGmaPQR5egdEPsEJYVai He9uFyFr14BLe164AFNLBskSYxOShLeMLwNWZVyr9YtXgw25kChAerdHK g==; X-IronPort-AV: E=McAfee;i="6400,9594,10397"; a="283037276" X-IronPort-AV: E=Sophos;i="5.92,243,1650956400"; d="scan'208";a="283037276" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2022 18:37:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,243,1650956400"; d="scan'208";a="660026479" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga004.fm.intel.com with ESMTP; 03 Jul 2022 18:37:20 -0700 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) 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.2308.27; Sun, 3 Jul 2022 18:37:20 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Sun, 3 Jul 2022 18:37:20 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Sun, 3 Jul 2022 18:37:20 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xm6XQr46SVyg+NeAcPgYSEaEeUc5D7M3ZmsVCyAMFXPkmIItYtgMdBD6Tg+ONH1CffSE5iEFQlxGa62WErPkCoaLzB52Xl/IAal7OVBxCW5J5FPrMACSgzg6A0Ja9Z5RV7Rc3bomufdG02xpjLNONbmH47NbDhWjraouKvfjQDYJ90mTJaTgTFatD2RogBPl4y642GqlKzOjLyX66zJosG7DW8E9my+IUCJkC5WictzjpC1Hyh1seVeQqkwh3YC3zumY9Rfs2BQPHyjyPBDvtoK+MEmVO/07+NZn+8WFq8IhE2JqsKPHvwOXwrcSWnO6CBoJRff76ux2m8v9v9KO9A== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=K8YkrsobMC83zoOewl+nB6vGpZj/OyyHE0BkB9ULkyo=; b=HTSeC35v0Bva/6ZkG2AGk4+qqc+xPsYXF/LbLYvt0RKKUI4QaxDMqr2vkZCQQgm1CD73YAJzrVwTtXz4PACwQxyKz2ju+eUnwCQo/61hepbjD2ER3/5f6ntLOfNfr63WbRbR79VlWZU1KLodSyzspgdZOPxFoVg57opRPgZ1I3m9vYI+BxiNhCYFQG1o9sBDU3EOzrIiubiD7XAo4fs1d+7O4rW0SCE+GK8+4Zn+ups63rmjkaQEVWCPPBlpBzDBqD054nmckLWGqqB20QYJWyrZgjK0cy8U1qo5d0cVrMFQPU3wVtLMlLaScYqhxPNutFDwfCBG93uEUbGH0TfDRA== 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 Received: from MW5PR11MB5906.namprd11.prod.outlook.com (2603:10b6:303:1a0::21) by BYAPR11MB3461.namprd11.prod.outlook.com (2603:10b6:a03:7b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.14; Mon, 4 Jul 2022 01:37:17 +0000 Received: from MW5PR11MB5906.namprd11.prod.outlook.com ([fe80::2d9a:578f:afd5:462d]) by MW5PR11MB5906.namprd11.prod.outlook.com ([fe80::2d9a:578f:afd5:462d%8]) with mapi id 15.20.5395.020; Mon, 4 Jul 2022 01:37:17 +0000 From: "Yuwei Chen" To: "Lin, Jason1" , "devel@edk2.groups.io" CC: "Feng, Bob C" , "Gao, Liming" , "Oram, Isaac W" , "Chaganty, Rangasai V" , "Chiang, Dakota" Subject: Re: [PATCH v3 2/3] [edk2-platforms] Silicon/Intel/FitGen: Reduce the typecasting and pointer usage Thread-Topic: [PATCH v3 2/3] [edk2-platforms] Silicon/Intel/FitGen: Reduce the typecasting and pointer usage Thread-Index: AQHYjVyxPYED7Pkxtk6ORAoDTRYEyq1tcmqA Date: Mon, 4 Jul 2022 01:37:17 +0000 Message-ID: References: <20220701151005.189-1-jason1.lin@intel.com> <20220701151005.189-2-jason1.lin@intel.com> In-Reply-To: <20220701151005.189-2-jason1.lin@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.500.17 dlp-reaction: no-action dlp-product: dlpe-windows authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4f060d46-4512-4b0a-44df-08da5d5dbac6 x-ms-traffictypediagnostic: BYAPR11MB3461:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: LPQMADP18F97Bxn4uXJcHwa5ZmrOeoHvRqXcoLil4/YntHEklqShB/JgjGG6VbUKahsDhuF5XsLgzCuGBqsZCFKGFkFGRnJYJ50C9rxwc0ueF+KJaK/rbPYDqMRN7NLJVv3rEnXtHPOFh71tkudAJ87ku5RsGpbKEgIJ+w7qz0t46yN/WrWmacbojhQNx4y0FDagLaSSSya3J8uhi4BVOvyVThFMuCjIrbGTAlDeqIQsKXY+qpilpOYmOAv9AWzQijod97tzeLq4GJU5DXCtYhJ4eEPUFjPGhldhJ6ZDxSKNtfoQLIIi0ytcozh6H7mC6Z5sc8Y3C/qp3iOPBNSEbyB+u9hh7Q4SywKKo+iFRGb5tBM4KR3fkRIvtHWYT4gESqC9FvtS7DyOUCahvq7Hb4c2DXdAW8WSymZZBSrsvsE1WxD1cIYGJbnBL3XFMOoMqGgOA8XASfKwUkEAAbsYvr3wO6Dddh4KrPVizpf4zCEfL6eHuKwfuS2QdM/Ow3AhHgNjJgoeIpV3sJpHUKVEsDSUgAUan9EELr1Ea/36i/X08697UgRAHukDOJw+I2eDYyOULJR82FLNLCFXlTFlzdPZ8QAdrUpU89cgNgEWgfXrTnjvt7VEjwEMYvRuM6/EhtsAq1iv4WrVUY1zu3N3RfVqsy+wwC7x8xn2RwpYuVU+p1++TgxF0YZtbbfZWjeYlsUhtlLN0G96tWDdmwlXnQqV45iqmh/Db1r89TYe5nZMAKxV4laqPkieNkIme4EhvClA+VOpNEh1O8z+NdAfsHMsXsmleXSTJsmhL202KuQfCBkE1ktVPfkV6I0e4YvCV0SGslGjxc7r1Ql2K8Nznp68Yn276Lvuy6cK3OgrBqE= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW5PR11MB5906.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(396003)(39860400002)(376002)(136003)(346002)(366004)(33656002)(30864003)(316002)(186003)(26005)(53546011)(54906003)(52536014)(66476007)(55016003)(66556008)(110136005)(76116006)(66946007)(5660300002)(64756008)(8676002)(66446008)(4326008)(8936002)(966005)(71200400001)(86362001)(82960400001)(122000001)(83380400001)(2906002)(478600001)(7696005)(6506007)(9686003)(41300700001)(38070700005)(107886003)(38100700002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?4qhUS4EGdliUuytX+Y5rEr3WEZNQGqRXq6kO1bll1OudgAkXeuLb0g+93uKc?= =?us-ascii?Q?8yjArKNfl8h6OmtdeUi5hcHKfgvBvoBHeVG2z6hwtO7L31XYuzErkVsFhj5R?= =?us-ascii?Q?S9NNndAGofSX53C3g4st7lkd+bFmILmA5qEu8sAlaSVNS+E0jXAiEZBRgIYO?= =?us-ascii?Q?/wPYbyX1q4C9vFP0AWNRgjoo1NaskkVEdrCK0njNpL3rVUvhvVAvLy3KfkkJ?= =?us-ascii?Q?qIumC2tY/umTTpyJ6NEAtSujYq7egv0X0N7w+ns514rv+MuTktJKy8lT8cjm?= =?us-ascii?Q?AebMaC9kGxLzKzhG8JWjKCfeuO4Njresayv+YTTyHoerUETrkC7eSw7iysYm?= =?us-ascii?Q?/mKmT4UxhJdlChVdF2ZilW6NMUlktgzTHNfTCa5rbwVJbO9Y9LEZzaaqv6nJ?= =?us-ascii?Q?aapDARSfHEigEHDEAsWUF0bQK4wPkmhTblLA6whxhjUKod99LYVwYDZKxybL?= =?us-ascii?Q?dxQxPenSUkWDDo/xr9hLtOA9qelhMHpA/mrUX45D+cj1Z9xjuM4s5RdRzjxV?= =?us-ascii?Q?AG0+BaUVp1/CnwlV/Xx+ZkfyhXdGmoA1riBXmfEMh6OeCtGpdxiYROmzAMXi?= =?us-ascii?Q?VpYQiP1KufmbzWAknfvV1jsV+i+VcJxy8hKf9tkt3HZSvKU+9kkFb6zgOfm+?= =?us-ascii?Q?Kt68M7O9SXi+ythdm2TC/Bv1ZWP8ivxKs77dK+c2iDyvhJPvqxJ1Z/2sVi8T?= =?us-ascii?Q?eji/r10Rqy0T9tN0ES6F3qyh9FrQRLIf1R7YaERX7sCI8jRd3y91fInVPLQr?= =?us-ascii?Q?jpyyXXytgLFrsyZYbR+Sl5/zj/G8tVSVo9bctb3NxHfgo8BJPBmHcXoUKPMs?= =?us-ascii?Q?IAg/xwf8fao/Fpp7DJ/ftcaCx1h1Q8nscly5C+ntqFqgKV49yB/2NtLcPuFL?= =?us-ascii?Q?VrgyVEOVQS5WQJVMHmpCfvhcdA4rPW6mSW/traBbQddUILqs2MeZeE9kiOH4?= =?us-ascii?Q?fnir6cZ260FfXKwI44WgkdLJ7TDxYUmTLKNjAbCf7R1eanVWHUEufIKb1MLD?= =?us-ascii?Q?OGWrshVSy25tMrxS6ILfZkQR6juS0ogOGcU7Ab6m6db34YS37h1syNekPaDY?= =?us-ascii?Q?DSdAZu5l0QulKtM6cfeq59IfQqwwj049/DHPJefUKGOHaDQd/QkGrpdNrU8s?= =?us-ascii?Q?Q5VvdMiQqYqLgwD0kzdpb+POZ5w0/J5lzyElUeNcNt5qMhy7ELdp/GhZZ66I?= =?us-ascii?Q?khO/6ob5AIMSE1fzafNICcJJWpT2DZFtAIiyhMLThczQoiNGV6fcll+lAY1o?= =?us-ascii?Q?CFk/dKtqeh0cpgeg4pT48C95BqrQR7uHeiWZKhiAU5o9dexu7W1p2oLOMVFb?= =?us-ascii?Q?mogXvYtw6MgKPbLfFBdnxH/zfWWr2FT03C9zzuvNPNTyjsDWj7Htr2wbryzy?= =?us-ascii?Q?yLXdEtTSl3BoX3MMV5qQi4lKr455UuSsEV33GBsR0dgfHxT5KrXqbYe0BYDD?= =?us-ascii?Q?Qf4U5IPkVrpykbZYBs6CKnGN1QNaocpfv9nF4DXhMr24c5+Ep6UHyJM1oODC?= =?us-ascii?Q?P8cXMZVit7IBpQtXOXLRdixKT1EiN9lQrsBxHBmvB7gUBf1h5o4IozKRKH+H?= =?us-ascii?Q?R4NRBWbiiVg3QEtRe8X84p7a7CO0Cw3Ysrzq9JPN?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW5PR11MB5906.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4f060d46-4512-4b0a-44df-08da5d5dbac6 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jul 2022 01:37:17.2775 (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: RbE8rHboUluMQW2Ex04aiVKx2ATAZXDIFTCxEhgFqNzZ1gRMey3GQDOBqZ0lBWe8zukZwPD0PylQqx/skxAARg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR11MB3461 Return-Path: yuwei.chen@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Yuwei Chen > -----Original Message----- > From: Lin, Jason1 > Sent: Friday, July 1, 2022 11:10 PM > To: devel@edk2.groups.io > Cc: Lin, Jason1 ; Feng, Bob C ; > Gao, Liming ; Chen, Christine > ; Oram, Isaac W ; > Chaganty, Rangasai V ; Chiang, Dakota > > Subject: [PATCH v3 2/3] [edk2-platforms] Silicon/Intel/FitGen: Reduce the > typecasting and pointer usage >=20 > From: Jason1 Lin >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3958 >=20 > FitGen tool exists lots of typecasting and pointer usage. > This code change is used to reduce these in FillFitTable () and GetFitEnt= ryInfo > (). > To make code more clearly and easy to read. >=20 > Signed-off-by: Jason1 Lin > Cc: Bob Feng > Cc: Liming Gao > Cc: Yuwei Chen > Cc: Isaac W Oram > Cc: Rangasai V Chaganty > Cc: Dakota Chiang > --- > Silicon/Intel/Tools/FitGen/FitGen.c | 125 ++++++++++++-------- > 1 file changed, 78 insertions(+), 47 deletions(-) >=20 > diff --git a/Silicon/Intel/Tools/FitGen/FitGen.c > b/Silicon/Intel/Tools/FitGen/FitGen.c > index eac8fa8715..01b4f82518 100644 > --- a/Silicon/Intel/Tools/FitGen/FitGen.c > +++ b/Silicon/Intel/Tools/FitGen/FitGen.c > @@ -2768,6 +2768,7 @@ Returns: > { FIRMWARE_INTERFACE_TABLE_ENTRY *FitEntry; UINT32 > FitIndex;+ UINT32 FitEntrySizeValue; UINT32 > Index; UINT8 Checksum; UINTN = SubIndex;@@ > -2788,27 +2789,35 @@ Returns: > // // 2. FitHeader //- FitEntry[FitIndex].Address =3D= *(UINT64 > *)"_FIT_ ";- *(UINT32 *)&FitEntry[FitIndex].Size[0] =3D > gFitTableContext.FitEntryNumber;- FitEntry[FitIndex].Version = =3D > (UINT16)gFitTableContext.FitHeaderVersion;- FitEntry[FitIndex].Type > =3D FIT_TABLE_TYPE_HEADER;- FitEntry[FitIndex].C_V =3D 1= ;+ > FitEntrySizeValue =3D gFitTableContext.FitEntryNumber;+ > FitEntry[FitIndex].Address =3D *(UINT64 *)"_FIT_ ";+ FitEntry[FitInde= x].Size[0] > =3D (UINT8)FitEntrySizeValue;+ FitEntry[FitIndex].Size[1] =3D > (UINT8)(FitEntrySizeValue >> 8);+ FitEntry[FitIndex].Size[2] =3D > (UINT8)(FitEntrySizeValue >> 16);+ FitEntry[FitIndex].Rsvd =3D 0;+ > FitEntry[FitIndex].Version =3D (UINT16)gFitTableContext.FitHeaderVersion= ;+ > FitEntry[FitIndex].Type =3D FIT_TABLE_TYPE_HEADER;+ > FitEntry[FitIndex].C_V =3D 1; // // Checksum will be updated lat= er... //- > FitEntry[FitIndex].Checksum =3D 0;+ FitEntry[FitIndex].Checks= um =3D 0; // > // 3. Microcode // FitIndex++; for (Index =3D 0; Index < > gFitTableContext.MicrocodeNumber; Index++) {- FitEntry[FitIndex].Addre= ss > =3D gFitTableContext.Microcode[Index].Address;- *(UINT32 > *)&FitEntry[FitIndex].Size[0] =3D 0; //gFitTableContext.Microcode[Index].= Size / > 16;- FitEntry[FitIndex].Version =3D > (UINT16)gFitTableContext.MicrocodeVersion;- FitEntry[FitIndex].Type > =3D FIT_TABLE_TYPE_MICROCODE;- FitEntry[FitIndex].C_V = =3D 0;- > FitEntry[FitIndex].Checksum =3D 0;+ FitEntrySizeValue = =3D 0; // > gFitTableContext.Microcode[Index].Size / 16+ FitEntry[FitIndex].Addres= s =3D > gFitTableContext.Microcode[Index].Address;+ FitEntry[FitIndex].Size[0]= =3D > (UINT8)FitEntrySizeValue;+ FitEntry[FitIndex].Size[1] =3D > (UINT8)(FitEntrySizeValue >> 8);+ FitEntry[FitIndex].Size[2] =3D > (UINT8)(FitEntrySizeValue >> 16);+ FitEntry[FitIndex].Rsvd =3D 0;+ > FitEntry[FitIndex].Version =3D (UINT16)gFitTableContext.MicrocodeVersion= ;+ > FitEntry[FitIndex].Type =3D FIT_TABLE_TYPE_MICROCODE;+ > FitEntry[FitIndex].C_V =3D 0;+ FitEntry[FitIndex].Checksum =3D 0; > FitIndex++; } @@ -2816,12 +2825,16 @@ Returns: > // 4. StartupAcm // for (Index =3D 0; Index < > gFitTableContext.StartupAcmNumber; Index++) {- > FitEntry[FitIndex].Address =3D > gFitTableContext.StartupAcm[Index].Address;- *(UINT32 > *)&FitEntry[FitIndex].Size[0] =3D 0; //gFitTableContext.StartupAcm.Size /= 16;- > FitEntry[FitIndex].Version =3D > (UINT16)gFitTableContext.StartupAcmVersion;- FitEntry[FitIndex].Type > =3D FIT_TABLE_TYPE_STARTUP_ACM;- FitEntry[FitIndex].C_V = =3D 0;- > FitEntry[FitIndex].Checksum =3D 0;+ FitEntrySizeValue = =3D 0; // > gFitTableContext.StartupAcm.Size / 16+ FitEntry[FitIndex].Address =3D > gFitTableContext.StartupAcm[Index].Address;+ FitEntry[FitIndex].Size[0= ] =3D > (UINT8)FitEntrySizeValue;+ FitEntry[FitIndex].Size[1] =3D > (UINT8)(FitEntrySizeValue >> 8);+ FitEntry[FitIndex].Size[2] =3D > (UINT8)(FitEntrySizeValue >> 16);+ FitEntry[FitIndex].Rsvd =3D 0;+ > FitEntry[FitIndex].Version =3D (UINT16)gFitTableContext.StartupAcmVersio= n;+ > FitEntry[FitIndex].Type =3D FIT_TABLE_TYPE_STARTUP_ACM;+ > FitEntry[FitIndex].C_V =3D 0;+ FitEntry[FitIndex].Checksum =3D 0; > FitIndex++; } @@ -2829,19 +2842,23 @@ Returns: > // 4.5. DiagnosticAcm // if (gFitTableContext.DiagnstAcm.Address != =3D 0) {- > FitEntry[FitIndex].Address =3D gFitTableContext.DiagnstAcm.Ad= dress;- > *(UINT32 *)&FitEntry[FitIndex].Size[0] =3D 0;- FitEntry[FitIndex].Vers= ion > =3D (UINT16)gFitTableContext.DiagnstAcmVersion;- FitEntry[FitIndex].Ty= pe > =3D FIT_TABLE_TYPE_DIAGNST_ACM;- FitEntry[FitIndex].C_V = =3D 0;- > FitEntry[FitIndex].Checksum =3D 0;+ FitEntrySizeValue = =3D 0; // > gFitTableContext.DiagnstAcmVersion.Size / 16+ FitEntry[FitIndex].Addre= ss > =3D gFitTableContext.DiagnstAcm.Address;+ FitEntry[FitIndex].Size[0] = =3D > (UINT8)FitEntrySizeValue;+ FitEntry[FitIndex].Size[1] =3D > (UINT8)(FitEntrySizeValue >> 8);+ FitEntry[FitIndex].Size[2] =3D > (UINT8)(FitEntrySizeValue >> 16);+ FitEntry[FitIndex].Rsvd =3D 0;+ > FitEntry[FitIndex].Version =3D (UINT16)gFitTableContext.DiagnstAcmVersio= n;+ > FitEntry[FitIndex].Type =3D FIT_TABLE_TYPE_DIAGNST_ACM;+ > FitEntry[FitIndex].C_V =3D 0;+ FitEntry[FitIndex].Checksum =3D 0; > FitIndex++; } // // 5. BiosModule // //- // BiosModule segment= s order > needs to be put from low addresss to high for Btg requirement+ // > BiosModule segments order needs to be put from low address to high for Bt= g > requirement // if (gFitTableContext.BiosModuleNumber > 1) { for (= Index > =3D 0; Index < (UINTN)gFitTableContext.BiosModuleNumber - 1; Index++){@@ = - > 2855,12 +2872,16 @@ Returns: > } } for (Index =3D 0; Index < gFitTableContext.BiosModuleNumber;= Index++) > {- FitEntry[FitIndex].Address =3D > gFitTableContext.BiosModule[Index].Address;- *(UINT32 > *)&FitEntry[FitIndex].Size[0] =3D gFitTableContext.BiosModule[Index].Size= / 16;- > FitEntry[FitIndex].Version =3D > (UINT16)gFitTableContext.BiosModuleVersion;- FitEntry[FitIndex].Type > =3D FIT_TABLE_TYPE_BIOS_MODULE;- FitEntry[FitIndex].C_V = =3D 0;- > FitEntry[FitIndex].Checksum =3D 0;+ FitEntrySizeValue = =3D > gFitTableContext.BiosModule[Index].Size / 16;+ FitEntry[FitIndex].Addr= ess > =3D gFitTableContext.BiosModule[Index].Address;+ FitEntry[FitIndex].Si= ze[0] > =3D (UINT8)FitEntrySizeValue;+ FitEntry[FitIndex].Size[1] =3D > (UINT8)(FitEntrySizeValue >> 8);+ FitEntry[FitIndex].Size[2] =3D > (UINT8)(FitEntrySizeValue >> 16);+ FitEntry[FitIndex].Rsvd =3D 0;+ > FitEntry[FitIndex].Version =3D (UINT16)gFitTableContext.BiosModuleVersio= n;+ > FitEntry[FitIndex].Type =3D FIT_TABLE_TYPE_BIOS_MODULE;+ > FitEntry[FitIndex].C_V =3D 0;+ FitEntry[FitIndex].Checksum =3D 0; > FitIndex++; } @@ -2868,15 +2889,18 @@ Returns: > // 6. Optional module // for (Index =3D 0; Index < > gFitTableContext.OptionalModuleNumber; Index++) {- > FitEntry[FitIndex].Address =3D > gFitTableContext.OptionalModule[Index].Address;- *(UINT32 > *)&FitEntry[FitIndex].Size[0] =3D gFitTableContext.OptionalModule[Index].= Size;- > FitEntry[FitIndex].Version =3D > (UINT16)gFitTableContext.OptionalModule[Index].Version;- > FitEntry[FitIndex].Type =3D > (UINT8)gFitTableContext.OptionalModule[Index].Type;+ FitEntrySizeValue > =3D gFitTableContext.OptionalModule[Index].Size;+ FitEntry[FitIndex].A= ddress > =3D gFitTableContext.OptionalModule[Index].Address;+ > FitEntry[FitIndex].Size[0] =3D (UINT8)FitEntrySizeValue;+ > FitEntry[FitIndex].Size[1] =3D (UINT8)(FitEntrySizeValue >> 8);+ > FitEntry[FitIndex].Size[2] =3D (UINT8)(FitEntrySizeValue >> 16);+ > FitEntry[FitIndex].Version =3D > (UINT16)gFitTableContext.OptionalModule[Index].Version;+ > FitEntry[FitIndex].Type =3D > (UINT8)gFitTableContext.OptionalModule[Index].Type; if > (FitEntry[FitIndex].Type =3D=3D FIT_TABLE_TYPE_CSE_SECURE_BOOT) {- > FitEntry[FitIndex].Rsvd =3D > (UINT8)gFitTableContext.OptionalModule[Index].SubType;+ > FitEntry[FitIndex].Rsvd =3D > (UINT8)gFitTableContext.OptionalModule[Index].SubType; }- > FitEntry[FitIndex].C_V =3D 0;- FitEntry[FitIndex].Chec= ksum =3D 0;+ > FitEntry[FitIndex].C_V =3D 0;+ FitEntry[FitIndex].Checksum =3D 0; > FitIndex++; } @@ -2884,12 +2908,16 @@ Returns: > // 7. Port module // for (Index =3D 0; Index < > gFitTableContext.PortModuleNumber; Index++) {- > FitEntry[FitIndex].Address =3D > gFitTableContext.PortModule[Index].Address + > ((UINT64)gFitTableContext.PortModule[Index].Size << 32);- *(UINT32 > *)&FitEntry[FitIndex].Size[0] =3D 0;- FitEntry[FitIndex].Version = =3D > (UINT16)gFitTableContext.PortModule[Index].Version;- > FitEntry[FitIndex].Type =3D > (UINT8)gFitTableContext.PortModule[Index].Type;- FitEntry[FitIndex].C_= V > =3D 0;- FitEntry[FitIndex].Checksum =3D 0;+ FitEntrySize= Value =3D 0;+ > FitEntry[FitIndex].Address =3D gFitTableContext.PortModule[Index].Addres= s + > ((UINT64)gFitTableContext.PortModule[Index].Size << 32);+ > FitEntry[FitIndex].Size[0] =3D (UINT8)FitEntrySizeValue;+ > FitEntry[FitIndex].Size[1] =3D (UINT8)(FitEntrySizeValue >> 8);+ > FitEntry[FitIndex].Size[2] =3D (UINT8)(FitEntrySizeValue >> 16);+ > FitEntry[FitIndex].Rsvd =3D 0;+ FitEntry[FitIndex].Version =3D > (UINT16)gFitTableContext.PortModule[Index].Version;+ > FitEntry[FitIndex].Type =3D > (UINT8)gFitTableContext.PortModule[Index].Type;+ FitEntry[FitIndex].C_= V > =3D 0;+ FitEntry[FitIndex].Checksum =3D 0; FitIndex++; } @@ -313= 0,6 +3158,7 > @@ Returns: > --*/ { FIRMWARE_INTERFACE_TABLE_ENTRY *FitEntry;+ UINT32 > FitEntrySizeValue; UINT32 FitIndex; UINT32 > FitTableOffset; @@ -3155,7 +3184,8 @@ Returns: > if (FitEntry[FitIndex].Type !=3D FIT_TABLE_TYPE_HEADER) { return 0= ; }- > gFitTableContext.FitEntryNumber =3D *(UINT32 *)&FitEntry[FitIndex].Size[0= ];+ > FitEntrySizeValue =3D (((UINT32)FitEntry[FitIndex].Size[2]) << 16) + > (((UINT32)FitEntry[FitIndex].Size[1]) << 8) + > ((UINT32)FitEntry[FitIndex].Size[0]);+ gFitTableContext.FitEntryNumber = =3D > FitEntrySizeValue; gFitTableContext.FitHeaderVersion =3D > FitEntry[FitIndex].Version; //@@ -3163,6 +3193,7 @@ Returns: > // FitIndex++; for (; FitIndex < gFitTableContext.FitEntryNumber; > FitIndex++) {+ FitEntrySizeValue =3D (((UINT32)FitEntry[FitIndex].Size= [2]) << 16) > + (((UINT32)FitEntry[FitIndex].Size[1]) << 8) + > ((UINT32)FitEntry[FitIndex].Size[0]); switch (FitEntry[FitIndex].Type= ) > { case FIT_TABLE_TYPE_MICROCODE: > gFitTableContext.Microcode[gFitTableContext.MicrocodeNumber].Address =3D > (UINT32)FitEntry[FitIndex].Address;@@ -3175,7 +3206,7 @@ Returns: > break; case FIT_TABLE_TYPE_BIOS_MODULE: > gFitTableContext.BiosModule[gFitTableContext.BiosModuleNumber].Address > =3D (UINT32)FitEntry[FitIndex].Address;- > gFitTableContext.BiosModule[gFitTableContext.BiosModuleNumber].Size = =3D > *(UINT32 *)&FitEntry[FitIndex].Size[0] * 16;+ > gFitTableContext.BiosModule[gFitTableContext.BiosModuleNumber].Size = =3D > FitEntrySizeValue * 16; gFitTableContext.BiosModuleVersion > =3D FitEntry[FitIndex].Version; gFitTableContext.BiosModuleNumber += +; > break;@@ -3192,7 +3223,7 @@ Returns: > // Not Port Configure, pass through default: // Others > gFitTableContext.OptionalModule[gFitTableContext.OptionalModuleNumber > ].Address =3D (UINT32)FitEntry[FitIndex].Address;- > gFitTableContext.OptionalModule[gFitTableContext.OptionalModuleNumber > ].Size =3D *(UINT32 *)&FitEntry[FitIndex].Size[0];+ > gFitTableContext.OptionalModule[gFitTableContext.OptionalModuleNumber > ].Size =3D FitEntrySizeValue; > gFitTableContext.OptionalModule[gFitTableContext.OptionalModuleNumber > ].Version =3D FitEntry[FitIndex].Version; > gFitTableContext.OptionalModule[gFitTableContext.OptionalModuleNumber > ].Type =3D FitEntry[FitIndex].Type; > gFitTableContext.OptionalModuleNumber ++;-- > 2.37.0.windows.1