From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=04876649c6=abner.chang@hpe.com) 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 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 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) 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: [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-Mailer: git-send-email 2.25.0 X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-08-05_18:2020-08-03,2020-08-05 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 suspectscore=0 spamscore=0 mlxscore=0 bulkscore=0 phishscore=0 malwarescore=0 impostorscore=0 mlxlogscore=713 adultscore=0 clxscore=1011 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2008060022 Content-Transfer-Encoding: quoted-printable 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 --- 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);=0D }=0D =0D +static inline size_t strncmp (const char* str1, const char* str2, size_t s= trsz ) {=0D + return AsciiStrnCmp (str1, str2, strsz);=0D +}=0D +=0D #endif /* _LIBFDT_ENV_H */=0D --=20 2.25.0