summaryrefslogtreecommitdiff
path: root/cpu/arm920t/interrupts.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpu/arm920t/interrupts.c')
-rw-r--r--cpu/arm920t/interrupts.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/cpu/arm920t/interrupts.c b/cpu/arm920t/interrupts.c
index 9ff06c1..521c4f4 100644
--- a/cpu/arm920t/interrupts.c
+++ b/cpu/arm920t/interrupts.c
@@ -235,14 +235,13 @@ void set_timer (ulong t)
void udelay (unsigned long usec)
{
ulong tmo;
+ ulong start = get_timer(0);
tmo = usec / 1000;
tmo *= (timer_load_val * 100);
tmo /= 1000;
- tmo += get_timer (0);
-
- while (get_timer_masked () < tmo)
+ while ((ulong)(get_timer_masked () - start) < tmo)
/*NOP*/;
}