diff options
Diffstat (limited to 'arch/powerpc/kernel/vdso32/gettimeofday.S')
-rw-r--r-- | arch/powerpc/kernel/vdso32/gettimeofday.S | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/powerpc/kernel/vdso32/gettimeofday.S b/arch/powerpc/kernel/vdso32/gettimeofday.S index aeb5fc9b87b3..0a32a41d50b0 100644 --- a/arch/powerpc/kernel/vdso32/gettimeofday.S +++ b/arch/powerpc/kernel/vdso32/gettimeofday.S | |||
@@ -83,7 +83,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime) | |||
83 | /* Check for supported clock IDs */ | 83 | /* Check for supported clock IDs */ |
84 | cmpli cr0,r3,CLOCK_REALTIME | 84 | cmpli cr0,r3,CLOCK_REALTIME |
85 | cmpli cr1,r3,CLOCK_MONOTONIC | 85 | cmpli cr1,r3,CLOCK_MONOTONIC |
86 | cror cr0,cr0,cr1 | 86 | cror cr0*4+eq,cr0*4+eq,cr1*4+eq |
87 | bne cr0,99f | 87 | bne cr0,99f |
88 | 88 | ||
89 | mflr r12 /* r12 saves lr */ | 89 | mflr r12 /* r12 saves lr */ |
@@ -91,7 +91,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime) | |||
91 | mr r10,r3 /* r10 saves id */ | 91 | mr r10,r3 /* r10 saves id */ |
92 | mr r11,r4 /* r11 saves tp */ | 92 | mr r11,r4 /* r11 saves tp */ |
93 | bl __get_datapage@local /* get data page */ | 93 | bl __get_datapage@local /* get data page */ |
94 | mr r9, r3 /* datapage ptr in r9 */ | 94 | mr r9,r3 /* datapage ptr in r9 */ |
95 | beq cr1,50f /* if monotonic -> jump there */ | 95 | beq cr1,50f /* if monotonic -> jump there */ |
96 | 96 | ||
97 | /* | 97 | /* |
@@ -173,10 +173,14 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime) | |||
173 | add r4,r4,r7 | 173 | add r4,r4,r7 |
174 | lis r5,NSEC_PER_SEC@h | 174 | lis r5,NSEC_PER_SEC@h |
175 | ori r5,r5,NSEC_PER_SEC@l | 175 | ori r5,r5,NSEC_PER_SEC@l |
176 | cmpli cr0,r4,r5 | 176 | cmpl cr0,r4,r5 |
177 | cmpli cr1,r4,0 | ||
177 | blt 1f | 178 | blt 1f |
178 | subf r4,r5,r4 | 179 | subf r4,r5,r4 |
179 | addi r3,r3,1 | 180 | addi r3,r3,1 |
181 | 1: bge cr1,1f | ||
182 | addi r3,r3,-1 | ||
183 | add r4,r4,r5 | ||
180 | 1: stw r3,TSPC32_TV_SEC(r11) | 184 | 1: stw r3,TSPC32_TV_SEC(r11) |
181 | stw r4,TSPC32_TV_NSEC(r11) | 185 | stw r4,TSPC32_TV_NSEC(r11) |
182 | 186 | ||
@@ -210,7 +214,7 @@ V_FUNCTION_BEGIN(__kernel_clock_getres) | |||
210 | /* Check for supported clock IDs */ | 214 | /* Check for supported clock IDs */ |
211 | cmpwi cr0,r3,CLOCK_REALTIME | 215 | cmpwi cr0,r3,CLOCK_REALTIME |
212 | cmpwi cr1,r3,CLOCK_MONOTONIC | 216 | cmpwi cr1,r3,CLOCK_MONOTONIC |
213 | cror cr0,cr0,cr1 | 217 | cror cr0*4+eq,cr0*4+eq,cr1*4+eq |
214 | bne cr0,99f | 218 | bne cr0,99f |
215 | 219 | ||
216 | li r3,0 | 220 | li r3,0 |