| * Copyright (C) 2011 Richard Weinberger <richrd@nod.at> |
| * Mostly copied from arch/x86/lib/delay.c |
| * This program is free software; you can redistribute it and/or modify |
| * it under the terms of the GNU General Public License version 2 as |
| * published by the Free Software Foundation. |
| #include <linux/module.h> |
| #include <linux/kernel.h> |
| void __delay(unsigned long loops) |
| : /* we don't need output */ |
| inline void __const_udelay(unsigned long xloops) |
| : "=d" (xloops), "=&a" (d0) |
| (loops_per_jiffy * (HZ/4))); |
| EXPORT_SYMBOL(__const_udelay); |
| void __udelay(unsigned long usecs) |
| __const_udelay(usecs * 0x000010c7); /* 2**32 / 1000000 (rounded up) */ |
| void __ndelay(unsigned long nsecs) |
| __const_udelay(nsecs * 0x00005); /* 2**32 / 1000000000 (rounded up) */ |