From 8cbb14ca3fb0774549e1f98f2101e30c46af9ccd Mon Sep 17 00:00:00 2001 From: Paolo 'Blaisorblade' Giarrusso Date: Thu, 7 Dec 2006 02:14:07 +0100 Subject: [PATCH] --- yaml --- r: 43062 b: refs/heads/master c: e6536c1262c56d302e749ab1b44fdb0b9786327d h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/asm-i386/delay.h | 5 ++++- trunk/include/asm-x86_64/delay.h | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 61c89fa1e61d..b29c2a0b1056 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b9a8d94a47f8a41766f6f7944adfb1d641349903 +refs/heads/master: e6536c1262c56d302e749ab1b44fdb0b9786327d diff --git a/trunk/include/asm-i386/delay.h b/trunk/include/asm-i386/delay.h index b1c7650dc7b9..9ae5e3782ed8 100644 --- a/trunk/include/asm-i386/delay.h +++ b/trunk/include/asm-i386/delay.h @@ -7,6 +7,7 @@ * Delay routines calling functions in arch/i386/lib/delay.c */ +/* Undefined functions to get compile-time errors */ extern void __bad_udelay(void); extern void __bad_ndelay(void); @@ -15,10 +16,12 @@ extern void __ndelay(unsigned long nsecs); extern void __const_udelay(unsigned long usecs); extern void __delay(unsigned long loops); +/* 0x10c7 is 2**32 / 1000000 (rounded up) */ #define udelay(n) (__builtin_constant_p(n) ? \ ((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c7ul)) : \ __udelay(n)) - + +/* 0x5 is 2**32 / 1000000000 (rounded up) */ #define ndelay(n) (__builtin_constant_p(n) ? \ ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \ __ndelay(n)) diff --git a/trunk/include/asm-x86_64/delay.h b/trunk/include/asm-x86_64/delay.h index 40146f611ccb..c2669f1f5529 100644 --- a/trunk/include/asm-x86_64/delay.h +++ b/trunk/include/asm-x86_64/delay.h @@ -7,18 +7,21 @@ * Delay routines calling functions in arch/x86_64/lib/delay.c */ +/* Undefined functions to get compile-time errors */ extern void __bad_udelay(void); extern void __bad_ndelay(void); extern void __udelay(unsigned long usecs); -extern void __ndelay(unsigned long usecs); +extern void __ndelay(unsigned long nsecs); extern void __const_udelay(unsigned long usecs); extern void __delay(unsigned long loops); +/* 0x10c7 is 2**32 / 1000000 (rounded up) */ #define udelay(n) (__builtin_constant_p(n) ? \ ((n) > 20000 ? __bad_udelay() : __const_udelay((n) * 0x10c7ul)) : \ __udelay(n)) +/* 0x5 is 2**32 / 1000000000 (rounded up) */ #define ndelay(n) (__builtin_constant_p(n) ? \ ((n) > 20000 ? __bad_ndelay() : __const_udelay((n) * 5ul)) : \ __ndelay(n))