- Timestamp:
- May 31, 2010 10:06:26 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Serial/DevSerial.cpp
r29846 r29889 67 67 * Defined Constants And Macros * 68 68 *******************************************************************************/ 69 #define SERIAL_SAVED_STATE_VERSION 3 69 #define SERIAL_SAVED_STATE_VERSION_16450 3 70 #define SERIAL_SAVED_STATE_VERSION 4 70 71 71 72 #define UART_LCR_DLAB 0x80 /* Divisor latch access bit */ … … 216 217 bool fYieldOnLSRRead; 217 218 bool volatile fRecvWaiting; 219 bool f16550AEnabled; 218 220 bool Alignment3[3]; 219 221 /** Time it takes to transmit a character */ … … 459 461 break; 460 462 case 2: 463 if (!s->f16550AEnabled) 464 break; 465 461 466 val = val & 0xFF; 462 467 … … 941 946 SSMR3PutU8(pSSM, pThis->msr); 942 947 SSMR3PutU8(pSSM, pThis->scr); 948 SSMR3PutU8(pSSM, pThis->fcr); /* 16550A */ 943 949 SSMR3PutS32(pSSM, pThis->thr_ipending); 944 950 SSMR3PutS32(pSSM, pThis->irq); … … 946 952 SSMR3PutU32(pSSM, pThis->base); 947 953 SSMR3PutBool(pSSM, pThis->msr_changed); 954 955 /* Don't store: 956 * - the content of the FIFO 957 * - tsr_retry 958 */ 959 948 960 return SSMR3PutU32(pSSM, ~0); /* sanity/terminator */ 949 961 } … … 959 971 SerialState *pThis = PDMINS_2_DATA(pDevIns, SerialState *); 960 972 961 AssertMsgReturn(uVersion == SERIAL_SAVED_STATE_VERSION, ("%d\n", uVersion), VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION); 973 if (uVersion == SERIAL_SAVED_STATE_VERSION_16450) 974 { 975 pThis->f16550AEnabled = false; 976 } 977 else 978 AssertMsgReturn(uVersion == SERIAL_SAVED_STATE_VERSION, ("%d\n", uVersion), VERR_SSM_UNSUPPORTED_DATA_UNIT_VERSION); 962 979 963 980 if (uPass == SSM_PASS_FINAL) … … 971 988 SSMR3GetU8(pSSM, &pThis->msr); 972 989 SSMR3GetU8(pSSM, &pThis->scr); 990 if (uVersion > SERIAL_SAVED_STATE_VERSION_16450) 991 { 992 SSMR3GetU8(pSSM, &pThis->fcr); 993 } 973 994 SSMR3GetS32(pSSM, &pThis->thr_ipending); 974 995 } … … 1000 1021 AssertMsgReturn(u32 == ~0U, ("%#x\n", u32), VERR_SSM_DATA_UNIT_FORMAT_CHANGED); 1001 1022 1002 if (pThis->lsr & UART_LSR_DR) 1023 if ( (pThis->lsr & UART_LSR_DR) 1024 || pThis->fRecvWaiting) 1003 1025 { 1026 pThis->fRecvWaiting = false; 1004 1027 rc = RTSemEventSignal(pThis->ReceiveSem); 1005 1028 AssertRC(rc); … … 1192 1215 #endif 1193 1216 1217 pThis->f16550AEnabled = true; 1218 1194 1219 /* 1195 1220 * Initialize critical section and the semaphore. … … 1246 1271 return rc; 1247 1272 } 1248 1249 1273 1250 1274 if (pThis->fR0Enabled)
Note:
See TracChangeset
for help on using the changeset viewer.