summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2011-02-08 01:43:45 +0000
committermarcel <marcel@FreeBSD.org>2011-02-08 01:43:45 +0000
commitcc3f43e6b293dc0a254297a634a8e49d67f14df5 (patch)
treeaf18283c507610a1b9e852af5827c8b0588b9ae5 /sys
parentd78b15750703e8d8d71305f1941184c76f370b76 (diff)
downloadFreeBSD-src-cc3f43e6b293dc0a254297a634a8e49d67f14df5.zip
FreeBSD-src-cc3f43e6b293dc0a254297a634a8e49d67f14df5.tar.gz
o Make sure to mask off timer1 interrupts. It's not necessarily
masked-off by the firmware. o In DELAY(). Make sure we have an inner-loop body that the compiler cannot eliminate. While timing does not have to be perfect, the loops must be there to have at least some notion of delay. Obtained from: Juniper Networks
Diffstat (limited to 'sys')
-rw-r--r--sys/arm/mv/timer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/arm/mv/timer.c b/sys/arm/mv/timer.c
index fb3b321..6d3de4e 100644
--- a/sys/arm/mv/timer.c
+++ b/sys/arm/mv/timer.c
@@ -150,6 +150,7 @@ mv_timer_attach(device_t dev)
write_cpu_ctrl(BRIDGE_IRQ_CAUSE, irq_cause);
irq_mask = read_cpu_ctrl(BRIDGE_IRQ_MASK);
irq_mask |= IRQ_TIMER0_MASK;
+ irq_mask &= ~IRQ_TIMER1_MASK;
write_cpu_ctrl(BRIDGE_IRQ_MASK, irq_mask);
sc->et.et_name = "CPUTimer0";
@@ -229,7 +230,7 @@ DELAY(int usec)
if (!timers_initialized) {
for (; usec > 0; usec--)
for (val = 100; val > 0; val--)
- ;
+ __asm __volatile("nop" ::: "memory");
return;
}
OpenPOWER on IntegriCloud