/*1* linux/arch/arm/lib/delay.S2*3* Copyright (C) 1995, 1996 Russell King4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License version 2 as7* published by the Free Software Foundation.8*/9#include <linux/linkage.h>10#include <asm/assembler.h>11#include <asm/param.h>12.text1314.LC0: .word loops_per_jiffy15.LC1: .word (2199023*HZ)>>111617/*18* r0 <= 200019* lpj <= 0x01ffffff (max. 3355 bogomips)20* HZ <= 100021*/2223ENTRY(__udelay)24ldr r2, .LC125mul r0, r2, r026ENTRY(__const_udelay) @ 0 <= r0 <= 0x7fffff0627mov r1, #-128ldr r2, .LC029ldr r2, [r2] @ max = 0x01ffffff30add r0, r0, r1, lsr #32-1431mov r0, r0, lsr #14 @ max = 0x0001ffff32add r2, r2, r1, lsr #32-1033mov r2, r2, lsr #10 @ max = 0x00007fff34mul r0, r2, r0 @ max = 2^32-135add r0, r0, r1, lsr #32-636movs r0, r0, lsr #637moveq pc, lr3839/*40* loops = r0 * HZ * loops_per_jiffy / 100000041*42* Oh, if only we had a cycle counter...43*/4445@ Delay routine46ENTRY(__delay)47subs r0, r0, #148#if 049movls pc, lr50subs r0, r0, #151movls pc, lr52subs r0, r0, #153movls pc, lr54subs r0, r0, #155movls pc, lr56subs r0, r0, #157movls pc, lr58subs r0, r0, #159movls pc, lr60subs r0, r0, #161movls pc, lr62subs r0, r0, #163#endif64bhi __delay65mov pc, lr66ENDPROC(__udelay)67ENDPROC(__const_udelay)68ENDPROC(__delay)697071