2 * linux/arch/arm/lib/delay.S
4 * Copyright (C) 1995-2003 Russell King
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.
10 #include <linux/linkage.h>
11 #include <asm/assembler.h>
12 #include <asm/delay.h>
17 * See linux/include/asm-arm/delay.h for a description of the maths.
20 #if NDELAY_FACTOR > 255
21 #error NDELAY_FACTOR out of range
23 #if UDELAY_FACTOR > 65535
24 #error UDELAY_FACTOR out of range
27 LC0: .word SYMBOL_NAME(loops_per_jiffy)
36 mov r2, #NDELAY_FACTOR
40 mov r2, #UDELAY_FACTOR & 0xff00
41 orr r2, r2, #UDELAY_FACTOR & 0x00ff
46 2: mov r2, r2, lsr #12
52 * loops = (r0 * 0x10c6 * HZ * loops_per_jiffy) / 2^32
54 * Oh, if only we had a cycle counter...
59 bcs SYMBOL_NAME(__delay)