2 * Userland implementation of clock_getres() for 64 bits processes in a
3 * s390 kernel for use in the vDSO
5 * Copyright IBM Corp. 2008
6 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
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.
13 #include <asm/asm-offsets.h>
14 #include <asm/unistd.h>
18 .globl __kernel_clock_getres
19 .type __kernel_clock_getres,@function
20 __kernel_clock_getres:
22 cghi %r2,__CLOCK_REALTIME
24 cghi %r2,__CLOCK_MONOTONIC
26 cghi %r2,__CLOCK_THREAD_CPUTIME_ID
28 cghi %r2,-2 /* Per-thread CPUCLOCK with PID=0, VIRT=1 */
31 icm %r0,15,__LC_ECTG_OK(%r5)
34 jz 1f /* res == NULL */
37 xc 0(8,%r3),0(%r3) /* set tp->tv_sec to zero */
38 stg %r0,8(%r3) /* store tp->tv_usec */
41 2: lghi %r1,__NR_clock_getres /* fallback to svc */
44 3: .quad __CLOCK_REALTIME_RES
46 .size __kernel_clock_getres,.-__kernel_clock_getres