From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web10.36834.1607962274347608259 for ; Mon, 14 Dec 2020 08:11:14 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=RK+oBraZ; spf=pass (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=0617585351=abner.chang@hpe.com) Received: from pps.filterd (m0150244.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 0BEG94GE020181; Mon, 14 Dec 2020 16:09:34 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : mime-version; s=pps0720; bh=ENv7FTHc2gMJs+6Ohyt08yTpfbSFlSLmneuWCBGrEtY=; b=RK+oBraZ6qX/KGWS+9pB6+xVbJMFvFoac6Jaxn8LnpyjaDaSB29IQEBY9tVEaNsURPB2 x2SD6A5l7i7c4Cb9zxt0BG9tGRW1HNt6FyzpuiqCCT0Rengu2LnpBOIZZvvK9RPHW+pt 6uHvR1TC6ikuVgkfbuoYtbcXB4optKjfwtuUSeWsCPFgglwMvm43oQMhe0fwd3hbzcMS 4G7bZ0ZfWsFWsIPAn4Qp0VcOuIjQp5iMIKCeiXQc/Cn0s+ouGQRwuNYQm8oiPoh4Rl51 XNaVuP1maaU70vtNHt9Nq0KAf9MIxNF3vTa4JO9RQq4QwHLOH0s8xCl5gO6s9yztDUg5 DA== Received: from g9t5008.houston.hpe.com (g9t5008.houston.hpe.com [15.241.48.72]) by mx0b-002e3701.pphosted.com with ESMTP id 35cph77ap9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Dec 2020 16:09:34 +0000 Received: from g4t3433.houston.hpecorp.net (g4t3433.houston.hpecorp.net [16.208.49.245]) by g9t5008.houston.hpe.com (Postfix) with ESMTP id 52A0770; Mon, 14 Dec 2020 16:09:31 +0000 (UTC) Received: from abner-virtual-machine.asiapacific.hpqcorp.net (abner-virtual-machine.asiapacific.hpqcorp.net [15.119.210.153]) by g4t3433.houston.hpecorp.net (Postfix) with ESMTP id 59CCF45; Mon, 14 Dec 2020 16:09:27 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: Sean Brogan , Bret Barkelew , Andrew Fish , Laszlo Ersek , Leif Lindholm , Michael D Kinney , Liming Gao , Nickle Wang , Peter O'Hanley Subject: [PATCH v6 0/6] jansson edk2 port Date: Mon, 14 Dec 2020 11:53:15 +0800 Message-Id: <20201214035321.17000-1-abner.chang@hpe.com> X-Mailer: git-send-email 2.17.1 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.343,18.0.737 definitions=2020-12-14_06:2020-12-11,2020-12-14 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 spamscore=0 adultscore=0 bulkscore=0 mlxscore=0 clxscore=1015 impostorscore=0 lowpriorityscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012140111 In v6, Remove JanssonJsonMapping.h In v5, move BaseUcs2Utf8Lib to under RedfishPkg. In v4, - Address review comments - Seperate CRT functions to a individule library CrtLib under RedfishPkg. - Seperate UCS2-UTF8 functions to a individule library BaseUcs2Utf8Lib under MdeModulePkg. In v3, Add jansson library as the required submoudle in CiSettings.py for CI test. In v2, JsonLib is moved to under RedfishPkg. edk2 JSON library is based on jansson open source (https://github.com/akheron/jansson) and wrapped as an edk2 library. edk2 JsonLib will be used by edk2 Redfish feature drivers (not contributed yet) and the edk2 port of libredfish library (not contributed yet) based on DMTF GitHub (https://github.com/DMTF/libredfish). Jansson is licensed under the MIT license(refer to ReadMe.rst under edk2). It is used in production and its API is stable. In UEFI/EDKII environment, Redfish project consumes jansson to achieve JSON operations. * Jansson version on edk2: 2.13.1 * EDKII jansson library wrapper: - JsonLib.h: This is the denifitions of EDKII JSON APIs which are mapped to jannson funcitons accordingly. - JanssonJsonLibMapping.h: This is the wrapper file to map funcitons and definitions used in native jannson applications to edk2 JsonLib. This avoids the modifications on native jannson applications to be built under edk2 environment. *Known issue: Build fail with jansson/src/load.c, overrride and add code in load.c to conditionally use stdin according to HAVE_UNISTD_H macro. The PR is submitted to jansson open source community. https://github.com/akheron/jansson/pull/558 Signed-off-by: Abner Chang Cc: Sean Brogan Cc: Bret Barkelew Cc: Andrew Fish Cc: Laszlo Ersek Cc: Leif Lindholm Cc: Michael D Kinney Cc: Liming Gao Cc: Nickle Wang Cc: Peter O'Hanley Abner Chang (6): RedfishPkg/Ucs2Utf8lib: UCS2 to UFT8 manipulation library edk2: jansson submodule for edk2 JSON library RedfishPkg/CrtLib: C runtime library RedfishPkg/library: EDK2 port of jansson library RedfishPkg: Add EDK2 port of jansson library to build .pytool: Add required submodule for JsonLib .gitmodules | 3 + .pytool/CISettings.py | 2 + ReadMe.rst | 1 + RedfishPkg/Include/Crt/assert.h | 16 + RedfishPkg/Include/Crt/errno.h | 16 + RedfishPkg/Include/Crt/limits.h | 16 + RedfishPkg/Include/Crt/math.h | 16 + RedfishPkg/Include/Crt/stdarg.h | 15 + RedfishPkg/Include/Crt/stddef.h | 16 + RedfishPkg/Include/Crt/stdio.h | 15 + RedfishPkg/Include/Crt/stdlib.h | 16 + RedfishPkg/Include/Crt/string.h | 16 + RedfishPkg/Include/Crt/sys/time.h | 15 + RedfishPkg/Include/Crt/sys/types.h | 15 + RedfishPkg/Include/Crt/time.h | 15 + RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h | 61 + RedfishPkg/Include/Library/CrtLib.h | 195 +++ RedfishPkg/Include/Library/JsonLib.h | 763 +++++++++++ .../Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c | 421 +++++++ .../BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf | 31 + RedfishPkg/Library/CrtLib/CrtLib.c | 705 +++++++++++ RedfishPkg/Library/CrtLib/CrtLib.inf | 37 + RedfishPkg/Library/JsonLib/JsonLib.c | 964 ++++++++++++++ RedfishPkg/Library/JsonLib/JsonLib.inf | 89 ++ RedfishPkg/Library/JsonLib/Readme.rst | 40 + RedfishPkg/Library/JsonLib/jansson | 1 + RedfishPkg/Library/JsonLib/jansson_config.h | 46 + .../Library/JsonLib/jansson_private_config.h | 19 + RedfishPkg/Library/JsonLib/load.c | 1111 +++++++++++++++++ RedfishPkg/RedfishLibs.dsc.inc | 3 + RedfishPkg/RedfishPkg.ci.yaml | 25 + RedfishPkg/RedfishPkg.dec | 23 + RedfishPkg/RedfishPkg.dsc | 3 + 33 files changed, 4730 insertions(+) create mode 100644 RedfishPkg/Include/Crt/assert.h create mode 100644 RedfishPkg/Include/Crt/errno.h create mode 100644 RedfishPkg/Include/Crt/limits.h create mode 100644 RedfishPkg/Include/Crt/math.h create mode 100644 RedfishPkg/Include/Crt/stdarg.h create mode 100644 RedfishPkg/Include/Crt/stddef.h create mode 100644 RedfishPkg/Include/Crt/stdio.h create mode 100644 RedfishPkg/Include/Crt/stdlib.h create mode 100644 RedfishPkg/Include/Crt/string.h create mode 100644 RedfishPkg/Include/Crt/sys/time.h create mode 100644 RedfishPkg/Include/Crt/sys/types.h create mode 100644 RedfishPkg/Include/Crt/time.h create mode 100644 RedfishPkg/Include/Library/BaseUcs2Utf8Lib.h create mode 100644 RedfishPkg/Include/Library/CrtLib.h create mode 100644 RedfishPkg/Include/Library/JsonLib.h create mode 100644 RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.c create mode 100644 RedfishPkg/Library/BaseUcs2Utf8Lib/BaseUcs2Utf8Lib.inf create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.c create mode 100644 RedfishPkg/Library/CrtLib/CrtLib.inf create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.c create mode 100644 RedfishPkg/Library/JsonLib/JsonLib.inf create mode 100644 RedfishPkg/Library/JsonLib/Readme.rst create mode 160000 RedfishPkg/Library/JsonLib/jansson create mode 100644 RedfishPkg/Library/JsonLib/jansson_config.h create mode 100644 RedfishPkg/Library/JsonLib/jansson_private_config.h create mode 100644 RedfishPkg/Library/JsonLib/load.c -- 2.17.1