From dd26c44403582fdf10d663170f947dfe4b3207a0 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Wed, 22 Apr 2015 14:21:39 -0300 Subject: Consolidate sched_getcpu This patch consolidates the sched_getcpu implementations across all arches (except tile, which requires its own). This patch removes the powerpc, x86_64 and x32 specific files and change the default linux one to use INLINE_VSYSCALL where possible (for ports that implements it). --- sysdeps/unix/sysv/linux/x86_64/x32/Makefile | 4 -- sysdeps/unix/sysv/linux/x86_64/x32/init-first.c | 39 ----------------- .../sysv/linux/x86_64/x32/sched_getcpu-static.c | 3 -- sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu.S | 49 ---------------------- 4 files changed, 95 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/x86_64/x32/init-first.c delete mode 100644 sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu-static.c delete mode 100644 sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu.S (limited to 'sysdeps/unix/sysv/linux/x86_64/x32') diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/Makefile b/sysdeps/unix/sysv/linux/x86_64/x32/Makefile index ecbdefb2d3..8c3253bc90 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/Makefile +++ b/sysdeps/unix/sysv/linux/x86_64/x32/Makefile @@ -4,7 +4,3 @@ default-abi := x32 ifeq ($(subdir),misc) sysdep_routines += arch_prctl endif - -ifeq ($(subdir),posix) -sysdep_routines += getcpu sched_getcpu-static -endif diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/init-first.c b/sysdeps/unix/sysv/linux/x86_64/x32/init-first.c deleted file mode 100644 index 31ec80f412..0000000000 --- a/sysdeps/unix/sysv/linux/x86_64/x32/init-first.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Initialization code run first thing by the ELF startup code. Linux/x32. - Copyright (C) 2012-2015 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 SHARED -# include -# include - -long int (*__vdso_clock_gettime) (clockid_t, struct timespec *) - attribute_hidden; - -static inline void -_libc_vdso_platform_setup (void) -{ - PREPARE_VERSION (linux26, "LINUX_2.6", 61765110); - - void *p = _dl_vdso_vsym ("__vdso_clock_gettime", &linux26); - PTR_MANGLE (p); - __vdso_clock_gettime = p; -} - -# define VDSO_SETUP _libc_vdso_platform_setup -#endif - -#include diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu-static.c b/sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu-static.c deleted file mode 100644 index 38bbf9abdb..0000000000 --- a/sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu-static.c +++ /dev/null @@ -1,3 +0,0 @@ -#ifndef SHARED -#include "../../sched_getcpu.c" -#endif diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu.S b/sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu.S deleted file mode 100644 index 35ad01be01..0000000000 --- a/sysdeps/unix/sysv/linux/x86_64/x32/sched_getcpu.S +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright (C) 2012-2015 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 SHARED -#include -#include -#define _ERRNO_H 1 -#include - -ENTRY (sched_getcpu) - /* Align stack and create local variable for result. */ - sub $0x8, %esp - cfi_adjust_cfa_offset(8) - - mov %esp, %edi - xor %esi, %esi - mov $VGETCPU_CACHE_OFFSET, %edx - add %fs:0, %edx - - call __getcpu - - /* Local variable is result if the call is successful. */ - mov (%rsp), %edx - /* Restore stack pointer before we might jump to - SYSCALL_ERROR_LABEL which returns to the caller. */ - add $0x8, %esp - cfi_adjust_cfa_offset(-8) - - cmp $-4095, %eax - jae SYSCALL_ERROR_LABEL - - mov %edx, %eax - ret -PSEUDO_END(sched_getcpu) -#endif -- cgit 1.4.1