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 08A3A941544 for ; Fri, 15 Sep 2023 09:06:46 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=yTydBw2SOtYBWV8wkBBV39EhNXZZGczD2Ccb/GN4lf8=; 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=1694768805; v=1; b=FKtbieGTGyGXIteGaUu9W/NxNVSVhsSb1UgnmE443gRSM+t/FLIybuKAcJEw3hutvW15+EZg +rExbejGeE3Hj2eWfn2HE2JkFicDacKZ7jSvowe40RgryROY1YGPvqVk+2VpkjQ2ksihar5G6e8 NZB8Ahe42gYtqaoPmW2ITQno= X-Received: by 127.0.0.2 with SMTP id DEhUYY7687511xa47Cw1QVSS; Fri, 15 Sep 2023 02:06:45 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web10.16646.1694768805037194793 for ; Fri, 15 Sep 2023 02:06:45 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10833"; a="381931368" X-IronPort-AV: E=Sophos;i="6.02,148,1688454000"; d="scan'208";a="381931368" X-Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Sep 2023 02:06:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10833"; a="780024009" X-IronPort-AV: E=Sophos;i="6.02,148,1688454000"; d="scan'208";a="780024009" X-Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga001.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 15 Sep 2023 02:06:42 -0700 X-Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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:06:42 -0700 X-Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) 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:06:42 -0700 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.44) 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:06:41 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fHH36BEw2pF2Jr2RmZOu4jTPJvA58w9+I6QR3G+oIb4VZjs9nilq0c11A/Zqf8XHwtrRGRiSXpeXBiR8vRkxeL+iYQ1uqUSrUHVfxaA/VuZEMYJEs+Uua1XdmDs/Miyy6NvZUuvGkhjad2vixEItKLrJxrTEZHLigVCBsSYJFHFFP4NSDcD8oLKKQjaFVnnMtXnLXkl+cYD0m4C4ykRDGp1G3KXTHG4MugQK3y7pAaWzSl3TDOj2frSuuSoNjaKdajQmxx84CMDAEPDPjM7uS+OTyuxXB+fn9LLOzlTn2Ffmmv9VJwHvOa7VqaAG6Zzw/LQnpDvBbTtp+6L4w1UFlQ== 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=tmXpcZ2C74rjoSoean+Vm+YUNjwgpLT2bjvMd+Xtx+w=; b=amNULJoU/xvWEUGJ/RhIxhAcZrodYnUyEQ0FrR2ddCstdKAu/0A0oNhkAsCWaWQsvRvf45k6JqsMHjoDdI/cuFQHbaF0xCAIqfGU0A5L2kYAGQzrZGmbzrrrJWaSndOiZjPMEkXP8SBytfl0r8MPtXKcxKobeVxK0qiRJxImun5cUw4rIYiJTUnUgATsd4tjp+m5dxO3DpMHy6tjzgbDdLMfsgX6a1nk2NZDfo9w2AxG1dIlwlIKOLYT0C1INRJy/SnFGRVKppGKuCza+sYKjQUf3BV7bkcLjkVXgfBWN681p2kVCbvJTeWxPZYQ9pkzmsDxnF9smTV7kVOFVVNhxA== 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 CH3PR11MB7819.namprd11.prod.outlook.com (2603:10b6:610:125::20) by SJ2PR11MB7548.namprd11.prod.outlook.com (2603:10b6:a03:4cb::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.20; Fri, 15 Sep 2023 09:06:40 +0000 X-Received: from CH3PR11MB7819.namprd11.prod.outlook.com ([fe80::6dba:854f:a134:2243]) by CH3PR11MB7819.namprd11.prod.outlook.com ([fe80::6dba:854f:a134:2243%4]) with mapi id 15.20.6768.040; Fri, 15 Sep 2023 09:06:40 +0000 From: "Lu, James" To: "Wang, BruceX" , "devel@edk2.groups.io" CC: "Lin, Benny" , "Guo, Gua" , "Chiu, Chasel" 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: AQHZ57LOrRL4Kwa+d0eqa7gPxhVOJrAbmGjA Date: Fri, 15 Sep 2023 09:06:40 +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-001, en-US, zh-TW X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: CH3PR11MB7819:EE_|SJ2PR11MB7548:EE_ x-ms-office365-filtering-correlation-id: 8d1f970a-e80d-4786-2a8b-08dbb5cb12d4 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: 2JHy3weXZ9s58S/rIIxqlQCSVhcvjbqvLt3FFwDhzcJ/DmyW1gn2W4OLbIPK/1O7dtxI7k89CNB9X3H1tNUoezQN0WTA8esEO4bsAAxQJy2nIVNKSxwztZeklFyC4WVoO29+0dWEB8a0T0wqzi3oAdmQEeBX0XL+1/DBxrQLfpgkjNvntEc0VPhE1s2CrToAEL0YC8Uo/p9FMcM6mGuH1uLxQEjGAV2MpubH79wuacqHelZWOlgDBQ0LDlQat3/b1YRH8d6yUufJJFvcN8dz+0m7t2gbiBWOMi6zGBCnJ7pwcipzD4nc3BPf5b3WMeUdVGKZqHybhlcb7VltF593DnYVYGe+Qhs56cwzoFMEfx8T+cP1LX7iM1o2nQixB85hqhfpy11zOUC7hCnC7vXH5kCl/hd2m3umdJSqIuZo/ys8y5XfhPif2AnODLg+28zmVKYNUFce2wQyRxJVJdE4Nf+404yINQXFaNiwfxikZSwILA2PbJZGxeojQUG+jiszDJzdg5zQ6nlm4oqJY+YvgdIuQY1sIB69HT1an+okcONJWMuZvRGjy4lwFnI6KN5X0iVasrDl0by5XCawDmFfwkZNOQ9CA5wEozkxVCtGpChpC7VA+RJQcXrXReUqJnW3 x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?9LubqdSkkQq/yNvk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mPl?= =?us-ascii?Q?j8ddOlm+BDuyOVwKDVo9p4229ipZVzrgO0qqy3zhN784VzhZtZZZmyNKkErb?= =?us-ascii?Q?cj7rJn4P1tt5+Egaa6fpMw3ZfUaRPmKQ6ihWOR0NBqkrjYikalS8eq5UmS97?= =?us-ascii?Q?JaKAJO6bArs9Eqe8RGhrRDI6/NDyuAqKfqexCL9hPxY7yjRybOdaQOS7/A2C?= =?us-ascii?Q?UC4YeoiZ+TanJBw7WBA9p+6Kv3bqXAAnuXpXZZOO6OTiGBC8YPCrDyI6NpJK?= =?us-ascii?Q?KV3YJZg5Ywyrpa4zsaOSjprthhfHw6eURQ/+q+UyzG9Q0PlDD0/oc0L2ZYSB?= =?us-ascii?Q?skM/HN2ByZ1oAl9f4+U3Qex/EHSTRxDDaz5RICy/F+zRz2zhaV4DbOP7Haeb?= =?us-ascii?Q?fG7ATVCVMUaJUJ5eQYMCQ3JtfgRvuRn15LvLXpiYjZUL/ADDIGgk/kzZKR6C?= =?us-ascii?Q?R6rDYGJuX9z9v6ROFfhqPbtDnsdWSxd+cN301D0dRhYCRdp+u3cfB6C19QgE?= =?us-ascii?Q?pjziyrX/SjDkGLyD6KzsOUPHdjXvUbtgs0xVs/Sjnmb1f/zxfpUTw/AtOFb7?= =?us-ascii?Q?PVuHxUwcoej0Hz5ZAclHZdZ5cjkV2YKGWtdy7NCNEto2JpfuG7VzO6XW+Cbh?= =?us-ascii?Q?qo8LYjKfGuUEzpkJNUZGa5w1ztjZCzC/jqN1dG12UHcZGVDjzFPXwGFhNNnA?= =?us-ascii?Q?vqv/WMGtLTspjIOHoltM1cv2i23HeVf7BxzKmpnp?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH3PR11MB7819.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8d1f970a-e80d-4786-2a8b-08dbb5cb12d4 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Sep 2023 09:06:40.1781 (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: 3oi2KKCfP+xdSbYunguMR0fqoJ/pUwiGqKW9708DqlLI56GTLoJKlASnji9N4Ybpz6cyoR8fiQUCUR/NamhF4A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR11MB7548 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,james.lu@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: E3bEOoeWrnw8D0MhKeo22dyBx7686176AA= 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=FKtbieGT; 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: James Lu Thanks, James -----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 (#108702): https://edk2.groups.io/g/devel/message/108702 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-