From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web12.9267.1637066773208834155 for ; Tue, 16 Nov 2021 04:46:13 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=ZD3eo889; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: bob.c.feng@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10169"; a="294501598" X-IronPort-AV: E=Sophos;i="5.87,239,1631602800"; d="scan'208";a="294501598" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2021 04:46:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,239,1631602800"; d="scan'208";a="592670614" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga002.fm.intel.com with ESMTP; 16 Nov 2021 04:46:12 -0800 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 16 Nov 2021 04:46:11 -0800 Received: from orsmsx609.amr.corp.intel.com (10.22.229.22) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 16 Nov 2021 04:46:11 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx609.amr.corp.intel.com (10.22.229.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 16 Nov 2021 04:46:11 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.168) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Tue, 16 Nov 2021 04:46:11 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Npg3e7UcmEKDxvoIhjrTauOZj3HVaaEDJxLhJVinLxMnwaCG4K28xfVopSC3Vy/0Hyz0w9dL9uggUn+PIGlUFtplBZrlay/HvqXOl3O+yQn4cm3+wmKUASkkLqyLYJ9cgdRyNbot8VOQrkY9iWG5QJ3Hn4NE8lvCqpa8HXyaNSNMnpzWQKsYo78H5E3nusc/hYYqpNo96bCvtQDESEbebRWOne/OFKCkqkPZWRyT4Z1fsq8wL5mfVWk/F7zF4QDasz0y2F95y25h2l7u6r1zmgtDLmUqkgidx71qYOjPMYKz7y0oy1Xd2kjYkZoZk89MGHl5TI+vTBcnxRPT/xGVkQ== 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=1BbubP3YIgHHtAvLcam8LtGRd5CMbhBQk5ZZsyquQek=; b=N8LQoj5am5RmnLv6ncQzac6/AdKuFWzvbjQkX+JQ/BPSOFzN5kKZNOY+vsos1mKUovVnD2aVv7uHnHWWo7hKW1+t4UkSew4rQde1UWJPEKdPbRwGf91fc9DQEhMzaB9ThR9JlGKYfPAJAYsp9RwwB0o12GTBBvbhCLIsGkNyUOQYX1GsP/sLNVdnf6vEAmZJWgCOPsg+9mtr7BOGdTurGgKHMQNgLkD1H3jGZdORXItky56o0vabxa/x5mpi66TD+oLVRnysGP/djiUM/vHjgtWHr6Pl525k5RM2P6m2VjSUuCkCdBlX/Xf++3z8ZFVzS1yagxoxmZU5BBvvlMtT1Q== 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=1BbubP3YIgHHtAvLcam8LtGRd5CMbhBQk5ZZsyquQek=; b=ZD3eo889T4y6LcdeKZQIMXkd92/D0UAnFwcDuuFTNORIXmpkyHjjbn9AeGSVwx1cysVwo/2h23EGfysOM7GuB+tAGhr5QPpu/Va3lsPaynQXB7+NY4e65KZjQ2UCw5Kih2QeReOLfneKiU3IQCCR+qQsPtX+Fz907ufk1ApusLk= Received: from DM6PR11MB4073.namprd11.prod.outlook.com (2603:10b6:5:19f::22) by DM6PR11MB3804.namprd11.prod.outlook.com (2603:10b6:5:13c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4690.27; Tue, 16 Nov 2021 12:46:09 +0000 Received: from DM6PR11MB4073.namprd11.prod.outlook.com ([fe80::85d4:9d42:234a:6b4b]) by DM6PR11MB4073.namprd11.prod.outlook.com ([fe80::85d4:9d42:234a:6b4b%6]) with mapi id 15.20.4690.027; Tue, 16 Nov 2021 12:46:09 +0000 From: "Bob Feng" To: "Jiang, Xiaolu" , "devel@edk2.groups.io" CC: Liming Gao , "Chen, Christine" Subject: Re: [edk2-devel][PATCH] BaseTools: Increase the DevicePath length for support more PCD value. Thread-Topic: [edk2-devel][PATCH] BaseTools: Increase the DevicePath length for support more PCD value. Thread-Index: AQHX2os4HnJlRorTh0+OdMco6Kq76awGGpWw Date: Tue, 16 Nov 2021 12:46:09 +0000 Message-ID: References: <20211116014214.745-1-xiaolu.jiang@intel.com> In-Reply-To: <20211116014214.745-1-xiaolu.jiang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.200.16 dlp-product: dlpe-windows dlp-reaction: no-action 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: 98e0f28b-7d45-4e11-bdf0-08d9a8ff1086 x-ms-traffictypediagnostic: DM6PR11MB3804: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3383; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: idTGLLwV2BGP2ZDYwxnFtW7LAYOdtjBmaw8TW6IVcguxXky22oghPu0MvRHm/JT8gBT/wrPwUjvPgSIrxjXfMxXemukQGj2JXII4PZH2oA1P6UUturH2mRi3j3PN3dB4pr7z4AfdD4auUAnxx/ObF/OumLnudtWZ4hE3/8VwS+uVwoTqBsVBzOd99nlccvP4ZyiM2jGCw2C9Wspp5XL+fpCLGZFwN/ggVQPLoW9iKeVn0m1mpfMsgkYexkEPpHq/P1/kXmecyEBw6HwzufkWUPLCugtz2WCHiUHx6cClOudfECbpfXdSXVYHFNX49rWVeRdnCXPcQW1UKHijdcFEeZvuLsDIZphqdTqTc71pLzosdIjf7dwynoVLyk5xi4r39Z0um6F2aZTXawKX+WaerP8WAnHjs2pS0Fo+T9qttQiWkmeoRzpiw5QbPNFLyzpD/66X5YNZRFtCU9nIrCwPtDKW86VkhgqIYZZr2DYgA9/0PdBQ0RoAIbEdWua6Jgr1WjHP3cJHoDgwUe05bO5DGjnUQH6xyak3muYPr6q98LJzZJgHEL8ZF/MPLKGh3Psu1QJdPWPTrEgiHQWfYxJdIR1hmHigTaxtNFkWije560tuzIU3MEadfOTk+cyPaNM3iejyVx9grhZICvkp0s37mG1H8xDF8C0kyWfSES0YHCWG1p5aZzjh7HBD591TNdPwpAf/Uh2WhXtcAc5woz9wEetTGkyYsOtXoBYWOfR7hTrxe3E5h8CBralTz+3+P1WOMM9tdkwd+N3o3JTII8jp57KEhE5qLGAMdxbrzhNHNcY= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4073.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(316002)(66446008)(4326008)(508600001)(66556008)(66476007)(7696005)(186003)(64756008)(76116006)(38070700005)(86362001)(33656002)(71200400001)(2906002)(53546011)(66946007)(6506007)(26005)(966005)(83380400001)(9686003)(122000001)(107886003)(54906003)(82960400001)(110136005)(8676002)(5660300002)(38100700002)(52536014)(55016002)(8936002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?gsIskqSr+bcai/Bdu/U7t5blku9PrV9DhSMz5RZvvqqequfD/gl20eMJFIQO?= =?us-ascii?Q?BQSVXGMzv6cBCorH/9LN3ykdc2WZNnoAalop5fV4SWUuEFaky39TStHU9OsG?= =?us-ascii?Q?s2hE05iIFap18V8cpnFHmqfl1TS/iDq+YLRNm8SLS4q55Vinj3HMd/xnTSI/?= =?us-ascii?Q?TK9w0tJf9Q0VixbAw8NdbipfguARHxqE2z+EsheIN96I6nwvZDyBm1k7nqEl?= =?us-ascii?Q?NfXwL/YYSt/O+qqEWa6GsKFAzEQrBTaSkY6mnA3mnA5GAIpB2iWzdZRGND4k?= =?us-ascii?Q?Od1y8B3xeVTca5kuhDqFnkJmwkKkxH/vW6ytL88qVBiuiQfL4U3blA1X5X3R?= =?us-ascii?Q?L4NEcStVutuiDkLR7DVugouIXeK3j6/EOd0u5uEPpBW3dUEqC/bwup84rP7u?= =?us-ascii?Q?80fhpbfgbOFGdJspre9AIR6O7NTd7QbatfqEBtACI3hT5Et0Aluf3tsCVDDp?= =?us-ascii?Q?yXPiSJzohDbwBj3QoRHd/HXpxG0qQynBbnvSmKs6GNACqnY9CyohZCfq4T2g?= =?us-ascii?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9c3f?= =?us-ascii?Q?lNzyMuUm2PNqctyoUxQ6PjmhzD3Uues9m+K7wwq6tUmgmfbYZPwWdcMyYV2z?= =?us-ascii?Q?VR0EF6rLa93CleOZCkYJRyPi/2CCd9/vDMveGV+/nyVyKWrrnBl4ab3BDpKc?= =?us-ascii?Q?XPvxt1xyOR+9Gsxc5lS0NfAGGNtpeZHaOIT8wyfL0PJwu5xeYyoPNVKXuM47?= =?us-ascii?Q?uZNIcZx+FqQGeZwA1M9/4Rs=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4073.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 98e0f28b-7d45-4e11-bdf0-08d9a8ff1086 X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Nov 2021 12:46:09.4190 (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: NyiJ5WmLmRBLFL40yn9OvdJ8BWdvu2YKn6tAQNSKCgNKCdrqtoNTwgsXq0tg5ad3XGHNgtRYEgTGxvwSLVD8uw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3804 Return-Path: bob.c.feng@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable This patch is good to me. Reviewed-by: Bob Feng -----Original Message----- From: Jiang, Xiaolu =20 Sent: Tuesday, November 16, 2021 9:42 AM To: devel@edk2.groups.io Cc: Jiang, Xiaolu ; Feng, Bob C ; Liming Gao ; Chen, Christine Subject: [edk2-devel][PATCH] BaseTools: Increase the DevicePath length for = support more PCD value. Currently the PCD Value only support 13 Guid,When use more 13 pcd will caus= e the build tool fail, Need calculate the required memory,then allocate it. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3718 Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Signed-off-by: Xiaolu Jiang --- BaseTools/Source/C/DevicePath/DevicePath.c | 36 +++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/BaseTools/Source/C/DevicePath/DevicePath.c b/BaseTools/Source/= C/DevicePath/DevicePath.c index c4d224ed61..8a0f5f4e2a 100644 --- a/BaseTools/Source/C/DevicePath/DevicePath.c +++ b/BaseTools/Source/C/DevicePath/DevicePath.c @@ -144,6 +144,40 @@ Returns: *UniString =3D '\0'; } ++/**+ Returns the length of a Null-terminated A= SCII string.++ This function returns the number of ASCII characters in the= Null-terminated+ ASCII string specified by String.++ If Length > 0 and D= estination is NULL, then ASSERT().+ If Length > 0 and Source is NULL, then= ASSERT().+ If PcdMaximumAsciiStringLength is not zero and String contains= more than+ PcdMaximumAsciiStringLength ASCII characters, not including th= e Null-terminator,+ then ASSERT().++ @param String A pointer to a Null-= terminated ASCII string.++ @return The length of String.++**/+UINTN+EFIAPI= +AsciiStrLen (+ IN CONST CHAR8 *String+ )+{+ UINTN = Length;++ ASSERT (String !=3D NULL);++ for (Len= gth =3D 0; *String !=3D '\0'; String++, Length++) {++ }+ return Length;+}= + int main(int argc, CHAR8 *argv[]) { CHAR8 * Str;@@ -170,7 +204,7 @@ int= main(int argc, CHAR8 *argv[]) fprintf(stderr, "Invalid option value, Device Path can't be NULL"); = return STATUS_ERROR; }- Str16 =3D (CHAR16 *)malloc(1024);+ Str16 =3D = (CHAR16 *)malloc((AsciiStrLen (Str) + 1) * sizeof (CHAR16)); if (Str16 = =3D=3D NULL) { fprintf(stderr, "Resource, memory cannot be allocated");= return STATUS_ERROR;--=20 2.30.2.windows.1