From: Santosh Sivaraj <santosh@fossix.org>
To: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
"Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>,
John Stultz <john.stultz@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>,
Frederic Weisbecker <fweisbec@gmail.com>,
Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Subject: [PATCH 1/2] powerpc/vdso64: Coarse timer support preparatory patch
Date: Mon, 18 Sep 2017 14:53:35 +0530 [thread overview]
Message-ID: <20170918092336.21912-1-santosh@fossix.org> (raw)
Reorganize code to make it easy to introduce CLOCK_REALTIME_COARSE and
CLOCK_MONOTONIC_COARSE timer support.
Signed-off-by: Santosh Sivaraj <santosh@fossix.org>
---
arch/powerpc/kernel/vdso64/gettimeofday.S | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/arch/powerpc/kernel/vdso64/gettimeofday.S b/arch/powerpc/kernel/vdso64/gettimeofday.S
index 382021324883..a0b4943811db 100644
--- a/arch/powerpc/kernel/vdso64/gettimeofday.S
+++ b/arch/powerpc/kernel/vdso64/gettimeofday.S
@@ -60,18 +60,20 @@ V_FUNCTION_END(__kernel_gettimeofday)
*/
V_FUNCTION_BEGIN(__kernel_clock_gettime)
.cfi_startproc
+ mr r11,r4 /* r11 saves tp */
+ mflr r12 /* r12 saves lr */
+ lis r7,NSEC_PER_SEC@h /* want nanoseconds */
+ ori r7,r7,NSEC_PER_SEC@l
+
/* Check for supported clock IDs */
cmpwi cr0,r3,CLOCK_REALTIME
cmpwi cr1,r3,CLOCK_MONOTONIC
cror cr0*4+eq,cr0*4+eq,cr1*4+eq
- bne cr0,99f
+ beq cr0,49f
- mflr r12 /* r12 saves lr */
+ b 99f /* Fallback to syscall */
.cfi_register lr,r12
- mr r11,r4 /* r11 saves tp */
- bl V_LOCAL_FUNC(__get_datapage) /* get data page */
- lis r7,NSEC_PER_SEC@h /* want nanoseconds */
- ori r7,r7,NSEC_PER_SEC@l
+49: bl V_LOCAL_FUNC(__get_datapage) /* get data page */
50: bl V_LOCAL_FUNC(__do_get_tspec) /* get time from tb & kernel */
bne cr1,80f /* if not monotonic, all done */
--
2.13.5
next reply other threads:[~2017-09-18 9:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-18 9:23 Santosh Sivaraj [this message]
2017-09-18 9:23 ` [PATCH 2/2] powerpc/vdso64: Add support for CLOCK_{REALTIME/MONOTONIC}_COARSE Santosh Sivaraj
2017-10-06 9:28 ` Naveen N. Rao
2017-10-09 6:27 ` Santosh Sivaraj
2017-10-06 11:25 ` Naveen N. Rao
2017-10-09 6:23 ` Santosh Sivaraj
2017-10-09 8:09 ` [PATCH v4] " Santosh Sivaraj
2017-10-09 10:39 ` Naveen N. Rao
2017-10-10 9:03 ` Santosh Sivaraj
2017-10-10 9:30 ` Naveen N. Rao
2017-10-10 23:10 ` [PATCH v6] " Santosh Sivaraj
2017-10-11 7:04 ` Naveen N. Rao
2017-10-11 7:38 ` Santosh Sivaraj
2017-10-06 9:03 ` [PATCH 1/2] powerpc/vdso64: Coarse timer support preparatory patch Naveen N. Rao
2017-10-06 10:13 ` Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170918092336.21912-1-santosh@fossix.org \
--to=santosh@fossix.org \
--cc=fweisbec@gmail.com \
--cc=john.stultz@linaro.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=naveen.n.rao@linux.vnet.ibm.com \
--cc=srikar@linux.vnet.ibm.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).