Changeset 75134 in vbox for trunk/src/VBox/Devices/Serial/DevSerial.cpp
- Timestamp:
- Oct 28, 2018 7:14:47 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Serial/DevSerial.cpp
r74754 r75134 184 184 { 185 185 PDEVSERIAL pThis = PDMINS_2_DATA(pDevIns, PDEVSERIAL); 186 uint8_t uIrq;186 uint8_t bIrq; 187 187 RTIOPORT PortBase; 188 188 UARTTYPE enmType; 189 int rc; 189 190 190 191 AssertMsgReturn(uVersion >= UART_SAVED_STATE_VERSION_16450, ("%d\n", uVersion), VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION); 191 192 if (uPass != SSM_PASS_FINAL) 193 { 194 SSMR3GetU8(pSSM, &uIrq); 192 if (uVersion > UART_SAVED_STATE_VERSION_LEGACY_CODE) 193 { 194 SSMR3GetU8( pSSM, &bIrq); 195 195 SSMR3GetIOPort(pSSM, &PortBase); 196 int rc = SSMR3GetU32(pSSM, (uint32_t *)&enmType);196 rc = SSMR3GetU32( pSSM, (uint32_t *)&enmType); 197 197 AssertRCReturn(rc, rc); 198 if (uPass == SSM_PASS_FINAL) 199 { 200 rc = uartR3LoadExec(&pThis->UartCore, pSSM, uVersion, uPass, NULL, NULL); 201 AssertRCReturn(rc, rc); 202 } 198 203 } 199 204 else 200 205 { 201 int rc = VINF_SUCCESS; 202 203 if (uVersion > UART_SAVED_STATE_VERSION_LEGACY_CODE) 206 enmType = uVersion > UART_SAVED_STATE_VERSION_16450 ? UARTTYPE_16550A : UARTTYPE_16450; 207 if (uPass != SSM_PASS_FINAL) 204 208 { 205 SSMR3GetU8( pSSM, &uIrq); 206 SSMR3GetIOPort(pSSM, &PortBase); 207 SSMR3GetU32( pSSM, (uint32_t *)&enmType); 208 rc = uartR3LoadExec(&pThis->UartCore, pSSM, uVersion, uPass, NULL, NULL); 209 int32_t iIrqTmp; 210 SSMR3GetS32(pSSM, &iIrqTmp); 211 uint32_t uPortBaseTmp; 212 rc = SSMR3GetU32(pSSM, &uPortBaseTmp); 213 AssertRCReturn(rc, rc); 214 215 bIrq = (uint8_t)iIrqTmp; 216 PortBase = (uint32_t)uPortBaseTmp; 209 217 } 210 218 else 211 219 { 212 if (uVersion > UART_SAVED_STATE_VERSION_16450) 213 enmType = UARTTYPE_16550A; 214 else 215 enmType = UARTTYPE_16450; 216 rc = uartR3LoadExec(&pThis->UartCore, pSSM, uVersion, uPass, &uIrq, &PortBase); 220 rc = uartR3LoadExec(&pThis->UartCore, pSSM, uVersion, uPass, &bIrq, &PortBase); 221 AssertRCReturn(rc, rc); 217 222 } 218 if (RT_SUCCESS(rc))219 { 220 /* The marker. */221 uint32_t u32;222 rc = SSMR3GetU32(pSSM, &u32);223 if (RT_FAILURE(rc))224 return rc;225 AssertMsgReturn(u32 == UINT32_MAX, ("%#x\n", u32), VERR_SSM_DATA_UNIT_FORMAT_CHANGED);226 }223 } 224 225 if (uPass == SSM_PASS_FINAL) 226 { 227 /* The marker. */ 228 uint32_t u32; 229 rc = SSMR3GetU32(pSSM, &u32); 230 AssertRCReturn(rc, rc); 231 AssertMsgReturn(u32 == UINT32_MAX, ("%#x\n", u32), VERR_SSM_DATA_UNIT_FORMAT_CHANGED); 227 232 } 228 233 … … 230 235 * Check the config. 231 236 */ 232 if ( pThis->uIrq != uIrq237 if ( pThis->uIrq != bIrq 233 238 || pThis->PortBase != PortBase 234 239 || pThis->UartCore.enmType != enmType) 235 240 return SSMR3SetCfgError(pSSM, RT_SRC_POS, 236 241 N_("Config mismatch - saved IRQ=%#x PortBase=%#x Type=%d; configured IRQ=%#x PortBase=%#x Type=%d"), 237 uIrq, PortBase, enmType, pThis->uIrq, pThis->PortBase, pThis->UartCore.enmType);242 bIrq, PortBase, enmType, pThis->uIrq, pThis->PortBase, pThis->UartCore.enmType); 238 243 239 244 return VINF_SUCCESS;
Note:
See TracChangeset
for help on using the changeset viewer.