From patchwork Mon Jun 1 11:48:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 49298 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 64E5F218FC for ; Mon, 1 Jun 2015 11:49:00 +0000 (UTC) Received: by lbcak1 with SMTP id ak1sf33867652lbc.2 for ; Mon, 01 Jun 2015 04:48:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=GWQipT+6+sM33IXMUY6DEELjar+s4v7pNha7H9aqvUM=; b=lMSP1N3ql6Ps97E0gTG2hD1EkYlTccvXXWo7+wYE/vBcZLNE8LLDyQFgJRPdEXfwoO Hk6BaFX2NdGEh/c+4G9BoQwwzLSpwUxP9ao6NA2Kze9Es4AHBceACaF5ig0CVg27darO q6c76Yldjj/jyFjM6GmTGSj+tZWiJCe5FUJ0Y7Q2D+5WgxQRagSbz3W6pPAMTWPqCECm vcCsLkstv7k1rZk3Y1L88/HekxtbD5M4F6zpR1R7Qs9KY2E7+/hliI68FpI/bOENJd7+ 2THgGVvIbiY8E1zXmkMIbp/tukzTUq4mSRHvJl1mwi2+Mh5gTzMUN9SCRYjqhM5lY3IB Mc5Q== X-Gm-Message-State: ALoCoQlOUKTBN/L/vgXROQ57p9zpHZzui18ZdBFbk995IFXOq7PJ9ytMHDtr22nwHaGZ6MDPCjt2 X-Received: by 10.152.3.131 with SMTP id c3mr11928612lac.4.1433159339191; Mon, 01 Jun 2015 04:48:59 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.36 with SMTP id g4ls648500lah.33.gmail; Mon, 01 Jun 2015 04:48:59 -0700 (PDT) X-Received: by 10.153.6.36 with SMTP id cr4mr21057876lad.56.1433159339014; Mon, 01 Jun 2015 04:48:59 -0700 (PDT) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com. [209.85.217.182]) by mx.google.com with ESMTPS id a15si12120207lbq.57.2015.06.01.04.48.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Jun 2015 04:48:58 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) client-ip=209.85.217.182; Received: by lbcmx3 with SMTP id mx3so82533018lbc.1 for ; Mon, 01 Jun 2015 04:48:58 -0700 (PDT) X-Received: by 10.152.206.75 with SMTP id lm11mr11167663lac.41.1433159338554; Mon, 01 Jun 2015 04:48:58 -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.108.230 with SMTP id hn6csp2253819lbb; Mon, 1 Jun 2015 04:48:56 -0700 (PDT) X-Received: by 10.68.65.68 with SMTP id v4mr2376491pbs.31.1433159335810; Mon, 01 Jun 2015 04:48:55 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ce2si21191185pad.191.2015.06.01.04.48.54; Mon, 01 Jun 2015 04:48:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752427AbbFALst (ORCPT + 28 others); Mon, 1 Jun 2015 07:48:49 -0400 Received: from mail-pa0-f49.google.com ([209.85.220.49]:33613 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751566AbbFALsm (ORCPT ); Mon, 1 Jun 2015 07:48:42 -0400 Received: by padj3 with SMTP id j3so41855765pad.0 for ; Mon, 01 Jun 2015 04:48:41 -0700 (PDT) X-Received: by 10.66.236.226 with SMTP id ux2mr40423211pac.64.1433159321791; Mon, 01 Jun 2015 04:48:41 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([175.111.195.49]) by mx.google.com with ESMTPSA id dc8sm14300881pdb.23.2015.06.01.04.48.38 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Jun 2015 04:48:41 -0700 (PDT) From: Baolin Wang To: tglx@linutronix.de Cc: arnd@arndb.de, john.stultz@linaro.org, linux-kernel@vger.kernel.org, baolin.wang@linaro.org, y2038@lists.linaro.org Subject: [PATCH v4 01/25] linux/time64.h:Introduce the 'struct itimerspec64' for 64bit Date: Mon, 1 Jun 2015 19:48:26 +0800 Message-Id: <1433159306-4589-1-git-send-email-baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: baolin.wang@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.182 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This patch introduces the 'struct itimerspec64' for 64bit to replace itimerspec, and also introduces the conversion methods: itimerspec64_to_itimerspec() and itimerspec_to_itimerspec64(), that makes itimerspec ready for 2038 year. Signed-off-by: Baolin Wang --- include/linux/time64.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/include/linux/time64.h b/include/linux/time64.h index a383147..61dc4cb 100644 --- a/include/linux/time64.h +++ b/include/linux/time64.h @@ -11,11 +11,18 @@ typedef __s64 time64_t; */ #if __BITS_PER_LONG == 64 # define timespec64 timespec +#define itimerspec64 itimerspec #else struct timespec64 { time64_t tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ }; + +struct itimerspec64 { + struct timespec64 it_interval; /* timer period */ + struct timespec64 it_value; /* timer expiration */ +}; + #endif /* Parameters used to convert the timespec values: */ @@ -43,6 +50,16 @@ static inline struct timespec64 timespec_to_timespec64(const struct timespec ts) return ts; } +static inline struct itimerspec itimerspec64_to_itimerspec(struct itimerspec64 *its64) +{ + return *its64; +} + +static inline struct itimerspec64 itimerspec_to_itimerspec64(struct itimerspec *its) +{ + return *its; +} + # define timespec64_equal timespec_equal # define timespec64_compare timespec_compare # define set_normalized_timespec64 set_normalized_timespec @@ -75,6 +92,24 @@ static inline struct timespec64 timespec_to_timespec64(const struct timespec ts) return ret; } +static inline struct itimerspec itimerspec64_to_itimerspec(struct itimerspec64 *its64) +{ + struct itimerspec ret; + + ret.it_interval = timespec64_to_timespec(its64->it_interval); + ret.it_value = timespec64_to_timespec(its64->it_value); + return ret; +} + +static inline struct itimerspec64 itimerspec_to_itimerspec64(struct itimerspec *its) +{ + struct itimerspec64 ret; + + ret.it_interval = timespec_to_timespec64(its->it_interval); + ret.it_value = timespec_to_timespec64(its->it_value); + return ret; +} + static inline int timespec64_equal(const struct timespec64 *a, const struct timespec64 *b) {