VirtualBox

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


Ignore:
Timestamp:
Aug 2, 2017 1:45:47 PM (7 years ago)
Author:
vboxsync
Message:

DevACPI: temporary sanity check

File:
1 edited

Legend:

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

    r67682 r68245  
    484484    /** SMBus Host Block Index */
    485485    uint8_t             u8SMBusBlkIdx;
     486
     487    /** @todo DEBUGGING */
     488    uint32_t            uPmTimerOld;
     489    uint32_t            uPmTimerA;
     490    uint32_t            uPmTimerB;
     491    uint32_t            Alignment5;
    486492} ACPIState;
    487493
     
    17561762    Log(("acpi: acpiPMTmrRead -> %#x\n", *pu32));
    17571763
     1764    /** @todo temporary: sanity check against running backwards */
     1765    uint32_t uOld = ASMAtomicXchgU32(&pThis->uPmTimerOld, *pu32);
     1766    if (*pu32 - uOld >= 0x10000000)
     1767    {
     1768#if defined(IN_RING0)
     1769        pThis->uPmTimerA = uOld;
     1770        pThis->uPmTimerB = *pu32;
     1771        return VERR_TM_TIMER_BAD_CLOCK;
     1772#elif defined(IN_RING3)
     1773        AssertReleaseMsgFailed(("acpiPMTmrRead: old=%08RX32, current=%08RX32\n", uOld, *pu32));
     1774#endif
     1775    }
     1776
    17581777    NOREF(pvUser); NOREF(Port);
    17591778    return rc;
     
    17611780
    17621781#ifdef IN_RING3
     1782
     1783static DECLCALLBACK(void) acpiR3Info(PPDMDEVINS pDevIns, PCDBGFINFOHLP pHlp, const char *pszArgs)
     1784{
     1785    RT_NOREF(pszArgs);
     1786    ACPIState *pThis = PDMINS_2_DATA(pDevIns, ACPIState *);
     1787    pHlp->pfnPrintf(pHlp,
     1788                    "timer: old=%08RX32, current=%08RX32\n", pThis->uPmTimerA, pThis->uPmTimerB);
     1789}
    17631790
    17641791/**
     
    40814108   else
    40824109       return PDMDEV_SET_ERROR(pDevIns, rc, N_("Failed to attach LUN #0"));
     4110
     4111    PDMDevHlpDBGFInfoRegister(pDevIns, "acpi", "ACPI info", acpiR3Info);
    40834112
    40844113    return rc;
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