mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-02 06:23:18 +02:00
Fix 32bit vs. 64bit long int arithematics
Corresponding to flashrom svn r8 and coreboot v2 svn r1434.
This commit is contained in:
3
udelay.c
3
udelay.c
@ -17,17 +17,14 @@ void myusec_calibrate_delay()
|
||||
unsigned long timeusec;
|
||||
struct timeval start, end;
|
||||
int ok = 0;
|
||||
void myusec_delay(int time);
|
||||
|
||||
printf("Setting up microsecond timing loop\n");
|
||||
while (!ok) {
|
||||
//fprintf(stderr, "Try %d\n", count);
|
||||
gettimeofday(&start, 0);
|
||||
myusec_delay(count);
|
||||
gettimeofday(&end, 0);
|
||||
timeusec = 1000000 * (end.tv_sec - start.tv_sec ) +
|
||||
(end.tv_usec - start.tv_usec);
|
||||
//fprintf(stderr, "timeusec is %d\n", timeusec);
|
||||
count *= 2;
|
||||
if (timeusec < 1000000/4)
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user