Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1m2vUF-0008F5-BN for mharc-grub-devel@gnu.org; Mon, 12 Jul 2021 08:56:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2vUD-00089v-Pl for grub-devel@gnu.org; Mon, 12 Jul 2021 08:56:37 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:44488) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2vUC-0002gQ-0e for grub-devel@gnu.org; Mon, 12 Jul 2021 08:56:37 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16CCZ9Y9086520; Mon, 12 Jul 2021 08:56:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=Phif9LBYjH64A4hg5X6eEghKRZnOJRUaLCaywS4HKKc=; b=J+nwispdgul4GF7Y5MEFZSk5Q7T0aQcW3S9MdgLY4wgDxiujh0il1MA0jp7D2eUwp0RF y2b6bYcP92P7xIPUGGU+eHf3NJi5mszUSR/c6Yl9h1XSAnC3xcvioJJSJO93NBRnJkN+ LnyV2PE4eREXuTAio6b79Fty2itQ0LTkQismsWojGukv75J67MbII5GnCgh4FOmQWVOF SKC6risuyi/3dbIowN4IzO7vtDQQyeC4F2rRcuUp4qXrPt/6fLKGzybSdKh9R+q2z4kI AvfKuCge0BQDP09+QDlyVw/A49T+6tnSgsyP5F1+2MI0lHoOiPTQdPvUVTAfesaYECid 9A== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 39qs48ru77-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 12 Jul 2021 08:56:33 -0400 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 16CCZ92j086486; Mon, 12 Jul 2021 08:56:33 -0400 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com with ESMTP id 39qs48ru6x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 12 Jul 2021 08:56:33 -0400 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 16CCrEpg028530; Mon, 12 Jul 2021 12:56:32 GMT Received: from b01cxnp23032.gho.pok.ibm.com (b01cxnp23032.gho.pok.ibm.com [9.57.198.27]) by ppma01dal.us.ibm.com with ESMTP id 39q36anwts-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 12 Jul 2021 12:56:32 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp23032.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 16CCuUUE53149982 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Jul 2021 12:56:31 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CBF7A11206D; Mon, 12 Jul 2021 12:56:30 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BBDB0112067; Mon, 12 Jul 2021 12:56:30 +0000 (GMT) Received: from [9.47.158.152] (unknown [9.47.158.152]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 12 Jul 2021 12:56:30 +0000 (GMT) Subject: Re: [PATCH v2 10/22] posix_wrap: tweaks in preparation for libtasn1 To: The development of GNU GRUB , Daniel Axtens Cc: rashmica.g@gmail.com, alastair@d-silva.org, nayna@linux.ibm.com References: <20210630084031.2663622-1-dja@axtens.net> <20210630084031.2663622-11-dja@axtens.net> From: Stefan Berger Message-ID: Date: Mon, 12 Jul 2021 08:56:30 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210630084031.2663622-11-dja@axtens.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-TM-AS-GCONF: 00 X-Proofpoint-GUID: _oxtirwfEFLQVrJhxo5mRxTcy2gT3hPo X-Proofpoint-ORIG-GUID: _1Eqsoup1ClbGao9HLlznPgR13YTz7nv X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790 definitions=2021-07-12_07:2021-07-12, 2021-07-12 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 adultscore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 clxscore=1015 spamscore=0 malwarescore=0 suspectscore=0 impostorscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107120099 Received-SPF: pass client-ip=148.163.158.5; envelope-from=stefanb@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -34 X-Spam_score: -3.5 X-Spam_bar: --- X-Spam_report: (-3.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-1.479, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Jul 2021 12:56:38 -0000 On 6/30/21 4:40 AM, Daniel Axtens wrote: > - Define SIZEOF_UNSIGNED_LONG_INT, it's the same as > SIZEOF_UNSIGNED_LONG. > > - Define WORD_BIT, the size in bits of an int. This is a defined > in the Single Unix Specification and in gnulib's limits.h. gnulib > assumes it's 32 bits on all our platforms, including 64 bit > platforms, so we also use that value. > > - Provide strto[u]l[l] preprocessor macros that resolve to > grub_strto[u]l[l]. To avoid gcrypt redefining strtoul, we > also define HAVE_STRTOUL here. > > Signed-off-by: Daniel Axtens Reviewed-by: Stefan Berger > --- > grub-core/lib/posix_wrap/limits.h | 1 + > grub-core/lib/posix_wrap/stdlib.h | 8 ++++++++ > grub-core/lib/posix_wrap/sys/types.h | 1 + > 3 files changed, 10 insertions(+) > > diff --git a/grub-core/lib/posix_wrap/limits.h b/grub-core/lib/posix_wrap/limits.h > index 7217138ffd6b..591dbf3289d8 100644 > --- a/grub-core/lib/posix_wrap/limits.h > +++ b/grub-core/lib/posix_wrap/limits.h > @@ -37,5 +37,6 @@ > #define LONG_MAX GRUB_LONG_MAX > > #define CHAR_BIT 8 > +#define WORD_BIT 32 > > #endif > diff --git a/grub-core/lib/posix_wrap/stdlib.h b/grub-core/lib/posix_wrap/stdlib.h > index 7a8d385e973a..4634db09f294 100644 > --- a/grub-core/lib/posix_wrap/stdlib.h > +++ b/grub-core/lib/posix_wrap/stdlib.h > @@ -58,4 +58,12 @@ abs (int c) > return (c >= 0) ? c : -c; > } > > +#define strtol grub_strtol > + > +/* for libgcrypt */ > +#define HAVE_STRTOUL > +#define strtoul grub_strtoul > + > +#define strtoull grub_strtoull > + > #endif > diff --git a/grub-core/lib/posix_wrap/sys/types.h b/grub-core/lib/posix_wrap/sys/types.h > index 854eb0122efa..f63412c8da06 100644 > --- a/grub-core/lib/posix_wrap/sys/types.h > +++ b/grub-core/lib/posix_wrap/sys/types.h > @@ -51,6 +51,7 @@ typedef grub_uint8_t byte; > typedef grub_addr_t uintptr_t; > > #define SIZEOF_UNSIGNED_LONG GRUB_CPU_SIZEOF_LONG > +#define SIZEOF_UNSIGNED_LONG_INT GRUB_CPU_SIZEOF_LONG > #define SIZEOF_UNSIGNED_INT 4 > #define SIZEOF_UNSIGNED_LONG_LONG 8 > #define SIZEOF_UNSIGNED_SHORT 2