From patchwork Mon Jun 1 11:57:24 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: 49310 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 E200D218FC for ; Mon, 1 Jun 2015 11:58:01 +0000 (UTC) Received: by labc7 with SMTP id c7sf4525211lab.1 for ; Mon, 01 Jun 2015 04:58: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: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=T4vHkCXNQks6+QEXp+t0J5Pb0bqpCitdhhzVtRXSAUg=; b=fG1CJLwcv/hzNPPou3URaOdfJL9qieKOYIrjHqqW3CR2pCShUusMrLR5t3ycLV3Hyq r4kINY+KC1yw9GlIXE0/eWKz8x0MjHIzawuUqkO+F18o9R2QxSKqs/AqS8GTyvmloh88 m7sSYEUViVxFV5jEHkiUGB78/Jr4yNYY3fKeKhfR5u8G/5dACaU+PEHl2xslUCVGLJk6 WJUOECedu93Xv+PKtrYTP8tmXEmD84swLcuMiM8Yml/ePaH3Q3uo2klO5W1vnsng7V29 muGAqt6jt6J2XrstH/M6tn0D7WXq5BkbNjhdJKB6FHUmzxUrg+C1k8FJfIIeTgwf5oMC I6Pw== X-Gm-Message-State: ALoCoQl3w7+2RtylsKkl6gzBwSV8KURXH9d9Nrmmqx280Ysm3HSAHT1eHHw7lsj3tT0wFvjAutgA X-Received: by 10.112.148.101 with SMTP id tr5mr20815739lbb.13.1433159880814; Mon, 01 Jun 2015 04:58:00 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.169 with SMTP id l9ls646322lah.52.gmail; Mon, 01 Jun 2015 04:58:00 -0700 (PDT) X-Received: by 10.152.7.206 with SMTP id l14mr12381193laa.3.1433159880639; Mon, 01 Jun 2015 04:58:00 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id l7si12120401lbp.115.2015.06.01.04.58.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 01 Jun 2015 04:58:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbbuc2 with SMTP id uc2so82738117lbb.2 for ; Mon, 01 Jun 2015 04:58:00 -0700 (PDT) X-Received: by 10.112.155.197 with SMTP id vy5mr20410148lbb.29.1433159880547; Mon, 01 Jun 2015 04:58: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.108.230 with SMTP id hn6csp2258885lbb; Mon, 1 Jun 2015 04:57:59 -0700 (PDT) X-Received: by 10.70.19.204 with SMTP id h12mr40418237pde.84.1433159878786; Mon, 01 Jun 2015 04:57:58 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sg6si20927643pbc.146.2015.06.01.04.57.57; Mon, 01 Jun 2015 04:57:58 -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 S1752452AbbFAL5v (ORCPT + 28 others); Mon, 1 Jun 2015 07:57:51 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:35204 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753003AbbFAL5i (ORCPT ); Mon, 1 Jun 2015 07:57:38 -0400 Received: by pdbnf5 with SMTP id nf5so44993038pdb.2 for ; Mon, 01 Jun 2015 04:57:38 -0700 (PDT) X-Received: by 10.68.65.68 with SMTP id v4mr2433044pbs.31.1433159858225; Mon, 01 Jun 2015 04:57:38 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([175.111.195.49]) by mx.google.com with ESMTPSA id da2sm14023523pbb.57.2015.06.01.04.57.35 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Jun 2015 04:57:37 -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 13/25] posix-timers:Change the implementation for clock_gettime syscall function Date: Mon, 1 Jun 2015 19:57:24 +0800 Message-Id: <1433159844-5034-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.176 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 clock_gettime syscall and changes the clock_gettime syscall implementation to prepare the converting to 64bit methods for the clock_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 06e2549..12affd5 100644 --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c @@ -1117,17 +1117,23 @@ SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock, return __clock_settime(which_clock, &new_tp); } -SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock, - struct timespec __user *,tp) +static int __clock_gettime(clockid_t which_clock, struct timespec *ts) { struct k_clock *kc = clockid_to_kclock(which_clock); - struct timespec kernel_tp; - int error; if (!kc) return -EINVAL; - error = kc->clock_get(which_clock, &kernel_tp); + return kc->clock_get(which_clock, ts); +} + +SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock, + struct timespec __user *,tp) +{ + struct timespec kernel_tp; + int error; + + error = __clock_gettime(which_clock, &kernel_tp); if (!error && copy_to_user(tp, &kernel_tp, sizeof (kernel_tp))) error = -EFAULT;