Changeset 11222 in vbox for trunk/src/VBox/Devices/PC/DevAPIC.cpp
- Timestamp:
- Aug 7, 2008 6:12:17 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevAPIC.cpp
r11219 r11222 1679 1679 * Validate configuration. 1680 1680 */ 1681 if (!CFGMR3AreValuesValid(pCfgHandle, "IOAPIC\0 GCEnabled\0R0Enabled\0"))1681 if (!CFGMR3AreValuesValid(pCfgHandle, "IOAPIC\0" "GCEnabled\0" "R0Enabled\0")) 1682 1682 return VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES; 1683 1683 1684 rc = CFGMR3QueryBool (pCfgHandle, "IOAPIC", &fIOAPIC); 1685 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 1686 fIOAPIC = true; 1687 else if (VBOX_FAILURE (rc)) 1684 rc = CFGMR3QueryBoolDef(pCfgHandle, "IOAPIC", &fIOAPIC, true); 1685 if (RT_FAILURE(rc)) 1688 1686 return PDMDEV_SET_ERROR(pDevIns, rc, 1689 1687 N_("Configuration error: Failed to read \"IOAPIC\"")); 1690 1688 1691 rc = CFGMR3QueryBool(pCfgHandle, "GCEnabled", &fGCEnabled); 1692 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 1693 fGCEnabled = true; 1694 else 1689 rc = CFGMR3QueryBoolDef(pCfgHandle, "GCEnabled", &fGCEnabled, true); 1690 if (RT_FAILURE(rc)) 1695 1691 return PDMDEV_SET_ERROR(pDevIns, rc, 1696 1692 N_("Configuration error: Failed to query boolean value \"GCEnabled\"")); 1697 Log(("APIC: fGCEnabled=%d\n", fGCEnabled)); 1698 1699 rc = CFGMR3QueryBool(pCfgHandle, "R0Enabled", &fR0Enabled); 1700 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 1701 fR0Enabled = true; 1702 else 1693 1694 rc = CFGMR3QueryBoolDef(pCfgHandle, "R0Enabled", &fR0Enabled, true); 1695 if (RT_FAILURE(rc)) 1703 1696 return PDMDEV_SET_ERROR(pDevIns, rc, 1704 1697 N_("Configuration error: Failed to query boolean value \"R0Enabled\"")); 1705 Log(("APIC: fR0Enabled=% d\n", fR0Enabled));1698 Log(("APIC: fR0Enabled=%RTbool fGCEnabled=%RTbool fIOAPIC=%RTbool\n", fR0Enabled, fGCEnabled, fIOAPIC)); 1706 1699 1707 1700 /* … … 1764 1757 Assert(pDevIns->pDevHlp->pfnAPICRegister); 1765 1758 rc = pDevIns->pDevHlp->pfnAPICRegister(pDevIns, &ApicReg, &pData->pApicHlpR3); 1766 if ( VBOX_FAILURE(rc))1759 if (RT_FAILURE(rc)) 1767 1760 { 1768 Assert MsgFailed(("APICRegister -> %Vrc\n", rc));1761 AssertLogRelMsgFailed(("APICRegister -> %Vrc\n", rc)); 1769 1762 return rc; 1770 1763 } … … 1795 1788 rc = PDMDevHlpMMIORegister(pDevIns, pData->apicbase & ~0xfff, 0x1000, pData, 1796 1789 apicMMIOWrite, apicMMIORead, NULL, "APIC Memory"); 1797 if ( VBOX_FAILURE(rc))1790 if (RT_FAILURE(rc)) 1798 1791 return rc; 1799 1792 … … 1803 1796 rc = PDMDevHlpMMIORegisterGC(pDevIns, pData->apicbase & ~0xfff, 0x1000, 0, 1804 1797 "apicMMIOWrite", "apicMMIORead", NULL); 1805 if ( VBOX_FAILURE(rc))1798 if (RT_FAILURE(rc)) 1806 1799 return rc; 1807 1800 } … … 1812 1805 rc = PDMDevHlpMMIORegisterR0(pDevIns, pData->apicbase & ~0xfff, 0x1000, 0, 1813 1806 "apicMMIOWrite", "apicMMIORead", NULL); 1814 if ( VBOX_FAILURE(rc))1807 if (RT_FAILURE(rc)) 1815 1808 return rc; 1816 1809 } … … 1821 1814 rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL_SYNC, apicTimer, 1822 1815 "APIC Timer", &pData->CTX_SUFF(pTimer)); 1823 if ( VBOX_FAILURE(rc))1816 if (RT_FAILURE(rc)) 1824 1817 return rc; 1825 1818 pData->pTimerR0 = TMTimerR0Ptr(pData->CTX_SUFF(pTimer)); … … 1831 1824 rc = PDMDevHlpSSMRegister(pDevIns, pDevIns->pDevReg->szDeviceName, iInstance, 1 /* version */, 1832 1825 sizeof(*pData), NULL, apicSaveExec, NULL, NULL, apicLoadExec, NULL); 1833 if ( VBOX_FAILURE(rc))1826 if (RT_FAILURE(rc)) 1834 1827 return rc; 1835 1828 … … 2027 2020 * Validate and read the configuration. 2028 2021 */ 2029 if (!CFGMR3AreValuesValid(pCfgHandle, "GCEnabled\0 R0Enabled\0"))2022 if (!CFGMR3AreValuesValid(pCfgHandle, "GCEnabled\0" "R0Enabled\0")) 2030 2023 return VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES; 2031 2024 2032 rc = CFGMR3QueryBool(pCfgHandle, "GCEnabled", &fGCEnabled); 2033 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 2034 fGCEnabled = true; 2035 else if (VBOX_FAILURE(rc)) 2025 rc = CFGMR3QueryBoolDef(pCfgHandle, "GCEnabled", &fGCEnabled, true); 2026 if (RT_FAILURE(rc)) 2036 2027 return PDMDEV_SET_ERROR(pDevIns, rc, 2037 2028 N_("Configuration error: Failed to query boolean value \"GCEnabled\"")); 2038 Log(("IOAPIC: fGCEnabled=%d\n", fGCEnabled)); 2039 2040 rc = CFGMR3QueryBool(pCfgHandle, "R0Enabled", &fR0Enabled); 2041 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 2042 fR0Enabled = true; 2043 else if (VBOX_FAILURE(rc)) 2029 2030 rc = CFGMR3QueryBoolDef(pCfgHandle, "R0Enabled", &fR0Enabled, true); 2031 if (RT_FAILURE(rc)) 2044 2032 return PDMDEV_SET_ERROR(pDevIns, rc, 2045 2033 N_("Configuration error: Failed to query boolean value \"R0Enabled\"")); 2046 Log(("IOAPIC: fR0Enabled=% d\n", fR0Enabled));2034 Log(("IOAPIC: fR0Enabled=%RTbool fGCEnabled=%RTbool\n", fR0Enabled, fGCEnabled)); 2047 2035 2048 2036 /* … … 2063 2051 IoApicReg.pszSetIrqR0 = fR0Enabled ? "ioapicSetIrq" : NULL; 2064 2052 rc = pDevIns->pDevHlp->pfnIOAPICRegister(pDevIns, &IoApicReg, &s->pIoApicHlpR3); 2065 if ( VBOX_FAILURE(rc))2053 if (RT_FAILURE(rc)) 2066 2054 { 2067 2055 AssertMsgFailed(("IOAPICRegister -> %Vrc\n", rc)); … … 2074 2062 rc = PDMDevHlpMMIORegister(pDevIns, 0xfec00000, 0x1000, s, 2075 2063 ioapicMMIOWrite, ioapicMMIORead, NULL, "I/O APIC Memory"); 2076 if ( VBOX_FAILURE(rc))2064 if (RT_FAILURE(rc)) 2077 2065 return rc; 2078 2066 … … 2082 2070 rc = PDMDevHlpMMIORegisterGC(pDevIns, 0xfec00000, 0x1000, 0, 2083 2071 "ioapicMMIOWrite", "ioapicMMIORead", NULL); 2084 if ( VBOX_FAILURE(rc))2072 if (RT_FAILURE(rc)) 2085 2073 return rc; 2086 2074 } … … 2091 2079 rc = PDMDevHlpMMIORegisterR0(pDevIns, 0xfec00000, 0x1000, 0, 2092 2080 "ioapicMMIOWrite", "ioapicMMIORead", NULL); 2093 if ( VBOX_FAILURE(rc))2081 if (RT_FAILURE(rc)) 2094 2082 return rc; 2095 2083 } … … 2097 2085 rc = PDMDevHlpSSMRegister(pDevIns, pDevIns->pDevReg->szDeviceName, iInstance, 1 /* version */, 2098 2086 sizeof(*s), NULL, ioapicSaveExec, NULL, NULL, ioapicLoadExec, NULL); 2099 if ( VBOX_FAILURE(rc))2087 if (RT_FAILURE(rc)) 2100 2088 return rc; 2101 2089
Note:
See TracChangeset
for help on using the changeset viewer.