From nobody Mon May 6 19:19:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+63767+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+63767+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1596683800; cv=none; d=zohomail.com; s=zohoarc; b=ZOqRB00Rovpk1lxljRLoeaf9ABmM9O3WLRznz9hNnJ2rSClm9baHpj9liXILOqY43tnYdLpa/HR7Upf4sDJINn4AOWo6XS8q+DyW7lNGiHtqjs7t8THitDPVueEmXm8ufJKAl5BStkly06iPxKMxjPuurQhP58EkI25efzsSc+k= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596683800; h=Content-Transfer-Encoding:Cc:Date:From:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=eJmI0hDBdfUm5BpMGSL9DihkTqQhT9C8s9DwxVcYYeQ=; b=HUSOK4ZXolh3q6iCgWA2Jm+QRAq7N7vjESatbChxDqo8dBTrJZUFGHla3h12rfJ3YlFqPNX5mrB/jsC+wq2SIeDKjdLnaeyblz2/UJyk6BHq07SkD3oZBa/Fv+Zky29vELfkevAsKOVUMJzXRjQyeat+eFI3CA8j2zu++bIHJrA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+63767+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1596683800238794.0826155307816; Wed, 5 Aug 2020 20:16:40 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id tP4FYY1788612xtivMsymDca; Wed, 05 Aug 2020 20:16:39 -0700 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web12.5858.1596683797619452747 for ; Wed, 05 Aug 2020 20:16:37 -0700 X-Received: from pps.filterd (m0148663.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0763DaNr004888; Thu, 6 Aug 2020 03:16:34 GMT X-Received: from g2t2353.austin.hpe.com (g2t2353.austin.hpe.com [15.233.44.26]) by mx0a-002e3701.pphosted.com with ESMTP id 32q9tmcmgr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Aug 2020 03:16:34 +0000 X-Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2353.austin.hpe.com (Postfix) with ESMTP id 7DD98A4; Thu, 6 Aug 2020 03:16:33 +0000 (UTC) X-Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.39]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 145E437; Thu, 6 Aug 2020 03:16:31 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com, Leif Lindholm , Ard Biesheuvel , Daniel Schaefer Subject: [edk2-devel] [PATCH] EmbeddedPkg/libfdt: Add strncmp macro to use AsciiStrnCmp Date: Thu, 6 Aug 2020 10:34:21 +0800 Message-Id: <20200806023421.25161-1-abner.chang@hpe.com> X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 Precedence: Bulk List-Unsubscribe: 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,abner.chang@hpe.com X-Gm-Message-State: v9Wc2V6ljzM54T8ko1pkWiJbx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1596683799; bh=SHYBUgm/bVa70aR+xVkmrNqn6wN81YUFOhvQnp+Jjw0=; h=Cc:Date:From:Reply-To:Subject:To; b=jLwzsDyFQm8mSOUdumFlHgywyfLE6upUozGife6PBXys/4aXaXj4aDOoyBmz1k0DQXg YHxu/R7EfBX6GZ5SyZzdRrMY5IV40aWxhR1ZZH0ESpTLfT6hWc3TIO/DNvqeSoYmb66WL VRYGI1fryqvb5mHwfslkkT6NBKIjCliuZDk= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" For the implementation which utilizes libfdt provided in EmbeddedPkg however it uses strncmp function in the libfdt helper library, libfdt_env.h should provide the macro implied with edk2 strncmp implementation. The example is RISC-V OpenSBI library. edk2 RISC-V port uses OpenSBI library and incorporate with edk2 libfdt. edk2 libfdt_env.h provides the necessary macros to build OpenSBI which uses fdt functions in edk2 environment. However, OpenSBI also has libfdt helper library that uses strncmp function which is not defined in edk2 libfdt_env.h. This commit addresses the build issue caused by missing strncmp macro in libfdt_env.h. Check below three commits for the corresponding changes on OpenSBI, https://github.com/riscv/opensbi/commit/8e47649eff96c303e02fbd58cdc6c4ed341= 066ec https://github.com/riscv/opensbi/commit/2845d2d2cf4fb74a89452ba223995aa4a11= 8c07e https://github.com/riscv/opensbi/commit/2cfd2fc9048806353298a1b967abf985901= e36e8 Signed-off-by: Abner Chang Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Daniel Schaefer Reviewed-by: Leif Lindholm --- EmbeddedPkg/Include/libfdt_env.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/EmbeddedPkg/Include/libfdt_env.h b/EmbeddedPkg/Include/libfdt_= env.h index 11a9764733..7feff52bc0 100644 --- a/EmbeddedPkg/Include/libfdt_env.h +++ b/EmbeddedPkg/Include/libfdt_env.h @@ -76,4 +76,8 @@ static inline size_t strnlen (const char* str, size_t str= sz ) { return AsciiStrnLenS (str, strsz); } =20 +static inline size_t strncmp (const char* str1, const char* str2, size_t s= trsz ) { + return AsciiStrnCmp (str1, str2, strsz); +} + #endif /* _LIBFDT_ENV_H */ --=20 2.25.0 -=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 (#63767): https://edk2.groups.io/g/devel/message/63767 Mute This Topic: https://groups.io/mt/76021725/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-