diff options
author | balrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-09-20 01:32:07 +0000 |
---|---|---|
committer | balrog <balrog@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-09-20 01:32:07 +0000 |
commit | e856f2ad014e6cb1bd3eca126be23b8f919f3dd1 (patch) | |
tree | 18d6aca3a160fd800f8ee33a37ea5e3a98674e40 /hw | |
parent | c9a33054bf589f1d78315100c645713b04bddc31 (diff) |
Use a QEMUBH when an OMAP timer must expire immediately.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5265 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r-- | hw/omap1.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/hw/omap1.c b/hw/omap1.c index f74637d091..a32563bb8f 100644 --- a/hw/omap1.c +++ b/hw/omap1.c @@ -664,6 +664,7 @@ struct omap_mpu_timer_s { uint32_t val; int64_t time; QEMUTimer *timer; + QEMUBH *tick; int64_t rate; int it_ena; @@ -708,21 +709,15 @@ static inline void omap_timer_update(struct omap_mpu_timer_s *timer) * ticks. */ if (expires > (ticks_per_sec >> 10) || timer->ar) qemu_mod_timer(timer->timer, timer->time + expires); - else { - timer->val = 0; - timer->st = 0; - if (timer->it_ena) - /* Edge-triggered irq */ - qemu_irq_pulse(timer->irq); - } + else + qemu_bh_schedule(timer->tick); } else qemu_del_timer(timer->timer); } -static void omap_timer_tick(void *opaque) +static void omap_timer_fire(void *opaque) { - struct omap_mpu_timer_s *timer = (struct omap_mpu_timer_s *) opaque; - omap_timer_sync(timer); + struct omap_mpu_timer_s *timer = opaque; if (!timer->ar) { timer->val = 0; @@ -732,6 +727,14 @@ static void omap_timer_tick(void *opaque) if (timer->it_ena) /* Edge-triggered irq */ qemu_irq_pulse(timer->irq); +} + +static void omap_timer_tick(void *opaque) +{ + struct omap_mpu_timer_s *timer = (struct omap_mpu_timer_s *) opaque; + + omap_timer_sync(timer); + omap_timer_fire(timer); omap_timer_update(timer); } @@ -835,6 +838,7 @@ struct omap_mpu_timer_s *omap_mpu_timer_init(target_phys_addr_t base, s->clk = clk; s->base = base; s->timer = qemu_new_timer(vm_clock, omap_timer_tick, s); + s->tick = qemu_bh_new(omap_timer_fire, s); omap_mpu_timer_reset(s); omap_timer_clk_setup(s); |