Changeset 6188 in vbox
- Timestamp:
- Dec 27, 2007 3:29:12 PM (17 years ago)
- Location:
- trunk/src/VBox/Devices/Serial
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Serial/DevSerial.cpp
r6131 r6188 146 146 int thr_ipending; 147 147 int irq; 148 bool msr_changed; 148 149 149 150 bool fGCEnabled; … … 182 183 } else if (s->thr_ipending && (s->ier & UART_IER_THRI)) { 183 184 s->iir = UART_IIR_THRI; 185 } else if (s->msr_changed && (s->ier & UART_IER_RLSI)) { 186 s->iir = UART_IIR_RLSI; 184 187 } else { 185 188 s->iir = UART_IIR_NO_INT; … … 281 284 { 282 285 int break_enable; 283 s->lcr = val; 284 serial_update_parameters(s); 286 if (s->lcr != val) 287 { 288 s->lcr = val; 289 serial_update_parameters(s); 290 } 285 291 break_enable = (val >> 6) & 1; 286 292 if (break_enable != s->last_break_enable) { … … 375 381 /* Reset delta bits. */ 376 382 s->msr &= ~UART_MSR_ANY_DELTA; 383 s->msr_changed = false; 384 serial_update_irq(s); 377 385 } 378 386 break; … … 425 433 SerialState *pData = PDMICHARPORT_2_SERIALSTATE(pInterface); 426 434 uint8_t newMsr = 0; 435 436 Log(("%s: pInterface=%p newStatusLines=%u\n", __FUNCTION__, pInterface, newStatusLines)); 427 437 428 438 PDMCritSectEnter(&pData->CritSect, VERR_PERMISSION_DENIED); … … 449 459 450 460 pData->msr = newMsr; 461 pData->msr_changed = true; 451 462 serial_update_irq(pData); 452 463 … … 713 724 */ 714 725 if (!CFGMR3AreValuesValid(pCfgHandle, "IRQ\0IOBase\0")) 726 { 727 AssertMsgFailed(("serialConstruct Invalid configuration values\n")); 715 728 return VERR_PDM_DEVINS_UNKNOWN_CFG_VALUES; 729 } 716 730 717 731 rc = CFGMR3QueryBool(pCfgHandle, "GCEnabled", &pData->fGCEnabled); … … 749 763 return rc; 750 764 751 /** @todo r=bird: Check for VERR_CFGM_VALUE_NOT_FOUND and provide sensible defaults.752 * Also do AssertMsgFailed(("Configuration error:....)) in the failure cases of CFGMR3Query*()753 * and CFGR3AreValuesValid() like we're doing in the other devices. */754 765 rc = CFGMR3QueryU8 (pCfgHandle, "IRQ", &irq_lvl); 755 if (VBOX_FAILURE (rc)) 756 return rc; 766 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 767 { 768 /* Provide sensible defaults. */ 769 if (iInstance == 0) 770 irq_lvl = 4; 771 else if (iInstance == 1) 772 irq_lvl = 3; 773 } 774 else if (VBOX_FAILURE(rc)) 775 return PDMDEV_SET_ERROR(pDevIns, rc, 776 N_("Configuration error: Failed to get the \"IRQ\" value")); 757 777 758 778 rc = CFGMR3QueryU16 (pCfgHandle, "IOBase", &io_base); 759 if (VBOX_FAILURE (rc)) 760 return rc; 779 if (rc == VERR_CFGM_VALUE_NOT_FOUND) 780 { 781 if (iInstance == 0) 782 io_base = 0x3f8; 783 else if (iInstance == 1) 784 io_base = 0x2f8; 785 } 786 else if (VBOX_FAILURE(rc)) 787 return PDMDEV_SET_ERROR(pDevIns, rc, 788 N_("Configuration error: Failed to get the \"IOBase\" value")); 761 789 762 790 Log(("serialConstruct instance %d iobase=%04x irq=%d\n", iInstance, io_base, irq_lvl)); -
trunk/src/VBox/Devices/Serial/DrvHostSerial.cpp
r6187 r6188 620 620 /* The status lines have changed. Notify the device. */ 621 621 DWORD dwNewStatusLinesState = 0; 622 uint 8_t uNewStatusLinesState = 0;622 uint32_t uNewStatusLinesState = 0; 623 623 624 624 /* Get the new state */
Note:
See TracChangeset
for help on using the changeset viewer.