VirtualBox

Changeset 11212 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 7, 2008 4:19:03 PM (17 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
34259
Message:

DevRTC: Use CFGM*Def.

File:
1 edited

Legend:

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

    r11211 r11212  
    827827     * Init the data.
    828828     */
    829     rc = CFGMR3QueryU8(pCfgHandle, "Irq", &u8Irq);
    830     if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    831         u8Irq = 8;
    832     else if (RT_FAILURE(rc))
     829    rc = CFGMR3QueryU8Def(pCfgHandle, "Irq", &u8Irq, 8);
     830    if (RT_FAILURE(rc))
    833831        return PDMDEV_SET_ERROR(pDevIns, rc,
    834832                                N_("Configuration error: Querying \"Irq\" as a uint8_t failed"));
    835833
    836     rc = CFGMR3QueryU16(pCfgHandle, "Base", &u16Base);
    837     if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    838         u16Base = 0x70;
    839     else if (RT_FAILURE(rc))
     834    rc = CFGMR3QueryU16Def(pCfgHandle, "Base", &u16Base, 0x70);
     835    if (RT_FAILURE(rc))
    840836        return PDMDEV_SET_ERROR(pDevIns, rc,
    841837                                N_("Configuration error: Querying \"Base\" as a uint16_t failed"));
    842838
    843     rc = CFGMR3QueryBool(pCfgHandle, "GCEnabled", &fGCEnabled);
    844     if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    845         fGCEnabled = true;
    846     else if (RT_FAILURE(rc))
     839    rc = CFGMR3QueryBoolDef(pCfgHandle, "GCEnabled", &fGCEnabled, true);
     840    if (RT_FAILURE(rc))
    847841        return PDMDEV_SET_ERROR(pDevIns, rc,
    848842                                N_("Configuration error: failed to read GCEnabled as boolean"));
    849843
    850     rc = CFGMR3QueryBool(pCfgHandle, "R0Enabled", &fR0Enabled);
    851     if (rc == VERR_CFGM_VALUE_NOT_FOUND)
    852         fR0Enabled = true;
    853     else if (RT_FAILURE(rc))
     844    rc = CFGMR3QueryBoolDef(pCfgHandle, "R0Enabled", &fR0Enabled, true);
     845    if (RT_FAILURE(rc))
    854846        return PDMDEV_SET_ERROR(pDevIns, rc,
    855847                                N_("Configuration error: failed to read R0Enabled as boolean"));
    856848
    857     Log(("CMOS: fGCEnabled=%d fR0Enabled=%d\n", fGCEnabled, fR0Enabled));
     849    Log(("RTC: Irq=%#x Base=%#x fGCEnabled=%RTbool fR0Enabled=%RTbool\n", u8Irq, u16Base, fGCEnabled, fR0Enabled));
    858850
    859851
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