From patchwork Wed Apr 15 20:21:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 47235 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A4AD72121F for ; Wed, 15 Apr 2015 20:23:01 +0000 (UTC) Received: by layy10 with SMTP id y10sf12688850lay.0 for ; Wed, 15 Apr 2015 13:23:00 -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=ExA1y9rC3FozS13DET0UElhVZ8LpKlLCdYKMmfPJbaA=; b=MaVFwua20BzPHC2OspVp8vRGs+qwdwrgrhsLcKvJ745RTm03wricCDIbmhkEnpVJ0o CwoYuWg1u33CvjIEK0YldVJcQfJApRD+3hfAprrpVJZRux21MmzVH0amk16arCIxDsXA Rj7Cefo0DAG0RclNTAxPhoU7FYnmofg3G0whCddLMNwG6aSb1oW1PD1ExNO/IJFmbJ2H BD2EJOnC8Bug3FPZBFjmkEZW7aEEr7qU9EdiE1YobV3BK5m+3M7CqUnR7XVUURgArALJ QsiQjE5I4pqaXS3gBnjilL01uqXwOuVMPMPmbNe2JKfjKEmeaDtqBI6eyfvqWrusaaYM L3KQ== X-Gm-Message-State: ALoCoQmKFoImxGMYYiwsi7crx0H7gMWdQDjw3PHig4E5Jc803b5ObogmNyOCA0luAcbobkhGdykU X-Received: by 10.112.162.228 with SMTP id yd4mr1718193lbb.8.1429129380348; Wed, 15 Apr 2015 13:23:00 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.227 with SMTP id t3ls244172laj.72.gmail; Wed, 15 Apr 2015 13:23:00 -0700 (PDT) X-Received: by 10.112.204.6 with SMTP id ku6mr25163094lbc.73.1429129380129; Wed, 15 Apr 2015 13:23:00 -0700 (PDT) Received: from mail-la0-x235.google.com (mail-la0-x235.google.com. [2a00:1450:4010:c03::235]) by mx.google.com with ESMTPS id i6si4763578lai.30.2015.04.15.13.23.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Apr 2015 13:23:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::235 as permitted sender) client-ip=2a00:1450:4010:c03::235; Received: by laat2 with SMTP id t2so41608485laa.1 for ; Wed, 15 Apr 2015 13:23:00 -0700 (PDT) X-Received: by 10.112.199.133 with SMTP id jk5mr26172873lbc.32.1429129380024; Wed, 15 Apr 2015 13:23:00 -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 l1csp2734892lbt; Wed, 15 Apr 2015 13:22:58 -0700 (PDT) X-Received: by 10.68.170.133 with SMTP id am5mr49464069pbc.42.1429129377945; Wed, 15 Apr 2015 13:22:57 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id du9si8652470pdb.80.2015.04.15.13.22.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Apr 2015 13:22:57 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-return-58459-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 59108 invoked by alias); 15 Apr 2015 20:22:35 -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 59051 invoked by uid 89); 15 Apr 2015 20:22:34 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qk0-f169.google.com X-Received: by 10.140.94.104 with SMTP id f95mr33191145qge.38.1429129315981; Wed, 15 Apr 2015 13:21:55 -0700 (PDT) Message-ID: <552EC85F.6080506@linaro.org> Date: Wed, 15 Apr 2015 17:21:51 -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 2/4] Consolidate gettimeofday across aarch64/s390/tile 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:c03::235 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 architecture specific gettimeofday implementation to use the vDSO symbol and consolidate it on a common Linux one. Similat to gettime and getres vDSO implementation, each arch that supports gettimeofday through vDSO should just implement INLINE_VSYSCALL to access the symbol and define HAVE_GETTIMEOFDAY_VSYSCAL as 1. --- * sysdeps/unix/sysv/linux/aarch64/gettimeofday.c: Remove file. * sysdeps/unix/sysv/linux/s390/gettimeofday.c: Likewise. * sysdeps/unix/sysv/linux/tile/gettimeofday.c: Likewise. * sysdeps/unix/sysv/linux/aarch64/sysdep.h [HAVE_GETTIMEOFDAY_VSYSCAL]: Define. * sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h [HAVE_GETTIMEOFDAY_VSYSCAL]: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h [HAVE_GETTIMEOFDAY_VSYSCAL]: Likewise. * sysdeps/unix/sysv/linux/tile/sysdep.h [HAVE_GETTIMEOFDAY_VSYSCAL]: Likewise. * sysdeps/unix/sysv/linux/gettimeofday.c: New file: gettimeofday using vDSO syscall macro. --- diff --git a/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c b/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c deleted file mode 100644 index 950666f..0000000 --- a/sysdeps/unix/sysv/linux/aarch64/gettimeofday.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 2005-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 - -#undef __gettimeofday - -#include - -/* Get the current time of day and timezone information, - putting it into *tv and *tz. If tz is null, *tz is not filled. - Returns 0 on success, -1 on errors. */ -int -__gettimeofday (tv, tz) - struct timeval *tv; - struct timezone *tz; -{ - return INLINE_VSYSCALL (gettimeofday, 2, tv, tz); -} -libc_hidden_def (__gettimeofday) -weak_alias (__gettimeofday, gettimeofday) -libc_hidden_weak (gettimeofday) diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep.h b/sysdeps/unix/sysv/linux/aarch64/sysdep.h index 91e03fc..58884cd 100644 --- a/sysdeps/unix/sysv/linux/aarch64/sysdep.h +++ b/sysdeps/unix/sysv/linux/aarch64/sysdep.h @@ -208,6 +208,7 @@ /* List of system calls which are supported as vsyscalls. */ # define HAVE_CLOCK_GETRES_VSYSCALL 1 # define HAVE_CLOCK_GETTIME_VSYSCALL 1 +# define HAVE_GETTIMEOFDAY_VSYSCAL 1 # define INTERNAL_VSYSCALL_NCS(funcptr, err, nr, args...) \ ({ \ diff --git a/sysdeps/unix/sysv/linux/gettimeofday.c b/sysdeps/unix/sysv/linux/gettimeofday.c new file mode 100644 index 0000000..5eaafc0 --- /dev/null +++ b/sysdeps/unix/sysv/linux/gettimeofday.c @@ -0,0 +1,35 @@ +/* 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 +#include +#if HAVE_GETTIMEOFDAY_VSYSCAL +# include +#endif + +/* Get the current time of day and timezone information, + putting it into *tv and *tz. If tz is null, *tz is not filled. + Returns 0 on success, -1 on errors. */ +int +__gettimeofday (struct timeval *tv, struct timezone *tz) +{ + return INLINE_VSYSCALL (gettimeofday, 2, tv, tz); +} +libc_hidden_def (__gettimeofday) +weak_alias (__gettimeofday, gettimeofday) +libc_hidden_weak (gettimeofday) diff --git a/sysdeps/unix/sysv/linux/s390/gettimeofday.c b/sysdeps/unix/sysv/linux/s390/gettimeofday.c deleted file mode 100644 index 68acca4..0000000 --- a/sysdeps/unix/sysv/linux/s390/gettimeofday.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (C) 2008-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 -#include -#include - -#include - -/* Get the current time of day and timezone information, - putting it into *TV and *TZ. If TZ is NULL, *TZ is not filled. - Returns 0 on success, -1 on errors. */ - -int -__gettimeofday (tv, tz) - struct timeval *tv; - struct timezone *tz; -{ - return INLINE_VSYSCALL (gettimeofday, 2, tv, tz); -} -libc_hidden_def (__gettimeofday) -weak_alias (__gettimeofday, gettimeofday) -libc_hidden_weak (gettimeofday) diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h index 9c194b8..072c00e 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h +++ b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h @@ -281,6 +281,7 @@ /* List of system calls which are supported as vsyscalls. */ #define HAVE_CLOCK_GETRES_VSYSCALL 1 #define HAVE_CLOCK_GETTIME_VSYSCALL 1 +#define HAVE_GETTIMEOFDAY_VSYSCAL 1 /* This version is for kernels that implement system calls that behave like function calls as far as register saving. diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h index 4631cb1..a5cc17d 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h +++ b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h @@ -287,6 +287,7 @@ /* List of system calls which are supported as vsyscalls. */ #define HAVE_CLOCK_GETRES_VSYSCALL 1 #define HAVE_CLOCK_GETTIME_VSYSCALL 1 +#define HAVE_GETTIMEOFDAY_VSYSCAL 1 /* This version is for kernels that implement system calls that behave like function calls as far as register saving. diff --git a/sysdeps/unix/sysv/linux/tile/gettimeofday.c b/sysdeps/unix/sysv/linux/tile/gettimeofday.c deleted file mode 100644 index 05c6298..0000000 --- a/sysdeps/unix/sysv/linux/tile/gettimeofday.c +++ /dev/null @@ -1,32 +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 - . */ - -#include -#include -#include -#include -#include - -int -__gettimeofday (struct timeval *tv, struct timezone *tz) -{ - return INLINE_VSYSCALL (gettimeofday, 2, tv, tz); -} - -libc_hidden_def (__gettimeofday) -weak_alias (__gettimeofday, gettimeofday) -libc_hidden_weak (gettimeofday) diff --git a/sysdeps/unix/sysv/linux/tile/sysdep.h b/sysdeps/unix/sysv/linux/tile/sysdep.h index 64c8920..c4a291e 100644 --- a/sysdeps/unix/sysv/linux/tile/sysdep.h +++ b/sysdeps/unix/sysv/linux/tile/sysdep.h @@ -266,6 +266,7 @@ /* List of system calls which are supported as vsyscalls. */ #define HAVE_CLOCK_GETTIME_VSYSCALL 1 +#define HAVE_GETTIMEOFDAY_VSYSCAL 1 /* Pointer mangling support. */ #if IS_IN (rtld)