From 83b8d5027d2f80c4603cd706da95d6c9a09a4e16 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Thu, 16 Dec 2021 15:26:36 -0300 Subject: malloc: Remove memusage.h And use machine-sp.h instead. The Linux implementation is based on already provided CURRENT_STACK_FRAME (used on nptl code) and STACK_GROWS_UPWARD is replaced with _STACK_GROWS_UP. --- sysdeps/aarch64/memusage.h | 21 --------------------- sysdeps/alpha/memusage.h | 20 -------------------- sysdeps/arc/memusage.h | 21 --------------------- sysdeps/arm/memusage.h | 20 -------------------- sysdeps/csky/memusage.h | 21 --------------------- sysdeps/generic/memusage.h | 25 ------------------------- sysdeps/hppa/memusage.h | 21 --------------------- sysdeps/i386/htl/machine-sp.h | 2 +- sysdeps/i386/i586/memusage.h | 1 - sysdeps/i386/i686/memusage.h | 20 -------------------- sysdeps/i386/memusage.h | 20 -------------------- sysdeps/ia64/memusage.h | 22 ---------------------- sysdeps/m68k/memusage.h | 21 --------------------- sysdeps/mach/i386/machine-sp.h | 2 +- sysdeps/microblaze/memusage.h | 21 --------------------- sysdeps/mips/memusage.h | 20 -------------------- sysdeps/nios2/memusage.h | 21 --------------------- sysdeps/powerpc/memusage.h | 20 -------------------- sysdeps/riscv/memusage.h | 21 --------------------- sysdeps/s390/memusage.h | 20 -------------------- sysdeps/sh/memusage.h | 20 -------------------- sysdeps/sparc/memusage.h | 20 -------------------- sysdeps/unix/sysv/linux/machine-sp.h | 29 +++++++++++++++++++++++++++++ sysdeps/x86_64/memusage.h | 20 -------------------- 24 files changed, 31 insertions(+), 418 deletions(-) delete mode 100644 sysdeps/aarch64/memusage.h delete mode 100644 sysdeps/alpha/memusage.h delete mode 100644 sysdeps/arc/memusage.h delete mode 100644 sysdeps/arm/memusage.h delete mode 100644 sysdeps/csky/memusage.h delete mode 100644 sysdeps/generic/memusage.h delete mode 100644 sysdeps/hppa/memusage.h delete mode 100644 sysdeps/i386/i586/memusage.h delete mode 100644 sysdeps/i386/i686/memusage.h delete mode 100644 sysdeps/i386/memusage.h delete mode 100644 sysdeps/ia64/memusage.h delete mode 100644 sysdeps/m68k/memusage.h delete mode 100644 sysdeps/microblaze/memusage.h delete mode 100644 sysdeps/mips/memusage.h delete mode 100644 sysdeps/nios2/memusage.h delete mode 100644 sysdeps/powerpc/memusage.h delete mode 100644 sysdeps/riscv/memusage.h delete mode 100644 sysdeps/s390/memusage.h delete mode 100644 sysdeps/sh/memusage.h delete mode 100644 sysdeps/sparc/memusage.h create mode 100644 sysdeps/unix/sysv/linux/machine-sp.h delete mode 100644 sysdeps/x86_64/memusage.h (limited to 'sysdeps') diff --git a/sysdeps/aarch64/memusage.h b/sysdeps/aarch64/memusage.h deleted file mode 100644 index d29f7c7f89..0000000000 --- a/sysdeps/aarch64/memusage.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright (C) 2000-2021 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 - . */ - -#define GETSP() ({ register uintptr_t stack_ptr asm ("sp"); stack_ptr; }) - -#include diff --git a/sysdeps/alpha/memusage.h b/sysdeps/alpha/memusage.h deleted file mode 100644 index bbd28302e4..0000000000 --- a/sysdeps/alpha/memusage.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2000-2021 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 - . */ - -#define GETSP() ({ register uintptr_t stack_ptr asm ("$30"); stack_ptr; }) - -#include diff --git a/sysdeps/arc/memusage.h b/sysdeps/arc/memusage.h deleted file mode 100644 index e8a508a8ff..0000000000 --- a/sysdeps/arc/memusage.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Machine-specific definitions for memory usage profiling, ARC version. - Copyright (C) 2020-2021 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 - . */ - -#define GETSP() ({ register uintptr_t stack_ptr asm ("sp"); stack_ptr; }) - -#include diff --git a/sysdeps/arm/memusage.h b/sysdeps/arm/memusage.h deleted file mode 100644 index 2ec8de22a5..0000000000 --- a/sysdeps/arm/memusage.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2000-2021 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 - . */ - -#define GETSP() ({ register uintptr_t stack_ptr asm ("sp"); stack_ptr; }) - -#include diff --git a/sysdeps/csky/memusage.h b/sysdeps/csky/memusage.h deleted file mode 100644 index 392682e12b..0000000000 --- a/sysdeps/csky/memusage.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Machine-specific definitions for memory usage profiling, C-SKY version. - Copyright (C) 2018-2021 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 - . */ - -#define GETSP() ({ register uintptr_t stack_ptr asm ("sp"); stack_ptr; }) - -#include diff --git a/sysdeps/generic/memusage.h b/sysdeps/generic/memusage.h deleted file mode 100644 index 514bd058d2..0000000000 --- a/sysdeps/generic/memusage.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (C) 2000-2021 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 - . */ - - -#include -#include - -#ifndef GETSP -# warning "GETSP is not defined for this architecture." -# define GETSP 0 -#endif diff --git a/sysdeps/hppa/memusage.h b/sysdeps/hppa/memusage.h deleted file mode 100644 index 25e8b94b3f..0000000000 --- a/sysdeps/hppa/memusage.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright (C) 2000-2021 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 - . */ - -#define GETSP() ({ register uintptr_t stack_ptr asm ("%r30"); stack_ptr; }) -#define STACK_GROWS_UPWARD 1 - -#include diff --git a/sysdeps/i386/htl/machine-sp.h b/sysdeps/i386/htl/machine-sp.h index 6b64dea385..812223d783 100644 --- a/sysdeps/i386/htl/machine-sp.h +++ b/sysdeps/i386/htl/machine-sp.h @@ -22,7 +22,7 @@ /* Return the current stack pointer. */ #define __thread_stack_pointer() ({ \ - register void *__sp__ asm("esp"); \ + register uintptr_t __sp__ asm("esp"); \ __sp__; \ }) diff --git a/sysdeps/i386/i586/memusage.h b/sysdeps/i386/i586/memusage.h deleted file mode 100644 index c8170874d0..0000000000 --- a/sysdeps/i386/i586/memusage.h +++ /dev/null @@ -1 +0,0 @@ -#include "../i686/memusage.h" diff --git a/sysdeps/i386/i686/memusage.h b/sysdeps/i386/i686/memusage.h deleted file mode 100644 index 07b241263c..0000000000 --- a/sysdeps/i386/i686/memusage.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2000-2021 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 - . */ - -#define GETSP() ({ register uintptr_t stack_ptr asm ("esp"); stack_ptr; }) - -#include diff --git a/sysdeps/i386/memusage.h b/sysdeps/i386/memusage.h deleted file mode 100644 index 07b241263c..0000000000 --- a/sysdeps/i386/memusage.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2000-2021 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 - . */ - -#define GETSP() ({ register uintptr_t stack_ptr asm ("esp"); stack_ptr; }) - -#include diff --git a/sysdeps/ia64/memusage.h b/sysdeps/ia64/memusage.h deleted file mode 100644 index 33fd6ec899..0000000000 --- a/sysdeps/ia64/memusage.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (C) 2000-2021 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 - . */ - -#include - -#define GETSP() ({ register uintptr_t stack_ptr asm ("%r12"); stack_ptr; }) - -#include diff --git a/sysdeps/m68k/memusage.h b/sysdeps/m68k/memusage.h deleted file mode 100644 index c22d312aed..0000000000 --- a/sysdeps/m68k/memusage.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright (C) 2000-2021 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 - . */ - - -#define GETSP() ({ register uintptr_t stack_ptr asm ("%sp"); stack_ptr; }) - -#include diff --git a/sysdeps/mach/i386/machine-sp.h b/sysdeps/mach/i386/machine-sp.h index 280f3b7a4d..54b2a16c01 100644 --- a/sysdeps/mach/i386/machine-sp.h +++ b/sysdeps/mach/i386/machine-sp.h @@ -22,7 +22,7 @@ /* Return the current stack pointer. */ #define __thread_stack_pointer() ({ \ - void *__sp__; \ + uintptr_t __sp__; \ __asm__ ("movl %%esp, %0" : "=r" (__sp__)); \ __sp__; \ }) diff --git a/sysdeps/microblaze/memusage.h b/sysdeps/microblaze/memusage.h deleted file mode 100644 index 516c0b4609..0000000000 --- a/sysdeps/microblaze/memusage.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright (C) 2000-2021 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 - . */ - -#define GETSP() ({ register uintptr_t stack_ptr asm ("r1"); stack_ptr; }) - -#include diff --git a/sysdeps/mips/memusage.h b/sysdeps/mips/memusage.h deleted file mode 100644 index 64c558c81d..0000000000 --- a/sysdeps/mips/memusage.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2000-2021 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 - . */ - -#define GETSP() ({ register uintptr_t stack_ptr asm ("$29"); stack_ptr; }) - -#include diff --git a/sysdeps/nios2/memusage.h b/sysdeps/nios2/memusage.h deleted file mode 100644 index 6f1c78812d..0000000000 --- a/sysdeps/nios2/memusage.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Machine-specific definitions for memory usage profiling, Nios II version. - Copyright (C) 2000-2021 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 - . */ - -#define GETSP() ({ register uintptr_t stack_ptr asm ("%sp"); stack_ptr; }) - -#include diff --git a/sysdeps/powerpc/memusage.h b/sysdeps/powerpc/memusage.h deleted file mode 100644 index ab21f46258..0000000000 --- a/sysdeps/powerpc/memusage.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2000-2021 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 - . */ - -#define GETSP() ({ register uintptr_t stack_ptr asm ("%r1"); stack_ptr; }) - -#include diff --git a/sysdeps/riscv/memusage.h b/sysdeps/riscv/memusage.h deleted file mode 100644 index b7b45791b9..0000000000 --- a/sysdeps/riscv/memusage.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Machine-specific definitions for memory usage profiling, RISC-V version. - Copyright (C) 2000-2021 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 - . */ - -#define GETSP() ({ register uintptr_t stack_ptr asm ("sp"); stack_ptr; }) - -#include diff --git a/sysdeps/s390/memusage.h b/sysdeps/s390/memusage.h deleted file mode 100644 index 6219d79664..0000000000 --- a/sysdeps/s390/memusage.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2000-2021 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 - . */ - -#define GETSP() ({ register uintptr_t stack_ptr __asm__ ("15"); stack_ptr; }) - -#include diff --git a/sysdeps/sh/memusage.h b/sysdeps/sh/memusage.h deleted file mode 100644 index 87c3d40fdf..0000000000 --- a/sysdeps/sh/memusage.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2000-2021 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 - . */ - -#define GETSP() ({ register uintptr_t stack_ptr asm ("r15"); stack_ptr; }) - -#include diff --git a/sysdeps/sparc/memusage.h b/sysdeps/sparc/memusage.h deleted file mode 100644 index 13741e2577..0000000000 --- a/sysdeps/sparc/memusage.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2000-2021 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 - . */ - -#define GETSP() ({ register uintptr_t stack_ptr asm ("%sp"); stack_ptr; }) - -#include diff --git a/sysdeps/unix/sysv/linux/machine-sp.h b/sysdeps/unix/sysv/linux/machine-sp.h new file mode 100644 index 0000000000..257d09e60d --- /dev/null +++ b/sysdeps/unix/sysv/linux/machine-sp.h @@ -0,0 +1,29 @@ +/* Machine-specific function to return the stack pointer. Linux version. + Copyright (C) 2021 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 + . */ + +#ifndef _MACHINE_SP_H +#define _MACHINE_SP_H + +/* Return the current stack pointer. */ +static inline uintptr_t +__thread_stack_pointer (void) +{ + return (uintptr_t) CURRENT_STACK_FRAME; +} + +#endif /* machine-sp.h */ diff --git a/sysdeps/x86_64/memusage.h b/sysdeps/x86_64/memusage.h deleted file mode 100644 index 6652fc5da1..0000000000 --- a/sysdeps/x86_64/memusage.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2001-2021 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 - . */ - -#define GETSP() ({ register uintptr_t stack_ptr asm ("rsp"); stack_ptr; }) - -#include -- cgit 1.4.1