aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/vdso32/clock_getres.S
diff options
context:
space:
mode:
authorMartin Schwidefsky <schwidefsky@de.ibm.com>2008-12-25 07:38:36 -0500
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2008-12-25 07:38:55 -0500
commitb020632e40c3ed5e8c0c066d022672907e8401cf (patch)
treed7f805bd27e8378436fbba7e7457afbd10c22ed8 /arch/s390/kernel/vdso32/clock_getres.S
parentfc5243d98ac2575ad14a974b3c097e9ba874c03d (diff)
[S390] introduce vdso on s390
Add a vdso to speed up gettimeofday and clock_getres/clock_gettime for CLOCK_REALTIME/CLOCK_MONOTONIC. Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kernel/vdso32/clock_getres.S')
-rw-r--r--arch/s390/kernel/vdso32/clock_getres.S39
1 files changed, 39 insertions, 0 deletions
diff --git a/arch/s390/kernel/vdso32/clock_getres.S b/arch/s390/kernel/vdso32/clock_getres.S
new file mode 100644
index 000000000000..9532c4e6a9d2
--- /dev/null
+++ b/arch/s390/kernel/vdso32/clock_getres.S
@@ -0,0 +1,39 @@
1/*
2 * Userland implementation of clock_getres() for 32 bits processes in a
3 * s390 kernel for use in the vDSO
4 *
5 * Copyright IBM Corp. 2008
6 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License (version 2 only)
10 * as published by the Free Software Foundation.
11 */
12#include <asm/vdso.h>
13#include <asm/asm-offsets.h>
14#include <asm/unistd.h>
15
16 .text
17 .align 4
18 .globl __kernel_clock_getres
19 .type __kernel_clock_getres,@function
20__kernel_clock_getres:
21 .cfi_startproc
22 chi %r2,CLOCK_REALTIME
23 je 0f
24 chi %r2,CLOCK_MONOTONIC
25 jne 3f
260: ltr %r3,%r3
27 jz 2f /* res == NULL */
28 basr %r1,0
291: l %r0,4f-1b(%r1)
30 xc 0(4,%r3),0(%r3) /* set tp->tv_sec to zero */
31 st %r0,4(%r3) /* store tp->tv_usec */
322: lhi %r2,0
33 br %r14
343: lhi %r1,__NR_clock_getres /* fallback to svc */
35 svc 0
36 br %r14
374: .long CLOCK_REALTIME_RES
38 .cfi_endproc
39 .size __kernel_clock_getres,.-__kernel_clock_getres