1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Userland implementation of clock_getres() for 32 bits processes in a
4 * s390 kernel for use in the vDSO
6 * Copyright IBM Corp. 2008
7 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
10 #include <asm/asm-offsets.h>
11 #include <asm/unistd.h>
12 #include <asm/dwarf.h>
16 .globl __kernel_clock_getres
17 .type __kernel_clock_getres,@function
18 __kernel_clock_getres:
22 chi %r2,__CLOCK_REALTIME
24 chi %r2,__CLOCK_MONOTONIC
27 chi %r2,__CLOCK_REALTIME_COARSE
29 chi %r2,__CLOCK_MONOTONIC_COARSE
32 jz 2f /* res == NULL */
34 xc 0(4,%r3),0(%r3) /* set tp->tv_sec to zero */
35 st %r0,4(%r3) /* store tp->tv_usec */
38 3: lhi %r1,__NR_clock_getres /* fallback to svc */
42 4: .long __CLOCK_REALTIME_RES
43 5: .long __CLOCK_COARSE_RES
44 .size __kernel_clock_getres,.-__kernel_clock_getres