From patchwork Mon Apr 20 16:48:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 47366 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f200.google.com (mail-lb0-f200.google.com [209.85.217.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8F27420553 for ; Mon, 20 Apr 2015 16:48:44 +0000 (UTC) Received: by lbdc7 with SMTP id c7sf38843217lbd.2 for ; Mon, 20 Apr 2015 09:48:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-subscribe:list-archive:list-post:list-help :sender:delivered-to:message-id:date:from:user-agent:mime-version:to :subject:content-type:content-transfer-encoding:x-original-sender :x-original-authentication-results; bh=clRCjz9PG4t+ANMGxqpt/KCEcpVmtD3hZNFRZn5+k/k=; b=Td1jxbuA/i8XA3Hf4K10I4QMt8mlYF6MHrIoNh77CbxNEFj5Bg5zEIRZVSvWBt6Iuz eeUh5VGzLRtzIKXZKwDlYw99xmm5DLS4hI6xjM3RObDdxlmq8KkuvMyZLsEr+sVbJE43 L9lxnhd7Ggf6iVTpANOWt0vH/28h+pm5w2kBlDqqjYqD4Z7ZCPQ3ZF8uaqMj98QpYpwx TyK4RCwg2pyCz0bTp4ALuTjlgYfcudQWyQofdMscMFilXl13gUcWNRbXwpCPcacQSS1q touTqFOCwj+1PLbR32O1jDxgPLc+IVZc6F/+9gmgiwyvsN1jGBN1fjQd2ADcLf9D/MwS S1dw== X-Gm-Message-State: ALoCoQkYIbFw9eFkhiAH1lWonk7nSzSgZYVmVA5W8k23YAhUEdVyHFxMbbfKpZJlKe2WOh5xlEKh X-Received: by 10.194.249.1 with SMTP id yq1mr3541331wjc.2.1429548523544; Mon, 20 Apr 2015 09:48:43 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.2.9 with SMTP id 9ls936719laq.89.gmail; Mon, 20 Apr 2015 09:48:43 -0700 (PDT) X-Received: by 10.152.36.40 with SMTP id n8mr1072720laj.121.1429548523382; Mon, 20 Apr 2015 09:48:43 -0700 (PDT) Received: from mail-lb0-x22f.google.com (mail-lb0-x22f.google.com. [2a00:1450:4010:c04::22f]) by mx.google.com with ESMTPS id lb6si1985838lab.70.2015.04.20.09.48.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Apr 2015 09:48:42 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22f as permitted sender) client-ip=2a00:1450:4010:c04::22f; Received: by lbbqq2 with SMTP id qq2so135251325lbb.3 for ; Mon, 20 Apr 2015 09:48:42 -0700 (PDT) X-Received: by 10.112.184.70 with SMTP id es6mr16138276lbc.117.1429548522717; Mon, 20 Apr 2015 09:48:42 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.67.65 with SMTP id l1csp131893lbt; Mon, 20 Apr 2015 09:48:41 -0700 (PDT) X-Received: by 10.68.231.66 with SMTP id te2mr29806886pbc.118.1429548520909; Mon, 20 Apr 2015 09:48:40 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id ny9si28984466pab.202.2015.04.20.09.48.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Apr 2015 09:48:40 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-58507-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 7278 invoked by alias); 20 Apr 2015 16:48:14 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list List-Id: List-Unsubscribe: , List-Subscribe: List-Archive: List-Post: , List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 7193 invoked by uid 89); 20 Apr 2015 16:48:13 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qc0-f169.google.com X-Received: by 10.55.18.139 with SMTP id 11mr30066850qks.5.1429548486610; Mon, 20 Apr 2015 09:48:06 -0700 (PDT) Message-ID: <55352DC3.40900@linaro.org> Date: Mon, 20 Apr 2015 13:48:03 -0300 From: Adhemerval Zanella User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: libc-alpha@sourceware.org Subject: [PATCH 3/3] x86: clock_gettime and timespec_get vDSO cleanup X-Original-Sender: adhemerval.zanella@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c04::22f as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org X-Google-Group-Id: 836684582541 This patch removes the x86 specific timespec_get and clock_gettime implementation to use generic HAVE_CLOCK_GETTIME_VSYSCALL way.] --- * sysdeps/unix/sysv/linux/i386/sysdep.h (HAVE_CLOCK_GETTIME_VSYSCALL): Define. (HAVE_GETTIMEOFDAY_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/x86_64/sysdep.h (HAVE_CLOCK_GETTIME_VSYSCALL): Likewise. (HAVE_GETTIMEOFDAY_VSYSCALL): Likewise. * sysdeps/unix/sysv/linux/timespec_get.c: Include errno.h. * sysdeps/unix/sysv/linux/x86/clock_gettime.c: Remove file. * sysdeps/unix/sysv/linux/x86/timespec_get.c: Likewise. --- diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h index 7f6fcf3..d76aca5 100644 --- a/sysdeps/unix/sysv/linux/i386/sysdep.h +++ b/sysdeps/unix/sysv/linux/i386/sysdep.h @@ -328,6 +328,10 @@ struct libc_do_syscall_args } \ (int) resultvar; }) +/* List of system calls which are supported as vsyscalls. */ +# define HAVE_CLOCK_GETTIME_VSYSCALL 1 +# define HAVE_GETTIMEOFDAY_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 normally. It will never touch errno. This returns just what the kernel diff --git a/sysdeps/unix/sysv/linux/timespec_get.c b/sysdeps/unix/sysv/linux/timespec_get.c index 0e5f513..b42a44f 100644 --- a/sysdeps/unix/sysv/linux/timespec_get.c +++ b/sysdeps/unix/sysv/linux/timespec_get.c @@ -17,6 +17,7 @@ #include #include +#include #ifdef HAVE_CLOCK_GETTIME_VSYSCALL # define HAVE_VSYSCALL diff --git a/sysdeps/unix/sysv/linux/x86/clock_gettime.c b/sysdeps/unix/sysv/linux/x86/clock_gettime.c deleted file mode 100644 index 98ffb01..0000000 --- a/sysdeps/unix/sysv/linux/x86/clock_gettime.c +++ /dev/null @@ -1,34 +0,0 @@ -/* Get the current value of a clock. Linux/x86 version. - Copyright (C) 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 - -#ifdef SHARED -# define SYSCALL_GETTIME(id, tp) \ - ({ long int (*f) (clockid_t, struct timespec *) = __vdso_clock_gettime; \ - long int v_ret; \ - PTR_DEMANGLE (f); \ - v_ret = (*f) (id, tp); \ - if (INTERNAL_SYSCALL_ERROR_P (v_ret, )) { \ - __set_errno (INTERNAL_SYSCALL_ERRNO (v_ret, )); \ - v_ret = -1; \ - } \ - v_ret; }) -#endif - -#include diff --git a/sysdeps/unix/sysv/linux/x86/timespec_get.c b/sysdeps/unix/sysv/linux/x86/timespec_get.c deleted file mode 100644 index b21efce..0000000 --- a/sysdeps/unix/sysv/linux/x86/timespec_get.c +++ /dev/null @@ -1,29 +0,0 @@ -/* timespec_get -- returns the calendar time based on a given time base. - Linux/x86 version. - Copyright (C) 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 - -#ifdef SHARED -# define INTERNAL_GETTIME(id, tp) \ - ({ long int (*f) (clockid_t, struct timespec *) = __vdso_clock_gettime; \ - PTR_DEMANGLE (f); \ - (*f) (id, tp); }) -#endif - -#include diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h index cc66093..bea3192 100644 --- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h +++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h @@ -252,6 +252,10 @@ # undef INTERNAL_SYSCALL_ERRNO # define INTERNAL_SYSCALL_ERRNO(val, err) (-(val)) +/* List of system calls which are supported as vsyscalls. */ +# define HAVE_CLOCK_GETTIME_VSYSCALL 1 +# define HAVE_GETTIMEOFDAY_VSYSCALL 1 + # define LOAD_ARGS_0() # define LOAD_REGS_0 # define ASM_ARGS_0