Commit 9b97bea9 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/vdso: Remove cvdso_call_time macro

cvdso_call_time macro is very similar to cvdso_call macro.

Add a call_time argument to cvdso_call which is 0 by default
and set to 1 when using cvdso_call to call __c_kernel_time().

Return returned value as is with CR[SO] cleared when it is used
for time().
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/837a260ad86fc1ce297a562c2117fd69be5f7b5c.1642782130.git.christophe.leroy@csgroup.eu
parent fd1feade
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
#include <asm/ppc_asm.h> #include <asm/ppc_asm.h>
/* /*
* The macros sets two stack frames, one for the caller and one for the callee * The macro sets two stack frames, one for the caller and one for the callee
* because there are no requirement for the caller to set a stack frame when * because there are no requirement for the caller to set a stack frame when
* calling VDSO so it may have omitted to set one, especially on PPC64 * calling VDSO so it may have omitted to set one, especially on PPC64
*/ */
.macro cvdso_call funct .macro cvdso_call funct call_time=0
.cfi_startproc .cfi_startproc
PPC_STLU r1, -PPC_MIN_STKFRM(r1) PPC_STLU r1, -PPC_MIN_STKFRM(r1)
mflr r0 mflr r0
...@@ -25,45 +25,28 @@ ...@@ -25,45 +25,28 @@
PPC_STL r2, PPC_MIN_STKFRM + STK_GOT(r1) PPC_STL r2, PPC_MIN_STKFRM + STK_GOT(r1)
#endif #endif
get_datapage r5 get_datapage r5
.ifeq \call_time
addi r5, r5, VDSO_DATA_OFFSET addi r5, r5, VDSO_DATA_OFFSET
.else
addi r4, r5, VDSO_DATA_OFFSET
.endif
bl DOTSYM(\funct) bl DOTSYM(\funct)
PPC_LL r0, PPC_MIN_STKFRM + PPC_LR_STKOFF(r1) PPC_LL r0, PPC_MIN_STKFRM + PPC_LR_STKOFF(r1)
#ifdef __powerpc64__ #ifdef __powerpc64__
PPC_LL r2, PPC_MIN_STKFRM + STK_GOT(r1) PPC_LL r2, PPC_MIN_STKFRM + STK_GOT(r1)
#endif #endif
.ifeq \call_time
cmpwi r3, 0 cmpwi r3, 0
.endif
mtlr r0 mtlr r0
.cfi_restore lr .cfi_restore lr
addi r1, r1, 2 * PPC_MIN_STKFRM addi r1, r1, 2 * PPC_MIN_STKFRM
crclr so crclr so
.ifeq \call_time
beqlr+ beqlr+
crset so crset so
neg r3, r3 neg r3, r3
blr .endif
.cfi_endproc
.endm
.macro cvdso_call_time funct
.cfi_startproc
PPC_STLU r1, -PPC_MIN_STKFRM(r1)
mflr r0
.cfi_register lr, r0
PPC_STLU r1, -PPC_MIN_STKFRM(r1)
PPC_STL r0, PPC_MIN_STKFRM + PPC_LR_STKOFF(r1)
#ifdef __powerpc64__
PPC_STL r2, PPC_MIN_STKFRM + STK_GOT(r1)
#endif
get_datapage r4
addi r4, r4, VDSO_DATA_OFFSET
bl DOTSYM(\funct)
PPC_LL r0, PPC_MIN_STKFRM + PPC_LR_STKOFF(r1)
#ifdef __powerpc64__
PPC_LL r2, PPC_MIN_STKFRM + STK_GOT(r1)
#endif
crclr so
mtlr r0
.cfi_restore lr
addi r1, r1, 2 * PPC_MIN_STKFRM
blr blr
.cfi_endproc .cfi_endproc
.endm .endm
......
...@@ -65,7 +65,7 @@ V_FUNCTION_END(__kernel_clock_getres) ...@@ -65,7 +65,7 @@ V_FUNCTION_END(__kernel_clock_getres)
* *
*/ */
V_FUNCTION_BEGIN(__kernel_time) V_FUNCTION_BEGIN(__kernel_time)
cvdso_call_time __c_kernel_time cvdso_call __c_kernel_time call_time=1
V_FUNCTION_END(__kernel_time) V_FUNCTION_END(__kernel_time)
/* Routines for restoring integer registers, called by the compiler. */ /* Routines for restoring integer registers, called by the compiler. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment