diff options
author | Zheng Da <zhengda1936@gmail.com> | 2009-12-06 05:26:23 +0100 |
---|---|---|
committer | Zheng Da <zhengda1936@gmail.com> | 2009-12-06 05:26:23 +0100 |
commit | 8a6d48c0542876eb3acfc0970c0ab7872db08d5f (patch) | |
tree | 496e78bc728317ea779781b92f897d16936ee231 /libdde_linux26/include/ARCH-x86/asm-x86/delay.h | |
parent | b4bffcfcdf3ab7a55d664e9aa5907f88da503f38 (diff) |
check in the original version of dde linux26.
Diffstat (limited to 'libdde_linux26/include/ARCH-x86/asm-x86/delay.h')
-rw-r--r-- | libdde_linux26/include/ARCH-x86/asm-x86/delay.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/libdde_linux26/include/ARCH-x86/asm-x86/delay.h b/libdde_linux26/include/ARCH-x86/asm-x86/delay.h new file mode 100644 index 00000000..5a1512f2 --- /dev/null +++ b/libdde_linux26/include/ARCH-x86/asm-x86/delay.h @@ -0,0 +1,35 @@ +#ifndef _ASM_X86_DELAY_H +#define _ASM_X86_DELAY_H + +/* + * Copyright (C) 1993 Linus Torvalds + * + * Delay routines calling functions in arch/x86/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 nsecs); +extern void __const_udelay(unsigned long xloops); +extern void __delay(unsigned long loops); + +#ifdef DDE_LINUX +#define udelay(n) __udelay((n)) +#define ndelay(n) __ndelay((n)) +#else +/* 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)) +#endif /* DDE_LINUX */ +void use_tsc_delay(void); + +#endif /* _ASM_X86_DELAY_H */ |