hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/arch/powerpc/kernel/vdso64/gettimeofday.S
....@@ -1,18 +1,15 @@
1
+/* SPDX-License-Identifier: GPL-2.0-or-later */
12 /*
23 * Userland implementation of gettimeofday() for 64 bits processes in a
34 * ppc64 kernel for use in the vDSO
45 *
56 * Copyright (C) 2004 Benjamin Herrenschmuidt (benh@kernel.crashing.org),
67 * IBM Corp.
7
- *
8
- * This program is free software; you can redistribute it and/or
9
- * modify it under the terms of the GNU General Public License
10
- * as published by the Free Software Foundation; either version
11
- * 2 of the License, or (at your option) any later version.
128 */
139 #include <asm/processor.h>
1410 #include <asm/ppc_asm.h>
1511 #include <asm/vdso.h>
12
+#include <asm/vdso_datapage.h>
1613 #include <asm/asm-offsets.h>
1714 #include <asm/unistd.h>
1815
....@@ -30,7 +27,7 @@
3027
3128 mr r11,r3 /* r11 holds tv */
3229 mr r10,r4 /* r10 holds tz */
33
- bl V_LOCAL_FUNC(__get_datapage) /* get data page */
30
+ get_datapage r3, r0
3431 cmpldi r11,0 /* check if tv is NULL */
3532 beq 2f
3633 lis r7,1000000@ha /* load up USEC_PER_SEC */
....@@ -75,7 +72,7 @@
7572 mflr r12 /* r12 saves lr */
7673 .cfi_register lr,r12
7774 mr r11,r4 /* r11 saves tp */
78
- bl V_LOCAL_FUNC(__get_datapage) /* get data page */
75
+ get_datapage r3, r0
7976 lis r7,NSEC_PER_SEC@h /* want nanoseconds */
8077 ori r7,r7,NSEC_PER_SEC@l
8178 beq cr5,70f
....@@ -120,8 +117,8 @@
120117 * CLOCK_REALTIME_COARSE, below values are needed for MONOTONIC_COARSE
121118 * too
122119 */
123
- ld r4,STAMP_XTIME+TSPC64_TV_SEC(r3)
124
- ld r5,STAMP_XTIME+TSPC64_TV_NSEC(r3)
120
+ ld r4,STAMP_XTIME_SEC(r3)
121
+ ld r5,STAMP_XTIME_NSEC(r3)
125122 bne cr6,75f
126123
127124 /* CLOCK_MONOTONIC_COARSE */
....@@ -192,7 +189,7 @@
192189
193190 mflr r12
194191 .cfi_register lr,r12
195
- bl V_LOCAL_FUNC(__get_datapage)
192
+ get_datapage r3, r0
196193 lwz r5, CLOCK_HRTIMER_RES(r3)
197194 mtlr r12
198195 li r3,0
....@@ -225,9 +222,9 @@
225222 .cfi_register lr,r12
226223
227224 mr r11,r3 /* r11 holds t */
228
- bl V_LOCAL_FUNC(__get_datapage)
225
+ get_datapage r3, r0
229226
230
- ld r4,STAMP_XTIME+TSPC64_TV_SEC(r3)
227
+ ld r4,STAMP_XTIME_SEC(r3)
231228
232229 cmpldi r11,0 /* check if t is NULL */
233230 beq 2f
....@@ -272,7 +269,7 @@
272269 mulhdu r6,r6,r5 /* in units of 2^-32 seconds */
273270
274271 /* Add stamp since epoch */
275
- ld r4,STAMP_XTIME+TSPC64_TV_SEC(r3)
272
+ ld r4,STAMP_XTIME_SEC(r3)
276273 lwz r5,STAMP_SEC_FRAC(r3)
277274 or r0,r4,r5
278275 or r0,r0,r6