From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id C9BEC7803CC for ; Fri, 15 Sep 2023 09:02:43 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=ESkvJuRqmXJOHy3Y8or0G/HO+8bhKq8zIemmtyaoPuQ=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1694768562; v=1; b=HcGB/PxueR6SlkrmdZ8wtWF8IOS8cPhJJnLuOalhkGp7wAASDAxnAeXOf+nqFSkaEdYdo8Of zw0fLkz8rYo0L3M/ChwlfoNvaw/2BIdrcuJFUg7Os9Rfp5mdvhz7QMtftBdAdzaB686kr6pbyEm XUSLFFEmGlXrjhfRzC4s/NU0= X-Received: by 127.0.0.2 with SMTP id q9OXYY7687511xupTHJ4jI1p; Fri, 15 Sep 2023 02:02:42 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web10.16609.1694768562022380175 for ; Fri, 15 Sep 2023 02:02:42 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10833"; a="378117986" X-IronPort-AV: E=Sophos;i="6.02,148,1688454000"; d="scan'208";a="378117986" X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2023 02:02:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10833"; a="918584834" X-IronPort-AV: E=Sophos;i="6.02,148,1688454000"; d="scan'208";a="918584834" X-Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga005.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 15 Sep 2023 02:02:13 -0700 X-Received: from orsmsx602.amr.corp.intel.com (10.22.229.15) 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.2507.32; Fri, 15 Sep 2023 02:02:13 -0700 X-Received: from orsedg603.ED.cps.intel.com (10.7.248.4) 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.2507.32 via Frontend Transport; Fri, 15 Sep 2023 02:02:13 -0700 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.176) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Fri, 15 Sep 2023 02:02:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bA083N2YAMI/+sa97hiXCziwxoJ1pWQV14Hkie5iruN1zyoh1fpguuuorBZccD4YbntJmdl9ZCHIF2ck7h2Lshq6HOADQP3aygIfHyy63l0ItQmc/M7RWaF28xQxWO0Rpp7gz1KOdO96qwFxXS5yTd/Ap3LvVsBbifkQEgVuuyMBNem09X7+Uoet9CnSFw+puQW8iRyVJG/toPeWgb6T2jkt8Qvm2J82f9DznUiQY0AgOeie6qN1GAd5CtMyNHnEzVIaYGFm1EjoMSq9tMY2JzBfBtQB8L5OknfL3CeXMXpy2AzW3zxJJO51iSveU8KNqlF/5OGf4uBCZianznHjrA== 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=grUWCuudAV95iyb4A4w5Xh9KnQodC4xmF18RXqPPF2E=; b=Vs2rtMvyzBTnflNr5sM32HGtafrZAalw3E4l52mq57SVF1pcp/VBwisja38ZcUKp+Y0gGG2LgA68AdjJRIjEMn/e2Z9eDd1lcN4di8sDUX24Wmt6dgByeSCq3BmrQx8ze5VjZXgM2K03DeVNCery22tMC+2toT572B8ZcqVR5VNTXD4U1c1mXYY7leqf56BquWLgkV/Nd99eRoNTGbCLsURqnhsA0uaXLmeXipylurM+9vQtW2MMJhqAfc2Gjzeu+kA/MrlYFslMMzEoh8L0aG89Du9IxRjk42FiHqUFjZhEcHlZf8Exo+rKuyzSl6AHPpMCEt0DRhpUlxO9FHci5A== 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 X-Received: from BL1PR11MB5478.namprd11.prod.outlook.com (2603:10b6:208:31d::12) by CH0PR11MB5475.namprd11.prod.outlook.com (2603:10b6:610:d6::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.21; Fri, 15 Sep 2023 09:02:11 +0000 X-Received: from BL1PR11MB5478.namprd11.prod.outlook.com ([fe80::b852:2d61:939f:53ea]) by BL1PR11MB5478.namprd11.prod.outlook.com ([fe80::b852:2d61:939f:53ea%4]) with mapi id 15.20.6792.021; Fri, 15 Sep 2023 09:02:10 +0000 From: "Guo, Gua" To: "Wang, BruceX" , "devel@edk2.groups.io" CC: "Lin, Benny" , "Chiu, Chasel" , "Lu, James" Subject: Re: [edk2-devel] [PATCH v2 1/2] MdePkg/BaseFdtLib: Add Fdt function. Thread-Topic: [PATCH v2 1/2] MdePkg/BaseFdtLib: Add Fdt function. Thread-Index: AQHZ57LOJ7DL2vqnEESJd8P6Dx4ijrAblx9A Date: Fri, 15 Sep 2023 09:02:10 +0000 Message-ID: References: <20230915085813.1046-1-brucex.wang@intel.com> <20230915085813.1046-2-brucex.wang@intel.com> In-Reply-To: <20230915085813.1046-2-brucex.wang@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BL1PR11MB5478:EE_|CH0PR11MB5475:EE_ x-ms-office365-filtering-correlation-id: 9de75f04-5947-451d-73d0-08dbb5ca71fe x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: AgC3eCjHn7v8BIPGre6TKb6ImgOkTqETsIcF5U5wj2NiRkkbSp4lr1cM4xRPokEnVNEbqcNkJgQ4KSyjjQrsSM1i6fr6HUl/3TEZzKxOZLvS7d3bfQlz9z1+lxk769zcUdRPljwFtCRJ10bIQt0iENvllM2hjO10FMTCjSqpeH+XP0mQYlMVU60lEXT3p7A3whclfIzs4Uvj1kki2dd1AlltWgg+HrH4q57EWY4PjSk4xhT+ZaxVaiXAQ7FjnCFmOY2b1dM9kuchsjtFd4B7srkOHwytrkj1msX+XLNNnb8QG2qOii55dForSFfR928Tg2LV6hdU90+hGV5WMNWN6gPmFIuwdeVLGjddlDoRm2sRfAUKP822QkeaoGGDzuJGc0ZIG+1uQElmYD7x1HNFE/Hw3s0CR+mN2jmapDKxomnAAkbqhIR/s7IBbGryqLaVzHw2/6leBdEeIju9gXKyXyx8CatgbD6MO2IKsRc9E+FT+tjgxNW7a2apu8lydL04wuZHO3L0lHthzHhF1XK3HsJX2tw2bQLPHekYZRQwCbTFUS2mGZ57xLPO1g7xXb5U0nFZ8Dv7IzYIL12USbqRXBscnv6yCemeh4n3w3P99mIDmLVQdYWiVLnrquZWSBeL x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?zRW298XQ57N3JQhRdYwbHnpzflGr7Kf7EX4Y52VoND1EVkq0J3UCLh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1S8f4C9y9ecpC0iB4WaHB8mdDBHr+IGus?= =?us-ascii?Q?nZMLoj32z9c5pGajdrWziz5sVHMgv6fNi069UikaUwWgB7PCkPv9mzbd/0N1?= =?us-ascii?Q?59w9eNuEGeOD5QXCaOOgeygeUK66vUKpce1XgAuKbLu1JU3EztVSmfVO/jDx?= =?us-ascii?Q?x1TFAS58lAazeuOy+n2dCYWu1evkpzWAosg72Ba3pgIt3rRKvoo2KcIf/akJ?= =?us-ascii?Q?XuyfDQE0pDl+VyOQ0qZ6Ama/9UfWUIUNDe8Tlrx0seFWmMuQYoP+2oWuqjQB?= =?us-ascii?Q?PyTx16CYyug3DWa1Ybfb7DR1NvhyGBK4H8rfoL/n8GV+VG0yjaTes2L5CmG3?= =?us-ascii?Q?ztz1quq17pqnukKkiIwKv/bLMqBFt1dLjp77SpbZtPJcsgOE3V9aUtP+SQ5o?= =?us-ascii?Q?OR+9yE4t/Y7i3C69wzT66Klhv3tFQDeWUeBnc1Nc/ieZIrfaShhh008NFFsi?= =?us-ascii?Q?x0wHnwyjV9WqzQShJl/i9bvQMhYnTIZtEXi/RwMjKeya4ql1Nxbrt4c2HLto?= =?us-ascii?Q?HIHN/DEa3apI8xeREmhgLVev+N+tpCL2MY11zkTdUBFVA5upDZ4cS29yyiaS?= =?us-ascii?Q?AcUxZ64gOoJuz1c03EAZNtrQdCy/1LPc4+FCPo+WOkfQGVNHZbPP7I5reqtM?= =?us-ascii?Q?+j5ggZkAAejRdWYwHdmlMzWa4FQdq5n8DQUMZQPA?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BL1PR11MB5478.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9de75f04-5947-451d-73d0-08dbb5ca71fe X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Sep 2023 09:02:10.3358 (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: pUbfRO1WduFQBQfQF37ccvYWSYQSZZegzZd04aKS8qlBNkGrt1UeP6dJ91s1a1q8a14IVHryQNKj2+MyYbXjSw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR11MB5475 X-OriginatorOrg: intel.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,gua.guo@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: 3JRcKJFEcvVgKwJe3kYlxJBYx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b="HcGB/Pxu"; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Reviewed-by: Gua Guo -----Original Message----- From: Wang, BruceX =20 Sent: Friday, September 15, 2023 4:58 PM To: devel@edk2.groups.io Cc: Wang, BruceX ; Lin, Benny ;= Guo, Gua ; Chiu, Chasel ; Lu, Ja= mes Subject: [PATCH v2 1/2] MdePkg/BaseFdtLib: Add Fdt function. From: "Brucex.Wang" Add FdtGetName() and FdtNodeDepth() function. Cc: Benny Lin Cc: Gua Guo Cc: Chasel Chiu Cc: James Lu Signed-off-by: BruceX Wang --- MdePkg/Include/Library/FdtLib.h | 34 +++++++++++++++++++++++++ MdePkg/Library/BaseFdtLib/FdtLib.c | 40 ++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) diff --git a/MdePkg/Include/Library/FdtLib.h b/MdePkg/Include/Library/FdtLi= b.h index cf5ceba9e9..2bd926b5b4 100644 --- a/MdePkg/Include/Library/FdtLib.h +++ b/MdePkg/Include/Library/FdtLib.h @@ -398,4 +398,38 @@ FdtSetProp ( IN UINT32 Length ); +/**+ Returns the name of a given node.++ = @param[in] Fdt The pointer to FDT blob.+ @param[in] NodeOffse = Offset of node to check.+ @param[in] Length The pointer to an = integer variable (will be overwritten) or NULL.++ @return The pointer to t= he node's name.++**/+CONST CHAR8 *+EFIAPI+FdtGetName (+ IN VOID *Fdt,+ = IN INT32 NodeOffset,+ IN UINT32 *Length+ );++/**+ FdtNodeDepth() fin= ds the depth of a given node. The root node+ has depth 0, its immediate s= ubnodes depth 1 and so forth.++ @param[in] Fdt The pointer to F= DT blob.+ @param[in] NodeOffset Offset of node to check.++ @return De= pth of the node at NodeOffset.+ **/+INT32+EFIAPI+FdtNodeDepth (+ IN CONST = VOID *Fdt,+ IN INT32 NodeOffset+ );+ #endif /* FDT_LIB_H_ */diff -= -git a/MdePkg/Library/BaseFdtLib/FdtLib.c b/MdePkg/Library/BaseFdtLib/FdtLi= b.c index 090b0b3fd4..1ef99ea882 100644 --- a/MdePkg/Library/BaseFdtLib/FdtLib.c +++ b/MdePkg/Library/BaseFdtLib/FdtLib.c @@ -402,3 +402,43 @@ FdtSetProp ( { return fdt_setprop (Fdt, NodeOffset, Name, Value, (int)Length); }++/**= + Returns the name of a given node.++ @param[in] Fdt The point= er to FDT blob.+ @param[in] NodeOffset Offset of node to check.+ @par= am[in] Length The pointer to an integer variable (will be overwritt= en) or NULL.++ @return The pointer to the node's name.++**/+CONST CHAR8 *+= EFIAPI+FdtGetName (+ IN VOID *Fdt,+ IN INT32 NodeOffset,+ IN UINT32= *Length+ )+{+ return fdt_get_name (Fdt, NodeOffset, (int *)Length);+}++= /**+ FdtNodeDepth() finds the depth of a given node. The root node+ has = depth 0, its immediate subnodes depth 1 and so forth.++ @param[in] Fdt = The pointer to FDT blob.+ @param[in] NodeOffset Offset of node= to check.++ @returns Depth of the node at NodeOffset.+**/+INT32+EFIAPI+Fd= tNodeDepth (+ IN CONST VOID *Fdt,+ IN INT32 NodeOffset+ )+{+ ret= urn fdt_node_depth (Fdt, NodeOffset);+}--=20 2.39.1.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#108700): https://edk2.groups.io/g/devel/message/108700 Mute This Topic: https://groups.io/mt/101375949/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-