From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id C0E6F38560A4 for ; Thu, 13 Oct 2022 12:20:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C0E6F38560A4 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665663639; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=taWsujilGfO2p0D+FA2xqBUe7gZVbby9IGFeumqTm0Y=; b=BOvqfQWnH5OP0SwS9ynR3IQH97aVf8CuF0v4WLuylIuWnDD1KscptVYwrsmgz+xJ2pxCoZ MRkrzHu37bO1eObVmo6+j0EPl+Q3y8wDgknwFUcFWizD8ngs/9XqzEqJ9uKYoql8ucP01p sKQiYWpE8kpFP21EmbgVnpiHbFN2Mk0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-491-UIDCGBfSPbyYEQgDJ-3dgg-1; Thu, 13 Oct 2022 08:20:38 -0400 X-MC-Unique: UIDCGBfSPbyYEQgDJ-3dgg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 034D28027EC for ; Thu, 13 Oct 2022 12:20:38 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.73]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4A27240C6F9F for ; Thu, 13 Oct 2022 12:20:37 +0000 (UTC) From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH 1/3] x86-64: Move LP_SIZE definition to its own header In-Reply-To: References: X-From-Line: 350d9d552bc44b1df01e567135ff9eed4569164f Mon Sep 17 00:00:00 2001 Message-Id: <350d9d552bc44b1df01e567135ff9eed4569164f.1665663395.git.fweimer@redhat.com> Date: Thu, 13 Oct 2022 14:20:35 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,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: 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. --- 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. + 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 -- 2.37.3