From patchwork Mon Jun 1 11:55:27 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: 49305 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f69.google.com (mail-wg0-f69.google.com [74.125.82.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1A583218FC for ; Mon, 1 Jun 2015 11:56:41 +0000 (UTC) Received: by wgv5 with SMTP id 5sf28417111wgv.0 for ; Mon, 01 Jun 2015 04:56:40 -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=CC7xfjPlGK5PTEG/BdyzHCOZ4z5aAnx/T9ebac0kT2g=; b=RSa607LCYIdrLIR7Hj7tziunC0ysJ1j/ci28SNhVPSsG51S1X5/dP0I6kpJ8eNGZiZ KaxGzo12snUfVLhy5eYPWDchBuy5wWTRYgo3Esb/UMjkaXm+S7flZfLKa7McjZtvJXdz HBIyQ0WbasdErWiLh0bxFgmg3EKg65T32QFWAiqNrT987FQLoanIox8+J5hyHob2wWai TFJCGBINu2J4Cb5RRDjEVQhXStRLnw513LybtYoKhtS6E/R0rdj2TxTh5YtXJARvKBLh zy7AW1RR3DSi1inwiHAKckLYoiE38mnYHtk5G4X8CaMrX0ZHSbd+Ok1vaQqbr+sFoq1+ U4ZQ== X-Gm-Message-State: ALoCoQn/nsW3PWiQAJFYB0RFuRV8nqkF3CzUeGEda62JwKeUNlqd9FJfYqRtrVxPb/VQ8Dg7H0UP X-Received: by 10.180.105.67 with SMTP id gk3mr11304440wib.4.1433159800357; Mon, 01 Jun 2015 04:56:40 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.120.227 with SMTP id lf3ls622949lab.93.gmail; Mon, 01 Jun 2015 04:56:40 -0700 (PDT) X-Received: by 10.152.121.42 with SMTP id lh10mr21057265lab.0.1433159800160; Mon, 01 Jun 2015 04:56:40 -0700 (PDT) Received: from mail-lb0-f172.google.com (mail-lb0-f172.google.com. [209.85.217.172]) by mx.google.com with ESMTPS id n4si12142846laj.18.2015.06.01.04.56.40 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Jun 2015 04:56:40 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.172 as permitted sender) client-ip=209.85.217.172; Received: by lbbqq2 with SMTP id qq2so82593920lbb.3 for ; Mon, 01 Jun 2015 04:56:40 -0700 (PDT) X-Received: by 10.112.131.98 with SMTP id ol2mr4646158lbb.56.1433159799924; Mon, 01 Jun 2015 04:56:39 -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 hn6csp2258184lbb; Mon, 1 Jun 2015 04:56:38 -0700 (PDT) X-Received: by 10.66.216.70 with SMTP id oo6mr39576790pac.24.1433159798190; Mon, 01 Jun 2015 04:56:38 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c11si21202579pat.225.2015.06.01.04.56.36; Mon, 01 Jun 2015 04:56:38 -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 S1752812AbbFAL4Y (ORCPT + 28 others); Mon, 1 Jun 2015 07:56:24 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:34611 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752620AbbFALzm (ORCPT ); Mon, 1 Jun 2015 07:55:42 -0400 Received: by payr10 with SMTP id r10so25098708pay.1 for ; Mon, 01 Jun 2015 04:55:42 -0700 (PDT) X-Received: by 10.68.250.229 with SMTP id zf5mr2418176pbc.158.1433159742003; Mon, 01 Jun 2015 04:55:42 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([175.111.195.49]) by mx.google.com with ESMTPSA id qo1sm12747391pbc.89.2015.06.01.04.55.39 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Jun 2015 04:55:41 -0700 (PDT) From: Baolin Wang To: tglx@linutronix.de Cc: arnd@arndb.de, linux-kernel@vger.kernel.org, baolin.wang@linaro.org, y2038@lists.linaro.org Subject: [PATCH v4 07/25] posix-timers:Change the implementation for timer_gettime syscall function Date: Mon, 1 Jun 2015 19:55:27 +0800 Message-Id: <1433159727-4818-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.172 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 splits out the guts of the timer_gettime syscall and changes the timer_gettime syscall implementation to prepare the converting to 64bit methods for the timer_gettime syscall function in posix-timers.c file. Signed-off-by: Baolin Wang --- kernel/time/posix-timers.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/kernel/time/posix-timers.c b/kernel/time/posix-timers.c index 96efe1d..d00f8ed 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c @@ -795,11 +795,8 @@ common_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting) cur_setting->it_value = ktime_to_timespec(remaining); } -/* Get the time remaining on a POSIX.1b interval timer. */ -SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id, - struct itimerspec __user *, setting) +static int __timer_gettime(timer_t timer_id, struct itimerspec *cur_setting) { - struct itimerspec cur_setting; struct k_itimer *timr; struct k_clock *kc; unsigned long flags; @@ -813,9 +810,18 @@ SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id, if (WARN_ON_ONCE(!kc || !kc->timer_get)) ret = -EINVAL; else - kc->timer_get(timr, &cur_setting); + kc->timer_get(timr, cur_setting); unlock_timer(timr, flags); + return ret; +} + +/* Get the time remaining on a POSIX.1b interval timer. */ +SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id, + struct itimerspec __user *, setting) +{ + struct itimerspec cur_setting; + int ret = __timer_gettime(timer_id, &cur_setting); if (!ret && copy_to_user(setting, &cur_setting, sizeof (cur_setting))) return -EFAULT;