2005-04-17 02:20:36 +04:00
/ *
* linux/ a r c h / a r m / l i b / d e l a y . S
*
* Copyright ( C ) 1 9 9 5 , 1 9 9 6 R u s s e l l K i n g
*
* This p r o g r a m i s f r e e s o f t w a r e ; you can redistribute it and/or modify
* it u n d e r t h e t e r m s o f t h e G N U G e n e r a l P u b l i c L i c e n s e v e r s i o n 2 a s
* published b y t h e F r e e S o f t w a r e F o u n d a t i o n .
* /
# include < l i n u x / l i n k a g e . h >
# include < a s m / a s s e m b l e r . h >
2012-07-06 18:47:17 +04:00
# include < a s m / d e l a y . h >
2005-04-17 02:20:36 +04:00
.text
2005-11-12 00:51:49 +03:00
.LC0 : .word loops_per_jiffy
2012-07-06 18:47:17 +04:00
.LC1 : .word UDELAY_MULT
2005-04-17 02:20:36 +04:00
/ *
2006-03-20 20:10:09 +03:00
* r0 < = 2 0 0 0
* lpj < = 0 x01 f f f f f f ( m a x . 3 3 5 5 b o g o m i p s )
* HZ < = 1 0 0 0
2005-04-17 02:20:36 +04:00
* /
2006-03-20 20:10:09 +03:00
2012-07-06 18:47:17 +04:00
ENTRY( _ _ l o o p _ u d e l a y )
2006-03-20 20:10:09 +03:00
ldr r2 , . L C 1
2005-04-17 02:20:36 +04:00
mul r0 , r2 , r0
2012-07-06 18:47:17 +04:00
ENTRY( _ _ l o o p _ c o n s t _ u d e l a y ) @ 0 <= r0 <= 0x7fffff06
2011-01-11 02:55:59 +03:00
mov r1 , #- 1
2005-11-12 00:51:49 +03:00
ldr r2 , . L C 0
2006-03-20 20:10:09 +03:00
ldr r2 , [ r2 ] @ max = 0x01ffffff
2011-01-11 02:55:59 +03:00
add r0 , r0 , r1 , l s r #32 - 1 4
2006-03-20 20:10:09 +03:00
mov r0 , r0 , l s r #14 @ max = 0x0001ffff
2011-01-11 02:55:59 +03:00
add r2 , r2 , r1 , l s r #32 - 1 0
2006-03-20 20:10:09 +03:00
mov r2 , r2 , l s r #10 @ max = 0x00007fff
2005-04-17 02:20:36 +04:00
mul r0 , r2 , r0 @ max = 2^32-1
2011-01-11 02:55:59 +03:00
add r0 , r0 , r1 , l s r #32 - 6
2005-04-17 02:20:36 +04:00
movs r0 , r0 , l s r #6
2006-06-25 14:17:23 +04:00
moveq p c , l r
2005-04-17 02:20:36 +04:00
/ *
2006-03-20 20:10:09 +03:00
* loops = r0 * H Z * l o o p s _ p e r _ j i f f y / 1 0 0 0 0 0 0
2005-04-17 02:20:36 +04:00
* /
@ Delay routine
2012-07-06 18:47:17 +04:00
ENTRY( _ _ l o o p _ d e l a y )
2005-04-17 02:20:36 +04:00
subs r0 , r0 , #1
# if 0
2006-06-25 14:17:23 +04:00
movls p c , l r
2005-04-17 02:20:36 +04:00
subs r0 , r0 , #1
2006-06-25 14:17:23 +04:00
movls p c , l r
2005-04-17 02:20:36 +04:00
subs r0 , r0 , #1
2006-06-25 14:17:23 +04:00
movls p c , l r
2005-04-17 02:20:36 +04:00
subs r0 , r0 , #1
2006-06-25 14:17:23 +04:00
movls p c , l r
2005-04-17 02:20:36 +04:00
subs r0 , r0 , #1
2006-06-25 14:17:23 +04:00
movls p c , l r
2005-04-17 02:20:36 +04:00
subs r0 , r0 , #1
2006-06-25 14:17:23 +04:00
movls p c , l r
2005-04-17 02:20:36 +04:00
subs r0 , r0 , #1
2006-06-25 14:17:23 +04:00
movls p c , l r
2005-04-17 02:20:36 +04:00
subs r0 , r0 , #1
# endif
2012-07-06 18:47:17 +04:00
bhi _ _ l o o p _ d e l a y
2006-06-25 14:17:23 +04:00
mov p c , l r
2012-07-06 18:47:17 +04:00
ENDPROC( _ _ l o o p _ u d e l a y )
ENDPROC( _ _ l o o p _ c o n s t _ u d e l a y )
ENDPROC( _ _ l o o p _ d e l a y )