Patchwork libpayload timer overflow

login
register
about
Submitter Stefan Reinauer
Date 2010-03-24 21:02:13
Message ID <4BAA7DD5.8050509@coresystems.de>
Download mbox | patch
Permalink /patch/1141/
State Accepted
Headers show

Comments

Stefan Reinauer - 2010-03-24 21:02:13
See patch
Patrick Georgi - 2010-03-24 21:28:47
Am 24.03.2010 22:02, schrieb Stefan Reinauer:
> See patch
Acked-by: Patrick Georgi <patrick.georgi@coresystems.de>

Patch

--- arch/i386/timer.c	(revision 5280)
+++ arch/i386/timer.c	(working copy)
@@ -88,7 +88,7 @@ 
  */
 void ndelay(unsigned int n)
 {
-	_delay(n * cpu_khz / 1000000);
+	_delay((unsigned long long)n * cpu_khz / 1000000);
 }
 
 /**
@@ -98,7 +98,7 @@ 
  */
 void udelay(unsigned int n)
 {
-	_delay(n * cpu_khz / 1000);
+	_delay((unsigned long long)n * cpu_khz / 1000);
 }
 
 /**
@@ -108,7 +108,7 @@ 
  */
 void mdelay(unsigned int m)
 {
-	_delay(m * cpu_khz);
+	_delay((unsigned long long)m * cpu_khz);
 }
 
 /**
@@ -118,5 +118,7 @@ 
  */
 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);
 }