2017-11-24 15:00:32 +01:00
/* SPDX-License-Identifier: GPL-2.0 */
2008-12-25 13:38:36 +01:00
/ *
* Userland i m p l e m e n t a t i o n o f c l o c k _ g e t r e s ( ) f o r 6 4 b i t s p r o c e s s e s i n a
* s3 9 0 k e r n e l f o r u s e i n t h e v D S O
*
* Copyright I B M C o r p . 2 0 0 8
* Author( s ) : M a r t i n S c h w i d e f s k y ( s c h w i d e f s k y @de.ibm.com)
* /
# include < a s m / v d s o . h >
# include < a s m / a s m - o f f s e t s . h >
# include < a s m / u n i s t d . h >
2017-11-20 11:41:07 +01:00
# include < a s m / d w a r f . h >
2008-12-25 13:38:36 +01:00
.text
.align 4
.globl __kernel_clock_getres
.type _ _ kernel_ c l o c k _ g e t r e s ,@function
__kernel_clock_getres :
2017-11-20 11:46:13 +01:00
CFI_ S T A R T P R O C
2014-08-29 12:31:45 +02:00
larl % r1 ,4 f
cghi % r2 ,_ _ C L O C K _ R E A L T I M E _ C O A R S E
je 0 f
cghi % r2 ,_ _ C L O C K _ M O N O T O N I C _ C O A R S E
je 0 f
larl % r1 ,3 f
2010-10-29 16:50:41 +02:00
cghi % r2 ,_ _ C L O C K _ R E A L T I M E
2008-12-25 13:38:36 +01:00
je 0 f
2010-10-29 16:50:41 +02:00
cghi % r2 ,_ _ C L O C K _ M O N O T O N I C
2008-12-31 15:11:42 +01:00
je 0 f
2013-12-02 14:54:56 +01:00
cghi % r2 ,_ _ C L O C K _ T H R E A D _ C P U T I M E _ I D
je 0 f
cghi % r2 ,- 2 / * P e r - t h r e a d C P U C L O C K w i t h P I D =0 , V I R T =1 * /
2008-12-25 13:38:36 +01:00
jne 2 f
2008-12-31 15:11:42 +01:00
larl % r5 ,_ v d s o _ d a t a
icm % r0 ,1 5 ,_ _ L C _ E C T G _ O K ( % r5 )
jz 2 f
2008-12-25 13:38:36 +01:00
0 : ltgr % r3 ,% r3
jz 1 f / * r e s = = N U L L * /
lg % r0 ,0 ( % r1 )
xc 0 ( 8 ,% r3 ) ,0 ( % r3 ) / * s e t t p - > t v _ s e c t o z e r o * /
stg % r0 ,8 ( % r3 ) / * s t o r e t p - > t v _ u s e c * /
1 : lghi % r2 ,0
br % r14
2 : lghi % r1 ,_ _ N R _ c l o c k _ g e t r e s / * f a l l b a c k t o s v c * /
svc 0
br % r14
2017-11-20 11:46:13 +01:00
CFI_ E N D P R O C
2010-10-29 16:50:41 +02:00
3 : .quad _ _ C L O C K _ R E A L T I M E _ R E S
2014-08-29 12:31:45 +02:00
4 : .quad _ _ C L O C K _ C O A R S E _ R E S
2008-12-25 13:38:36 +01:00
.size _ _ kernel_ c l o c k _ g e t r e s ,. - _ _ k e r n e l _ c l o c k _ g e t r e s