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/powerpc/powerpc32/sysdep.h | 1 + sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h | 1 + sysdeps/unix/sysv/linux/powerpc/sched_getcpu.c | 29 ---------------------- 3 files changed, 2 insertions(+), 29 deletions(-) delete mode 100644 sysdeps/unix/sysv/linux/powerpc/sched_getcpu.c (limited to 'sysdeps/unix/sysv/linux/powerpc') diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h index cbce324159..dc56bea49a 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h @@ -165,6 +165,7 @@ /* List of system calls which are supported as vsyscalls. */ # define HAVE_CLOCK_GETRES_VSYSCALL 1 # define HAVE_CLOCK_GETTIME_VSYSCALL 1 +# define HAVE_GETCPU_VSYSCALL 1 # define LOADARGS_0(name, dummy) \ diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h index a727f38ee5..e2014cca39 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h @@ -80,6 +80,7 @@ /* List of system calls which are supported as vsyscalls. */ #define HAVE_CLOCK_GETRES_VSYSCALL 1 #define HAVE_CLOCK_GETTIME_VSYSCALL 1 +#define HAVE_GETCPU_VSYSCALL 1 /* Define a macro which expands inline into the wrapper code for a system call. This use is for internal calls that do not need to handle errors diff --git a/sysdeps/unix/sysv/linux/powerpc/sched_getcpu.c b/sysdeps/unix/sysv/linux/powerpc/sched_getcpu.c deleted file mode 100644 index f93be0119a..0000000000 --- a/sysdeps/unix/sysv/linux/powerpc/sched_getcpu.c +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright (C) 2013-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 - . */ - -#include -#include -#include - -int -sched_getcpu (void) -{ - unsigned int cpu; - int r = INLINE_VSYSCALL (getcpu, 3, &cpu, NULL, NULL); - - return r == -1 ? r : cpu; -} -- cgit 1.4.1