[PATCH] powerpc: vdso fixes (take #2)
This fixes various errors in the new functions added in the vDSO's, I've now verified all functions on both 32 and 64 bits vDSOs. It also fix a sign extension bug getting the initial time of day at boot that could cause the monotonic clock value to be completely on bogus for 64 bits applications (with either the vDSO or the syscall) on powermacs. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
此提交包含在:
@@ -77,8 +77,9 @@ V_FUNCTION_BEGIN(__kernel_get_tbfreq)
|
||||
mflr r12
|
||||
.cfi_register lr,r12
|
||||
bl __get_datapage@local
|
||||
lwz r3,CFG_TB_TICKS_PER_SEC(r3)
|
||||
lwz r4,(CFG_TB_TICKS_PER_SEC + 4)(r3)
|
||||
lwz r3,CFG_TB_TICKS_PER_SEC(r3)
|
||||
mtlr r12
|
||||
blr
|
||||
.cfi_endproc
|
||||
V_FUNCTION_END(__kernel_get_tbfreq)
|
||||
|
@@ -83,7 +83,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime)
|
||||
/* Check for supported clock IDs */
|
||||
cmpli cr0,r3,CLOCK_REALTIME
|
||||
cmpli cr1,r3,CLOCK_MONOTONIC
|
||||
cror cr0,cr0,cr1
|
||||
cror cr0*4+eq,cr0*4+eq,cr1*4+eq
|
||||
bne cr0,99f
|
||||
|
||||
mflr r12 /* r12 saves lr */
|
||||
@@ -91,7 +91,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime)
|
||||
mr r10,r3 /* r10 saves id */
|
||||
mr r11,r4 /* r11 saves tp */
|
||||
bl __get_datapage@local /* get data page */
|
||||
mr r9, r3 /* datapage ptr in r9 */
|
||||
mr r9,r3 /* datapage ptr in r9 */
|
||||
beq cr1,50f /* if monotonic -> jump there */
|
||||
|
||||
/*
|
||||
@@ -173,10 +173,14 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime)
|
||||
add r4,r4,r7
|
||||
lis r5,NSEC_PER_SEC@h
|
||||
ori r5,r5,NSEC_PER_SEC@l
|
||||
cmpli cr0,r4,r5
|
||||
cmpl cr0,r4,r5
|
||||
cmpli cr1,r4,0
|
||||
blt 1f
|
||||
subf r4,r5,r4
|
||||
addi r3,r3,1
|
||||
1: bge cr1,1f
|
||||
addi r3,r3,-1
|
||||
add r4,r4,r5
|
||||
1: stw r3,TSPC32_TV_SEC(r11)
|
||||
stw r4,TSPC32_TV_NSEC(r11)
|
||||
|
||||
@@ -210,7 +214,7 @@ V_FUNCTION_BEGIN(__kernel_clock_getres)
|
||||
/* Check for supported clock IDs */
|
||||
cmpwi cr0,r3,CLOCK_REALTIME
|
||||
cmpwi cr1,r3,CLOCK_MONOTONIC
|
||||
cror cr0,cr0,cr1
|
||||
cror cr0*4+eq,cr0*4+eq,cr1*4+eq
|
||||
bne cr0,99f
|
||||
|
||||
li r3,0
|
||||
|
新增問題並參考
封鎖使用者