VirtualBox

Changeset 10665 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jul 15, 2008 2:41:57 PM (16 years ago)
Author:
vboxsync
Message:

Fixed apicHasPendingInterrupt.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/PC/DevAPIC.cpp

    r10660 r10665  
    509509}
    510510
     511static int apic_get_ppr_zero_tpr(APICState *s)
     512{
     513    int isrv;
     514
     515    isrv = get_highest_priority_int(s->isr);
     516    if (isrv < 0)
     517        isrv = 0;
     518    return isrv;
     519}
     520
    511521static int apic_get_arb_pri(APICState *s)
    512522{
     
    544554
    545555#ifdef VBOX
     556
     557/* Check if the APIC has a pending interrupt/if a TPR change would active one. */
     558PDMBOTHCBDECL(bool) apicHasPendingIrq(PPDMDEVINS pDevIns)
     559{
     560    int irrv, ppr;
     561
     562    APICState *s = PDMINS2DATA(pDevIns, APICState *);
     563    if (!s)
     564        return false;
     565
     566    irrv = get_highest_priority_int(s->irr);
     567    if (irrv < 0)
     568        return false;
     569
     570    ppr = apic_get_ppr_zero_tpr(s);
     571    if (ppr && (irrv & 0xf0) <= (ppr & 0xf0))
     572        return false;
     573
     574    return true;
     575}
     576
    546577static void apic_update_tpr(APICState *s, uint32_t val)
    547578{
     
    762793    return intno;
    763794}
    764 
    765 /* Check if the APIC has a pending interrupt/if a TPR change would active one. */
    766 PDMBOTHCBDECL(bool) apicHasPendingIrq(PPDMDEVINS pDevIns)
    767 {
    768     int irrv;
    769 
    770     APICState *s = PDMINS2DATA(pDevIns, APICState *);
    771     if (!s)
    772         return false;
    773 
    774     irrv = get_highest_priority_int(s->irr);
    775     return irrv >= 0;
    776 }
    777 
    778795
    779796static uint32_t apic_get_current_count(APICState *s)
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