Ok. I didn't make 2.4.0 in 2000. Tough. I tried, but we had some
[davej-history.git] / arch / arm / lib / delay.S
blobcaf8ec1dc4621b2150b96d5528c9f182c5cd3489
1 /*
2  *  linux/arch/arm/lib/delay.S
3  *
4  *  Copyright (C) 1995, 1996 Russell King
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  */
10 #include <linux/linkage.h>
11 #include <asm/assembler.h>
12                 .text
14 LC0:            .word   SYMBOL_NAME(loops_per_sec)
16 ENTRY(udelay)
17                 mov     r2, #0x1000
18                 orr     r2, r2, #0x00c6
19                 mul     r1, r0, r2
20                 ldr     r2, LC0
21                 ldr     r2, [r2]
22                 mov     r1, r1, lsr #11
23                 mov     r2, r2, lsr #11
24                 mul     r0, r1, r2
25                 movs    r0, r0, lsr #10
26                 RETINSTR(moveq,pc,lr)
28 @ Delay routine
29 ENTRY(__delay)
30                 subs    r0, r0, #1
31                 RETINSTR(movcc,pc,lr)
32                 subs    r0, r0, #1
33                 RETINSTR(movcc,pc,lr)
34                 subs    r0, r0, #1
35                 RETINSTR(movcc,pc,lr)
36                 subs    r0, r0, #1
37                 RETINSTR(movcc,pc,lr)
38                 subs    r0, r0, #1
39                 RETINSTR(movcc,pc,lr)
40                 subs    r0, r0, #1
41                 RETINSTR(movcc,pc,lr)
42                 subs    r0, r0, #1
43                 RETINSTR(movcc,pc,lr)
44                 subs    r0, r0, #1
45                 bcs     SYMBOL_NAME(__delay)
46                 RETINSTR(mov,pc,lr)