From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2178) id BBFAD3858D32; Tue, 18 Oct 2022 15:36:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BBFAD3858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666107387; bh=8ibLCe/2CXyMBmGkYSk5kt43J6zE/49UeTeNtjTZtfc=; h=From:To:Subject:Date:From; b=pY/3EzyNzsyZQneihpT+B1VnfV134RCYb9hbWyEQgf/OkXXfZyZwEt31sQ5OVMdXO Y58xUVzaJRXIqdxBUq1EBYlyXuV5cFNiMgInyu/S6lb6iIIOu6w06+36ssfqC3LlDK xT3mD2vfs0xhJ8MlujQ97U+gjiBCC3USyZ1HgozE= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc] x86-64: Move LP_SIZE definition to its own header X-Act-Checkin: glibc X-Git-Author: Florian Weimer X-Git-Refname: refs/heads/master X-Git-Oldrev: 7363a9a9a097c455a7ddb9386b4c6f7bdf91065f X-Git-Newrev: 246f37d6b1c4c6c0a6365df8783e62e3adf208e8 Message-Id: <20221018153627.BBFAD3858D32@sourceware.org> Date: Tue, 18 Oct 2022 15:36:26 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=246f37d6b1c4c6c0a6365df8783e62e3adf208e8 commit 246f37d6b1c4c6c0a6365df8783e62e3adf208e8 Author: Florian Weimer Date: Tue Oct 18 17:00:07 2022 +0200 x86-64: Move LP_SIZE definition to its own header 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. Reviewed-by: Adhemerval Zanella Diff: --- 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(-) 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..0b71e58be5 --- /dev/null +++ b/sysdeps/x86_64/x32/x86-lp_size.h @@ -0,0 +1,23 @@ +/* Pointer size definition for x86-64 x32. + 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