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 722CB780091 for ; Mon, 25 Sep 2023 03:09:18 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=dMEKWOWyl7CwqkHu6PH9Ar4KxyUVfB0QUZuvw0eMWUs=; 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=1695611357; v=1; b=cytssqEIFrmDHRHWj18OahkAaQqmh21+r3uxvk4kYLNW7rqC4t1J1IRYSIOsrOrU+XQfxHH4 yzFWuE/eZ46kLhttiASo4RFdFdKWKR4pRNz0xnwakj0EjTfKFxEM32RroadEeuWL0K2mlja3Byf 5ri/YYGOtJ+M3cLot6g8bNq0= X-Received: by 127.0.0.2 with SMTP id eM1hYY7687511xTdnsAvxlrH; Sun, 24 Sep 2023 20:09:17 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web10.53540.1695611356550280087 for ; Sun, 24 Sep 2023 20:09:16 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="447641074" X-IronPort-AV: E=Sophos;i="6.03,174,1694761200"; d="scan'208";a="447641074" X-Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2023 20:09:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="783310566" X-IronPort-AV: E=Sophos;i="6.03,174,1694761200"; d="scan'208";a="783310566" X-Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by orsmga001.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 24 Sep 2023 20:09:16 -0700 X-Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) 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; Sun, 24 Sep 2023 20:09:15 -0700 X-Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Sun, 24 Sep 2023 20:09:15 -0700 X-Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32 via Frontend Transport; Sun, 24 Sep 2023 20:09:15 -0700 X-Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.103) 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; Sun, 24 Sep 2023 20:09:15 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TAD0Z0sFwwLsjO9Aka/1wDMoesnyIleTEEKSZ44zXkZk5AGeQr914p6IV+VvvmwvF60lWMnpz4BtY4cpuwrx8AXlQOloGp9CtvbDLRucy74IBFXUsLvF9N/Gn7mgOmYytQ7wdCoHDs496u19JpuLAUKJw7Kq3nvQlD+NHTW2x3LkvrWI9ReanEKAgLSZrm6Hcrq4Qj0x9a1UJimJn3uF3+1K/94v5PBRZnm1mJCWAxcCZdORx3owBrG6VrvLxvIregiZZbG2/+UCRtL/wCcpdM46f2/3ZLu2ZZP7+v2V8Ov7oeHx1u+LRSlFvaG+HI3yUwdjqyANE2KrhYKsSYujzw== 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=GOPjlyM3q5McGJ38oa/QqeO9ATobziEo56lHHZFwaDg=; b=ZEOwCN6Z5PYgxuU/EC6GRsFXFKtqjiXTB5OMJBsAFrAZTcSXaNaYc8QiQzK7WNcbU9vR2WDEZxg0uJ8OVtGJ2JiCl4YHv+JkO+STUEftrF0LV5SB6Q0+mB05AKf/9M7P0G7SFj/hj0RelQQ/ZuyjiqCMJ/gqxd8ga2HSV7cE5z1gosDWZqXA+T8EIE5TOBFPsvgtIzTl91Zd6DXYV3gcrSUI9vtNcSTA353SIiURF75uTvyzE4/LUOOVnn+CCd9Vyko3Gf3W0AC9KBY2WkZN6J7U41ZQM5kCOgMhDwISZ9FtHCO57HwAIeYTNxJIZ8xmizT2G4XyRtmijS545NEuCA== 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 MW4PR11MB7104.namprd11.prod.outlook.com (2603:10b6:303:22b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.28; Mon, 25 Sep 2023 03:09:13 +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%5]) with mapi id 15.20.6813.017; Mon, 25 Sep 2023 03:09:13 +0000 From: "Guo, Gua" To: "Wang, BruceX" , "devel@edk2.groups.io" CC: "Lin, Benny" , "Chiu, Chasel" , "Lu, James" Subject: Re: [edk2-devel] [PATCH v5 1/2] MdePkg/BaseFdtLib: Add Fdt function. Thread-Topic: [PATCH v5 1/2] MdePkg/BaseFdtLib: Add Fdt function. Thread-Index: AQHZ71YuZEfbRQ0mOEuAfghUkwI/orAq3J/w Date: Mon, 25 Sep 2023 03:09:13 +0000 Message-ID: References: <20230925021517.1444-1-brucex.wang@intel.com> <20230925021517.1444-2-brucex.wang@intel.com> In-Reply-To: <20230925021517.1444-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_|MW4PR11MB7104:EE_ x-ms-office365-filtering-correlation-id: 8a3a1d8e-cbc3-4a33-83ea-08dbbd74cba2 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: G2oFuy/2URpxCe0xdhCVbp9KHpio8tzVkzwwqtu1BuZJgJvDTRtplwczvytnVPY6g5K0EiuG0Z5/MgYPgJFnaIHmbo64bTkrceMtzJSC9kcENlSraem8QncRP9XgXrEFjOZGCK6yhx2ujTz0K8uxBcleB53ScL4Gj9aZx7IRioH5oqiJsQUW45xIretZhMUZD9VWv4rz3DbUfwl7ETzI9/R9TMqOHkh9Xoekcg5TGOO9kfEWEBx96sJ9ORjsomTgVNznAyi/X/pRPwI20uQjfzj1+wGhcWSulf68Aow6CxOYnDSaTSu0X6VkzyS8BHegpH3ecm4CGU/fwoF2WZl4si3VmS0lLw9r+7zF7iX9T0xIvE62EbGUdCxwn0uroA93cdvdI7NQEbLv51lHkpfw43xRBCLncrcsaNCTB946t692DKYyVgAw5uAYyS4NU72q6ikom4/9jJy2sBwaEp3LUsJAHnXuETtgLtBSP70orRGEEFbnT6OW8jU7e6ImTwH5KPYNrKTrvFO78UtXQRCUKw9Zd/RQh11vcKN0X0B2C4JawWrAKffEVyy8E9LU2md+Ejd0ZSc6ntWjVEMr43z9qxKLoTIfcArDh/tlpLZUnHh2KkUGGjs9yacOeD5+KRaR x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?yEVOpy0t3FgrcGRZOn+88mSHdgzMMskEXvt5NREJNXOE2pNhxecvS/zudiQK?= =?us-ascii?Q?CAsDnaNc5zw3z3hfBir7UvwT3KH7/oxvdNBWd5TXdS3TB1ZEDk5qIoJCvJSf?= =?us-ascii?Q?5Wi+lMyAGjbBZVCrIsEBQ+TpHrbal5dkbbejyzwzBWl4HoKmShxd90Gus98p?= =?us-ascii?Q?fCR/jxTFF4ewM6jaNgD8TY6R+lTQBK1c5uJM+1WIV7RSsto6VE96T5i+tR3K?= =?us-ascii?Q?DVdV4JwLbvuA36dlFb49K1kULoMY5p0XF37Cfx1hwJCeNIqMdaeW7mAvGkqU?= =?us-ascii?Q?MI2o38AcmMsBhqV+j0/luw1tZ3AtYxk/9Sf1DAWMH4f9AxcguPFxpc8HDDTq?= =?us-ascii?Q?dCqo2pCeZkt6CiiR1JQi3IUekScXy09wvo/fAhwLIZAxoBeqBPRjPeKbyG6e?= =?us-ascii?Q?5CGtPCOTn7ZgOj7/AqU3VQizn+ErTqvpgR0v/2UpX4PmvYrv1MNdIdFgL/kk?= =?us-ascii?Q?5Lu5Hy4zk9YMrTd3pNbkVetEaf4w2J7sJaKKzV7QI0yLpJG1QpDv72RzmTpp?= =?us-ascii?Q?cbVfnV1Nl4FVqa3xwSN0c14td2N47KKm5aEzBMTn6Qtz2KIpUz7OLfkfqJIs?= =?us-ascii?Q?842r2gw5gwYzkdUsamp7Sx7kBoLjnpvkkytSyB17bP3Uqg1UaQM5cKxw/T5F?= =?us-ascii?Q?SBxqepjgOMdD3/TfEfWEA1kJcqbCrHcb0aCDrkF9Ir3brtYBA1JOLglpFGsz?= =?us-ascii?Q?3hlSEAVirZy8bq43iqRM+PjV2QID0Vrv7niVWasl4nkEoF9Il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X-MS-Exchange-CrossTenant-AuthSource: BL1PR11MB5478.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8a3a1d8e-cbc3-4a33-83ea-08dbbd74cba2 X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Sep 2023 03:09:13.2770 (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: Uw+/o8rP9DGI5LCO95TVXBSE2XlhJHR7f1kronmyrlm/noXwHCgvhvhmQ12VcBzJTP+6ahpVLYJN7PEqgBMW+Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR11MB7104 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: BKzHvS3WnZ1OGm7GaSQgjsyzx7686176AA= 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=cytssqEI; 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: Monday, September 25, 2023 10:15 AM To: devel@edk2.groups.io Cc: Wang, BruceX ; Lin, Benny ;= Guo, Gua ; Chiu, Chasel ; Lu, Ja= mes Subject: [PATCH v5 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..d9300a18e3 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 V= OID *Fdt,+ IN INT32 NodeOffset+ );+ #endif /* FDT_LIB_H_ */diff --= git a/MdePkg/Library/BaseFdtLib/FdtLib.c b/MdePkg/Library/BaseFdtLib/FdtLib= .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 (#109033): https://edk2.groups.io/g/devel/message/109033 Mute This Topic: https://groups.io/mt/101568108/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-