Revision 68fb89a2

b/hw/slavio_timer.c
88 88
#define TIMER_MAX_COUNT32  0x7ffffe00ULL
89 89
#define TIMER_REACHED      0x80000000
90 90
#define TIMER_PERIOD       500ULL // 500ns
91
#define LIMIT_TO_PERIODS(l) ((l) >> 9)
92
#define PERIODS_TO_LIMIT(l) ((l) << 9)
91
#define LIMIT_TO_PERIODS(l) (((l) >> 9) - 1)
92
#define PERIODS_TO_LIMIT(l) (((l) + 1) << 9)
93 93

  
94 94
static int slavio_timer_is_user(TimerContext *tc)
95 95
{
......
127 127

  
128 128
    slavio_timer_get_out(t);
129 129
    DPRINTF("callback: count %x%08x\n", t->counthigh, t->count);
130
    t->reached = TIMER_REACHED;
130
    /* if limit is 0 (free-run), there will be no match */
131
    if (t->limit != 0) {
132
        t->reached = TIMER_REACHED;
133
    }
131 134
    /* there is no interrupt if user timer or free-run */
132 135
    if (!slavio_timer_is_user(tc) && t->limit != 0) {
133 136
        qemu_irq_raise(t->irq);

Also available in: Unified diff