Loading...
1/* SPDX-License-Identifier: GPL-2.0 */
2/*
3 * Userland implementation of clock_getres() for 64 bits processes in a
4 * s390 kernel for use in the vDSO
5 *
6 * Copyright IBM Corp. 2008
7 * Author(s): Martin Schwidefsky (schwidefsky@de.ibm.com)
8 */
9#include <asm/vdso.h>
10#include <asm/asm-offsets.h>
11#include <asm/unistd.h>
12#include <asm/dwarf.h>
13
14 .text
15 .align 4
16 .globl __kernel_clock_getres
17 .type __kernel_clock_getres,@function
18__kernel_clock_getres:
19 CFI_STARTPROC
20 larl %r1,4f
21 cghi %r2,__CLOCK_REALTIME_COARSE
22 je 0f
23 cghi %r2,__CLOCK_MONOTONIC_COARSE
24 je 0f
25 larl %r1,3f
26 cghi %r2,__CLOCK_REALTIME
27 je 0f
28 cghi %r2,__CLOCK_MONOTONIC
29 je 0f
30 cghi %r2,__CLOCK_THREAD_CPUTIME_ID
31 je 0f
32 cghi %r2,-2 /* Per-thread CPUCLOCK with PID=0, VIRT=1 */
33 jne 2f
34 larl %r5,_vdso_data
35 icm %r0,15,__LC_ECTG_OK(%r5)
36 jz 2f
370: ltgr %r3,%r3
38 jz 1f /* res == NULL */
39 lg %r0,0(%r1)
40 xc 0(8,%r3),0(%r3) /* set tp->tv_sec to zero */
41 stg %r0,8(%r3) /* store tp->tv_usec */
421: lghi %r2,0
43 br %r14
442: lghi %r1,__NR_clock_getres /* fallback to svc */
45 svc 0
46 br %r14
47 CFI_ENDPROC
483: .quad __CLOCK_REALTIME_RES
494: .quad __CLOCK_COARSE_RES
50 .size __kernel_clock_getres,.-__kernel_clock_getres
1/*
2 * Userland implementation of clock_getres() for 64 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 cghi %r2,__CLOCK_REALTIME
23 je 0f
24 cghi %r2,__CLOCK_MONOTONIC
25 je 0f
26 cghi %r2,__CLOCK_THREAD_CPUTIME_ID
27 je 0f
28 cghi %r2,-2 /* Per-thread CPUCLOCK with PID=0, VIRT=1 */
29 jne 2f
30 larl %r5,_vdso_data
31 icm %r0,15,__LC_ECTG_OK(%r5)
32 jz 2f
330: ltgr %r3,%r3
34 jz 1f /* res == NULL */
35 larl %r1,3f
36 lg %r0,0(%r1)
37 xc 0(8,%r3),0(%r3) /* set tp->tv_sec to zero */
38 stg %r0,8(%r3) /* store tp->tv_usec */
391: lghi %r2,0
40 br %r14
412: lghi %r1,__NR_clock_getres /* fallback to svc */
42 svc 0
43 br %r14
443: .quad __CLOCK_REALTIME_RES
45 .cfi_endproc
46 .size __kernel_clock_getres,.-__kernel_clock_getres