VirtualBox

Changeset 35848 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Feb 4, 2011 11:11:54 AM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
69845
Message:

PIT: Do not always pulse IRQ line when updating interrupt state.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevPit-i8254.cpp

    r35353 r35848  
    177177#ifdef IN_RING3
    178178PDMBOTHCBDECL(int) pitIOPortSpeakerWrite(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb);
    179 static void pit_irq_timer_update(PITChannelState *s, uint64_t current_time, uint64_t now);
     179static void pit_irq_timer_update(PITChannelState *s, uint64_t current_time, uint64_t now, bool in_timer);
    180180#endif
    181181RT_C_DECLS_END
     
    307307            Log(("pit_set_gate: restarting mode %d\n", s->mode));
    308308            s->count_load_time = TMTimerGet(pTimer);
    309             pit_irq_timer_update(s, s->count_load_time, s->count_load_time);
     309            pit_irq_timer_update(s, s->count_load_time, s->count_load_time, false);
    310310        }
    311311        break;
     
    316316            Log(("pit_set_gate: restarting mode %d\n", s->mode));
    317317            s->count_load_time = s->u64ReloadTS = TMTimerGet(pTimer);
    318             pit_irq_timer_update(s, s->count_load_time, s->count_load_time);
     318            pit_irq_timer_update(s, s->count_load_time, s->count_load_time, false);
    319319        }
    320320        /* XXX: disable/enable counting */
     
    331331    s->count_load_time = s->u64ReloadTS = TMTimerGet(pTimer);
    332332    s->count = val;
    333     pit_irq_timer_update(s, s->count_load_time, s->count_load_time);
     333    pit_irq_timer_update(s, s->count_load_time, s->count_load_time, false);
    334334
    335335    /* log the new rate (ch 0 only). */
     
    419419}
    420420
    421 static void pit_irq_timer_update(PITChannelState *s, uint64_t current_time, uint64_t now)
     421static void pit_irq_timer_update(PITChannelState *s, uint64_t current_time, uint64_t now, bool in_timer)
    422422{
    423423    int64_t expire_time;
     
    438438        pDevIns = s->CTX_SUFF(pPit)->pDevIns;
    439439
    440         if (EFFECTIVE_MODE(s->mode) == 2)
     440        if (EFFECTIVE_MODE(s->mode) == 2 && in_timer)
    441441        {
    442             /* We just flip-flop the irq level to save that extra timer call, which isn't generally required (we haven't served it for years). */
     442            /* We just flip-flop the irq level to save that extra timer call, which
     443             * isn't generally required (we haven't served it for years). However,
     444             * the pulse is only generated when running on the timer callback (and
     445             * thus on the trailing edge of the output signal pulse).
     446             */
    443447            PDMDevHlpISASetIrq(pDevIns, s->irq, PDM_IRQ_LEVEL_FLIP_FLOP);
     448
    444449        } else
    445450            PDMDevHlpISASetIrq(pDevIns, s->irq, irq_level);
     
    896901    STAM_PROFILE_ADV_START(&s->CTX_SUFF(pPit)->StatPITHandler, a);
    897902    Log(("pitTimer\n"));
    898     pit_irq_timer_update(s, s->next_transition_time, TMTimerGet(pTimer));
     903    pit_irq_timer_update(s, s->next_transition_time, TMTimerGet(pTimer), true);
    899904    STAM_PROFILE_ADV_STOP(&s->CTX_SUFF(pPit)->StatPITHandler, a);
    900905}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette