Changeset 84689 in vbox
- Timestamp:
- Jun 5, 2020 9:07:54 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Serial/UartCore.cpp
r84281 r84689 813 813 { 814 814 int rc = VINF_SUCCESS; 815 #ifdef IN_RING3 816 bool fNotifyDrv = false; 817 #endif 815 818 816 819 if (pThis->uRegFcr & UART_REG_FCR_FIFO_EN) … … 831 834 uartIrqUpdate(pDevIns, pThis, pThisCC); 832 835 if (uartFifoUsedGet(&pThis->FifoXmit) == 1) 833 { 834 if ( pThisCC->pDrvSerial 835 && !(pThis->uRegMcr & UART_REG_MCR_LOOP)) 836 { 837 int rc2 = pThisCC->pDrvSerial->pfnDataAvailWrNotify(pThisCC->pDrvSerial); 838 if (RT_FAILURE(rc2)) 839 LogRelMax(10, ("Serial#%d: Failed to send data with %Rrc\n", pDevIns->iInstance, rc2)); 840 } 841 else 842 PDMDevHlpTimerSetRelative(pDevIns, pThis->hTimerTxUnconnected, pThis->cSymbolXferTicks, NULL); 843 } 836 fNotifyDrv = true; 844 837 #endif 845 838 } … … 856 849 pThis->fThreEmptyPending = false; 857 850 uartIrqUpdate(pDevIns, pThis, pThisCC); 858 if ( pThisCC->pDrvSerial 859 && !(pThis->uRegMcr & UART_REG_MCR_LOOP)) 860 { 861 int rc2 = pThisCC->pDrvSerial->pfnDataAvailWrNotify(pThisCC->pDrvSerial); 862 if (RT_FAILURE(rc2)) 863 LogRelMax(10, ("Serial#%d: Failed to send data with %Rrc\n", pDevIns->iInstance, rc2)); 864 } 865 else 866 PDMDevHlpTimerSetRelative(pDevIns, pThis->hTimerTxUnconnected, pThis->cSymbolXferTicks, NULL); 851 fNotifyDrv = true; 867 852 #endif 868 853 } … … 870 855 pThis->uRegThr = bVal; 871 856 } 857 858 #ifdef IN_RING3 859 if (fNotifyDrv) 860 { 861 if ( pThisCC->pDrvSerial 862 && !(pThis->uRegMcr & UART_REG_MCR_LOOP)) 863 { 864 /* Leave the device critical section before calling into the lower driver. */ 865 PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect); 866 int rc2 = pThisCC->pDrvSerial->pfnDataAvailWrNotify(pThisCC->pDrvSerial); 867 if (RT_FAILURE(rc2)) 868 LogRelMax(10, ("Serial#%d: Failed to send data with %Rrc\n", pDevIns->iInstance, rc2)); 869 PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VINF_SUCCESS); 870 } 871 else 872 PDMDevHlpTimerSetRelative(pDevIns, pThis->hTimerTxUnconnected, pThis->cSymbolXferTicks, NULL); 873 } 874 #endif 872 875 873 876 return rc; … … 1501 1504 RT_NOREF(pTimer); 1502 1505 1503 VBOXSTRICTRC rc1 = PDMDevHlpTimerLockClock2(pDevIns, pThis->hTimerRcvFifoTimeout, &pThis->CritSect,1504 VINF_SUCCESS /* must get it */);1505 AssertRCReturnVoid(VBOXSTRICTRC_VAL(rc1));1506 1507 1506 if (pThis->FifoRecv.cbUsed < pThis->FifoRecv.cbItl) 1508 1507 { … … 1510 1509 uartIrqUpdate(pDevIns, pThis, pThisCC); 1511 1510 } 1512 1513 PDMDevHlpTimerUnlockClock2(pDevIns, pThis->hTimerRcvFifoTimeout, &pThis->CritSect);1514 1511 } 1515 1512 … … 1940 1937 return VERR_PDM_MISSING_INTERFACE; 1941 1938 } 1939 PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED); 1942 1940 uartR3XferReset(pDevIns, pThis, pThisCC); 1941 PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect); 1943 1942 } 1944 1943 else if (rc == VERR_PDM_NO_ATTACHED_DRIVER) … … 1947 1946 pThisCC->pDrvSerial = NULL; 1948 1947 rc = VINF_SUCCESS; 1948 PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED); 1949 1949 uartR3XferReset(pDevIns, pThis, pThisCC); 1950 PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect); 1950 1951 LogRel(("Serial#%d: no unit\n", pDevIns->iInstance)); 1951 1952 } … … 2060 2061 * Create the receive FIFO character timeout indicator timer. 2061 2062 */ 2062 rc = PDMDevHlpTimerCreate(pDevIns, TMCLOCK_VIRTUAL _SYNC, uartR3RcvFifoTimeoutTimer, pThisCC,2063 rc = PDMDevHlpTimerCreate(pDevIns, TMCLOCK_VIRTUAL, uartR3RcvFifoTimeoutTimer, pThisCC, 2063 2064 TMTIMER_FLAGS_NO_CRIT_SECT, "UART Rcv FIFO Timer", 2064 2065 &pThis->hTimerRcvFifoTimeout); 2066 AssertRCReturn(rc, rc); 2067 2068 rc = PDMDevHlpTimerSetCritSect(pDevIns, pThis->hTimerRcvFifoTimeout, &pThis->CritSect); 2065 2069 AssertRCReturn(rc, rc); 2066 2070
Note:
See TracChangeset
for help on using the changeset viewer.