diff options
author | Stefan Reinauer <stepan@coresystems.de> | 2010-03-25 18:53:20 +0000 |
---|---|---|
committer | Stefan Reinauer <stepan@openbios.org> | 2010-03-25 18:53:20 +0000 |
commit | d361308f1862a9c662a21ffe50aed08fb4c4fdb7 (patch) | |
tree | 2e414eb2a369939342a9dd0bc21993d420834eef /payloads | |
parent | 1beabe10cded46a7b21b6ab163f95b1e19172492 (diff) | |
download | coreboot-d361308f1862a9c662a21ffe50aed08fb4c4fdb7.tar.gz coreboot-d361308f1862a9c662a21ffe50aed08fb4c4fdb7.tar.bz2 coreboot-d361308f1862a9c662a21ffe50aed08fb4c4fdb7.zip |
prevent timer overflows in libpayload
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Patrick Georgi <patrick.georgi@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5292 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'payloads')
-rw-r--r-- | payloads/libpayload/arch/i386/timer.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/payloads/libpayload/arch/i386/timer.c b/payloads/libpayload/arch/i386/timer.c index 3d8607b3cb43..ae288eb94e4b 100644 --- a/payloads/libpayload/arch/i386/timer.c +++ b/payloads/libpayload/arch/i386/timer.c @@ -88,7 +88,7 @@ static inline void _delay(unsigned long long delta) */ void ndelay(unsigned int n) { - _delay(n * cpu_khz / 1000000); + _delay((unsigned long long)n * cpu_khz / 1000000); } /** @@ -98,7 +98,7 @@ void ndelay(unsigned int n) */ void udelay(unsigned int n) { - _delay(n * cpu_khz / 1000); + _delay((unsigned long long)n * cpu_khz / 1000); } /** @@ -108,7 +108,7 @@ void udelay(unsigned int n) */ void mdelay(unsigned int m) { - _delay(m * cpu_khz); + _delay((unsigned long long)m * cpu_khz); } /** @@ -118,5 +118,7 @@ void mdelay(unsigned int m) */ void delay(unsigned int s) { - _delay(s * cpu_khz * 1000); + int i; + for (i=0; i<1000; i++) + _delay((unsigned long long)s * cpu_khz); } |