From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) by sourceware.org (Postfix) with ESMTPS id 835393858005 for ; Mon, 17 Oct 2022 16:04:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 835393858005 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oi1-x229.google.com with SMTP id j188so12606006oih.4 for ; Mon, 17 Oct 2022 09:04:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=cv3G5Jg7ail6yThHh70jxO8cw/dno8GJbQ5Uci8haxs=; b=JvlH1rm+XaTaZz1uWIktYLU7lSA81IfcFVWpyjHN2vnmDsYTfuh3GowhauyKDp29UD GHrgxdWDOBC8KZQGJOe/ecO9emuiqs8qht9DyhQDCtGSGmIM1y0aF8aMVp4WVRCvH4jU LGGfBkgCcTrGljYz0XV7q9D1PmXyac3QLUm784yDFqepGYWuyJ3lZdommmVNzsXQWfHa g2Y/KsNDKeCf0h44orxaH/tYjif/zsvBRnsEP+1v7pPqb2IM0THJI/TUgqwqVILfWjMx nJQ35hQdOBygziWisZKGSrJqNARiVkzitbNcV6L1WyFlcHa/HChQCNTgPI5Zz+YzE6BY AmRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cv3G5Jg7ail6yThHh70jxO8cw/dno8GJbQ5Uci8haxs=; b=yLjWWb6HA+Q5X1v408fDaDI1npdeQvvofkCprDaq7wcRAAPwxqU96MDXhMANC2+X5j cburIzjOSIWP7iOaiUAi4sAcHJOr9f4GYNrmp9b9uXDfAVlLYeYmlszYHI9BUiKUYa/q N2p87TJ7LqJDSuRLyixg4KIEggFTzxk3kKHSQVe3/RS0tJtWG9X++uwRfv9d8E8K6vBf enDCay2RUFwykMmLLI4D0Oo629TZEu2bHJDWkqh7Togqfy7ZmNBO46mRAOEf2+sd0RGv ReAyVeU9ZJ7El8Gxg4qxuUN+zf+lmFknJrod6LSQVxOTj1dIl9wXYVE6gK7IylDyXMAY BjVQ== X-Gm-Message-State: ACrzQf1I9M0mXIsrSJBFbCK2trTJOHEMFQcNQmU9EKprkc6+jsu46pKC g9L9+sMneL/o2evu9+Y55yuyxgLYXm8+b/eQ X-Google-Smtp-Source: AMsMyM6nv2RFh4LuoieMgPqacRbcVJAmFMTwK+e2o9FuIxEsHneOyjk1qkBRC12lUOmOsWMubMGGKw== X-Received: by 2002:a05:6808:19a7:b0:355:37ea:33c5 with SMTP id bj39-20020a05680819a700b0035537ea33c5mr2813603oib.275.1666022638047; Mon, 17 Oct 2022 09:03:58 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c3:7d19:8109:7787:4db:e22e? ([2804:1b3:a7c3:7d19:8109:7787:4db:e22e]) by smtp.gmail.com with ESMTPSA id 52-20020a9d0bb7000000b006619f38a686sm4907762oth.56.2022.10.17.09.03.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Oct 2022 09:03:57 -0700 (PDT) Message-ID: <60a02a88-9f0c-3de4-cf8a-6f8dbc12075a@linaro.org> Date: Mon, 17 Oct 2022 13:03:55 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH 1/3] x86-64: Move LP_SIZE definition to its own header Content-Language: en-US To: libc-alpha@sourceware.org, Florian Weimer References: <350d9d552bc44b1df01e567135ff9eed4569164f.1665663395.git.fweimer@redhat.com> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <350d9d552bc44b1df01e567135ff9eed4569164f.1665663395.git.fweimer@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 13/10/22 09:20, Florian Weimer via Libc-alpha wrote: > This way, we can define the pointer guard macros without including > on x86-64. Other architectures will not have such an > inclusion dependency, and the implied header file inclusion would > create a porting hazard. LGTM with a minor nit below. Reviewed-by: Adhemerval Zanella > --- > sysdeps/x86_64/sysdep.h | 7 +------ > sysdeps/x86_64/x32/sysdep.h | 6 +----- > sysdeps/x86_64/x32/x86-lp_size.h | 23 +++++++++++++++++++++++ > sysdeps/x86_64/x86-lp_size.h | 23 +++++++++++++++++++++++ > 4 files changed, 48 insertions(+), 11 deletions(-) > create mode 100644 sysdeps/x86_64/x32/x86-lp_size.h > create mode 100644 sysdeps/x86_64/x86-lp_size.h > > diff --git a/sysdeps/x86_64/sysdep.h b/sysdeps/x86_64/sysdep.h > index 7f5defa4ec..d1a43dc14c 100644 > --- a/sysdeps/x86_64/sysdep.h > +++ b/sysdeps/x86_64/sysdep.h > @@ -20,6 +20,7 @@ > #define _X86_64_SYSDEP_H 1 > > #include > +#include > > #ifdef __ASSEMBLER__ > > @@ -68,9 +69,6 @@ lose: \ > # define JUMPTARGET(name) name > #endif > > -/* Long and pointer size in bytes. */ > -#define LP_SIZE 8 > - > /* Instruction to operate on long and pointer. */ > #define LP_OP(insn) insn##q > > @@ -137,9 +135,6 @@ lose: \ > > #else /* __ASSEMBLER__ */ > > -/* Long and pointer size in bytes. */ > -#define LP_SIZE "8" > - > /* Instruction to operate on long and pointer. */ > #define LP_OP(insn) #insn "q" > > diff --git a/sysdeps/x86_64/x32/sysdep.h b/sysdeps/x86_64/x32/sysdep.h > index 645ea4ae69..92d987780d 100644 > --- a/sysdeps/x86_64/x32/sysdep.h > +++ b/sysdeps/x86_64/x32/sysdep.h > @@ -17,8 +17,8 @@ > . */ > > #include > +#include > > -#undef LP_SIZE > #undef LP_OP > #undef ASM_ADDR > > @@ -41,8 +41,6 @@ > > #ifdef __ASSEMBLER__ > > -# define LP_SIZE 4 > - > # define LP_OP(insn) insn##l > > # define ASM_ADDR .long > @@ -66,8 +64,6 @@ > > #else /* __ASSEMBLER__ */ > > -# define LP_SIZE "4" > - > # define LP_OP(insn) #insn "l" > > # define ASM_ADDR ".long" > diff --git a/sysdeps/x86_64/x32/x86-lp_size.h b/sysdeps/x86_64/x32/x86-lp_size.h > new file mode 100644 > index 0000000000..ad03eb66b2 > --- /dev/null > +++ b/sysdeps/x86_64/x32/x86-lp_size.h > @@ -0,0 +1,23 @@ > +/* Pointer size definition for x86-64 x42. s/42/32 > + Copyright (C) 2022 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library; if not, see > + . */ > + > +#ifdef __ASSEMBLER__ > +# define LP_SIZE 4 > +#else > +# define LP_SIZE "4" > +#endif > diff --git a/sysdeps/x86_64/x86-lp_size.h b/sysdeps/x86_64/x86-lp_size.h > new file mode 100644 > index 0000000000..76877240e8 > --- /dev/null > +++ b/sysdeps/x86_64/x86-lp_size.h > @@ -0,0 +1,23 @@ > +/* Pointer size definition for x86-64. > + Copyright (C) 2022 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library; if not, see > + . */ > + > +#ifdef __ASSEMBLER__ > +# define LP_SIZE 8 > +#else > +# define LP_SIZE "8" > +#endif