Il 22/02/2014 13:25, Alex Bligh ha scritto:
Paolo,
On 22 Feb 2014, at 10:55, Paolo Bonzini wrote:
Il 22/02/2014 10:03, Alex Bligh ha scritto:
I am unfamiliar with the HPET code but symmetry suggests perhaps the 'else'
condition should be changed too:
} else if (deactivating_bit(old_val, new_val, HPET_TN_ENABLE) ||
!hpet_enabled(s)) {
hpet_del_timer(timer);
}
--
I thought the same, but there is no need for that. When the enabled bit goes
from set to clear, all timers are disabled:
} else if (deactivating_bit(old_val, new_val, HPET_CFG_ENABLE)) {
/* Halt main counter and disable interrupt generation. */
s->hpet_counter = hpet_get_ticks(s);
for (i = 0; i < s->num_timers; i++) {
hpet_del_timer(&s->timer[i]);
}
}
So hpet_del_timer would be a nop if !hpet_enabled(s).
Thanks. I didn't know whether HPET_CFG_ENABLE and HPET_TN_ENABLE were
equivalent.
No, they are not, but HPET_CFG_ENABLE is equivalent to hpet_enabled.
Paolo