Skip to content

Commit 4d65ce1

Browse files
committed
powerpc/vdso: Move cvdso_call macro into gettimeofday.S
jira LE-1907 Rebuild_History Non-Buildable kernel-rt-5.14.0-284.30.1.rt14.315.el9_2 commit-author Christophe Leroy <[email protected]> commit 692b21d Now that gettimeofday.S is unique, move cvdso_call macro into that file which is the only user. Signed-off-by: Christophe Leroy <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/72720359d4c58e3a3b96dd74952741225faac3de.1642782130.git.christophe.leroy@csgroup.eu (cherry picked from commit 692b21d) Signed-off-by: Jonathan Maple <[email protected]>
1 parent 4a2bfe7 commit 4d65ce1

File tree

2 files changed

+45
-51
lines changed

2 files changed

+45
-51
lines changed

arch/powerpc/include/asm/vdso/gettimeofday.h

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,57 +2,9 @@
22
#ifndef _ASM_POWERPC_VDSO_GETTIMEOFDAY_H
33
#define _ASM_POWERPC_VDSO_GETTIMEOFDAY_H
44

5-
#include <asm/page.h>
6-
7-
#ifdef __ASSEMBLY__
8-
9-
#include <asm/ppc_asm.h>
10-
11-
/*
12-
* The macro sets two stack frames, one for the caller and one for the callee
13-
* because there are no requirement for the caller to set a stack frame when
14-
* calling VDSO so it may have omitted to set one, especially on PPC64
15-
*/
16-
17-
.macro cvdso_call funct call_time=0
18-
.cfi_startproc
19-
PPC_STLU r1, -PPC_MIN_STKFRM(r1)
20-
mflr r0
21-
.cfi_register lr, r0
22-
PPC_STLU r1, -PPC_MIN_STKFRM(r1)
23-
PPC_STL r0, PPC_MIN_STKFRM + PPC_LR_STKOFF(r1)
24-
#ifdef __powerpc64__
25-
PPC_STL r2, PPC_MIN_STKFRM + STK_GOT(r1)
26-
#endif
27-
get_datapage r5
28-
.ifeq \call_time
29-
addi r5, r5, VDSO_DATA_OFFSET
30-
.else
31-
addi r4, r5, VDSO_DATA_OFFSET
32-
.endif
33-
bl DOTSYM(\funct)
34-
PPC_LL r0, PPC_MIN_STKFRM + PPC_LR_STKOFF(r1)
35-
#ifdef __powerpc64__
36-
PPC_LL r2, PPC_MIN_STKFRM + STK_GOT(r1)
37-
#endif
38-
.ifeq \call_time
39-
cmpwi r3, 0
40-
.endif
41-
mtlr r0
42-
.cfi_restore lr
43-
addi r1, r1, 2 * PPC_MIN_STKFRM
44-
crclr so
45-
.ifeq \call_time
46-
beqlr+
47-
crset so
48-
neg r3, r3
49-
.endif
50-
blr
51-
.cfi_endproc
52-
.endm
53-
54-
#else
5+
#ifndef __ASSEMBLY__
556

7+
#include <asm/page.h>
568
#include <asm/vdso/timebase.h>
579
#include <asm/barrier.h>
5810
#include <asm/unistd.h>

arch/powerpc/kernel/vdso32/gettimeofday.S

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,49 @@
1212
#include <asm/vdso_datapage.h>
1313
#include <asm/asm-offsets.h>
1414
#include <asm/unistd.h>
15-
#include <asm/vdso/gettimeofday.h>
15+
16+
/*
17+
* The macro sets two stack frames, one for the caller and one for the callee
18+
* because there are no requirement for the caller to set a stack frame when
19+
* calling VDSO so it may have omitted to set one, especially on PPC64
20+
*/
21+
22+
.macro cvdso_call funct call_time=0
23+
.cfi_startproc
24+
PPC_STLU r1, -PPC_MIN_STKFRM(r1)
25+
mflr r0
26+
.cfi_register lr, r0
27+
PPC_STLU r1, -PPC_MIN_STKFRM(r1)
28+
PPC_STL r0, PPC_MIN_STKFRM + PPC_LR_STKOFF(r1)
29+
#ifdef __powerpc64__
30+
PPC_STL r2, PPC_MIN_STKFRM + STK_GOT(r1)
31+
#endif
32+
get_datapage r5
33+
.ifeq \call_time
34+
addi r5, r5, VDSO_DATA_OFFSET
35+
.else
36+
addi r4, r5, VDSO_DATA_OFFSET
37+
.endif
38+
bl DOTSYM(\funct)
39+
PPC_LL r0, PPC_MIN_STKFRM + PPC_LR_STKOFF(r1)
40+
#ifdef __powerpc64__
41+
PPC_LL r2, PPC_MIN_STKFRM + STK_GOT(r1)
42+
#endif
43+
.ifeq \call_time
44+
cmpwi r3, 0
45+
.endif
46+
mtlr r0
47+
.cfi_restore lr
48+
addi r1, r1, 2 * PPC_MIN_STKFRM
49+
crclr so
50+
.ifeq \call_time
51+
beqlr+
52+
crset so
53+
neg r3, r3
54+
.endif
55+
blr
56+
.cfi_endproc
57+
.endm
1658

1759
.text
1860
/*

0 commit comments

Comments
 (0)