From b746178e659df1added87d7f5011f79114fd60b1 Mon Sep 17 00:00:00 2001 From: Jordan Crouse Date: Thu, 28 Aug 2008 23:12:22 +0000 Subject: [PATCH]: libpayload: Document the architecture specific routines No code changes. Signed-off-by: Jordan Crouse Acked-by: Jordan Crouse git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3552 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- payloads/libpayload/i386/timer.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'payloads/libpayload/i386') diff --git a/payloads/libpayload/i386/timer.c b/payloads/libpayload/i386/timer.c index 260656cfe3..46d21cc6ae 100644 --- a/payloads/libpayload/i386/timer.c +++ b/payloads/libpayload/i386/timer.c @@ -27,9 +27,17 @@ * SUCH DAMAGE. */ +/** @file i386/timer.c + * @brief i386 specific timer routines + */ + #include #include +/** + * @ingroup arch + * Global variable containing the speed of the processor in KHz + */ u32 cpu_khz; /** @@ -72,21 +80,39 @@ static inline void _delay(unsigned int delta) while (rdtsc() < timeout) ; } +/** + * Delay for a specified number of nanoseconds + * @param n Number of nanoseconds to delay for + */ void ndelay(unsigned int n) { _delay(n * cpu_khz / 1000000); } +/** + * Delay for a specified number of microseconds + * @param n Number of microseconds to delay for + */ void udelay(unsigned int n) { _delay(n * cpu_khz / 1000); } +/** + * Delay for a specified number of milliseconds + * @param n Number of milliseconds to delay for + */ + void mdelay(unsigned int m) { _delay(m * cpu_khz); } +/** + * Delay for a specified number of seconds + * @param n Number of seconds to delay for + */ + void delay(unsigned int s) { _delay(s * cpu_khz * 1000); -- cgit v1.2.3