Fix apic timer

This commit is contained in:
Fabian 2020-12-31 19:14:34 -06:00
parent 39d78a950b
commit a157fdf059

View file

@ -394,9 +394,13 @@ APIC.prototype.timer = function(now)
if(mode === APIC_TIMER_MODE_PERIODIC)
{
// This isn't exact, because timer_current_count might already be
// negative at this point since timer() fires late
this.timer_current_count = this.timer_initial_count;
this.timer_current_count = this.timer_current_count % this.timer_initial_count;
if(this.timer_current_count <= 0)
{
this.timer_current_count += this.timer_initial_count;
}
dbg_assert(this.timer_current_count !== 0);
if((this.lvt_timer & IOAPIC_CONFIG_MASKED) === 0)
{