2005-04-16 15:20:36 -07: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 >
2006-03-20 17:10:09 +00:00
# include < a s m / p a r a m . h >
2005-04-16 15:20:36 -07:00
.text
2005-11-11 21:51:49 +00:00
.LC0 : .word loops_per_jiffy
2006-03-20 17:10:09 +00:00
.LC1 : .word ( 2 1 9 9 0 2 3 * HZ) > > 1 1
2005-04-16 15:20:36 -07:00
/ *
2006-03-20 17:10:09 +00: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-16 15:20:36 -07:00
* /
2006-03-20 17:10:09 +00:00
2005-04-16 15:20:36 -07:00
ENTRY( _ _ u d e l a y )
2006-03-20 17:10:09 +00:00
ldr r2 , . L C 1
2005-04-16 15:20:36 -07:00
mul r0 , r2 , r0
2006-03-20 17:10:09 +00:00
ENTRY( _ _ c o n s t _ u d e l a y ) @ 0 <= r0 <= 0x7fffff06
2005-11-11 21:51:49 +00:00
ldr r2 , . L C 0
2006-03-20 17:10:09 +00:00
ldr r2 , [ r2 ] @ max = 0x01ffffff
mov r0 , r0 , l s r #14 @ max = 0x0001ffff
mov r2 , r2 , l s r #10 @ max = 0x00007fff
2005-04-16 15:20:36 -07:00
mul r0 , r2 , r0 @ max = 2^32-1
movs r0 , r0 , l s r #6
RETINSTR( m o v e q ,p c ,l r )
/ *
2006-03-20 17:10:09 +00: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-16 15:20:36 -07:00
*
* Oh, i f o n l y w e h a d a c y c l e c o u n t e r . . .
* /
@ Delay routine
ENTRY( _ _ d e l a y )
subs r0 , r0 , #1
# if 0
RETINSTR( m o v l s ,p c ,l r )
subs r0 , r0 , #1
RETINSTR( m o v l s ,p c ,l r )
subs r0 , r0 , #1
RETINSTR( m o v l s ,p c ,l r )
subs r0 , r0 , #1
RETINSTR( m o v l s ,p c ,l r )
subs r0 , r0 , #1
RETINSTR( m o v l s ,p c ,l r )
subs r0 , r0 , #1
RETINSTR( m o v l s ,p c ,l r )
subs r0 , r0 , #1
RETINSTR( m o v l s ,p c ,l r )
subs r0 , r0 , #1
# endif
bhi _ _ d e l a y
RETINSTR( m o v ,p c ,l r )