Changeset 90447 in vbox for trunk/src/VBox/Devices/Serial
- Timestamp:
- Jul 31, 2021 12:44:13 AM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 146051
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Serial/UartCore.cpp
r90445 r90447 1598 1598 AssertMsg((uint32_t)cbAvail == cbAvail, ("Too much data available\n")); 1599 1599 1600 PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED); 1600 int rcLock = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED); 1601 AssertRCReturn(rcLock, rcLock); 1602 1601 1603 uint32_t cbAvailOld = ASMAtomicAddU32(&pThis->cbAvailRdr, (uint32_t)cbAvail); 1602 1604 LogFlow((" cbAvailRdr=%u -> cbAvailRdr=%u\n", cbAvailOld, cbAvail + cbAvailOld)); … … 1615 1617 } 1616 1618 } 1619 1617 1620 PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect); 1618 1619 1621 return VINF_SUCCESS; 1620 1622 } … … 1632 1634 1633 1635 /* Set the transmitter empty bit because everything was sent. */ 1634 PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED); 1636 int const rcLock = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED); 1637 AssertRCReturn(rcLock, rcLock); 1638 1635 1639 UART_REG_SET(pThis->uRegLsr, UART_REG_LSR_TEMT); 1636 1640 uartIrqUpdate(pDevIns, pThis, pThisCC); 1641 1637 1642 PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect); 1638 1643 return VINF_SUCCESS; … … 1652 1657 AssertReturn(cbRead > 0, VERR_INVALID_PARAMETER); 1653 1658 1654 PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED); 1659 int const rcLock = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED); 1660 AssertRCReturn(rcLock, rcLock); 1661 1655 1662 uartR3TxQueueCopyFrom(pDevIns, pThis, pThisCC, pvBuf, cbRead, pcbRead); 1663 1656 1664 PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect); 1657 1658 1665 LogFlowFunc(("-> VINF_SUCCESS{*pcbRead=%zu}\n", *pcbRead)); 1659 1666 return VINF_SUCCESS; … … 1670 1677 PUARTCORE pThis = pThisCC->pShared; 1671 1678 PPDMDEVINS pDevIns = pThisCC->pDevIns; 1672 1673 PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED); 1679 int const rcLock = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED); 1680 AssertRCReturn(rcLock, rcLock); 1681 1674 1682 uartR3StsLinesUpdate(pDevIns, pThis, pThisCC, fNewStatusLines); 1683 1675 1684 PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect); 1676 1685 return VINF_SUCCESS; … … 1687 1696 PUARTCORE pThis = pThisCC->pShared; 1688 1697 PPDMDEVINS pDevIns = pThisCC->pDevIns; 1689 1690 PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED); 1698 int const rcLock = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED); 1699 AssertRCReturn(rcLock, rcLock); 1700 1691 1701 UART_REG_SET(pThis->uRegLsr, UART_REG_LSR_BI); 1692 1702 uartIrqUpdate(pDevIns, pThis, pThisCC); 1703 1693 1704 PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect); 1694 1705 return VINF_SUCCESS; … … 1949 1960 return VERR_PDM_MISSING_INTERFACE; 1950 1961 } 1951 PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED); 1952 uartR3XferReset(pDevIns, pThis, pThisCC); 1953 PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect); 1962 rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED); 1963 if (RT_SUCCESS(rc)) 1964 { 1965 uartR3XferReset(pDevIns, pThis, pThisCC); 1966 PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect); 1967 } 1954 1968 } 1955 1969 else if (rc == VERR_PDM_NO_ATTACHED_DRIVER) … … 1957 1971 pThisCC->pDrvBase = NULL; 1958 1972 pThisCC->pDrvSerial = NULL; 1959 rc = VINF_SUCCESS; 1960 PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED); 1961 uartR3XferReset(pDevIns, pThis, pThisCC); 1962 PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect); 1973 rc = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED); 1974 if (RT_SUCCESS(rc)) 1975 { 1976 uartR3XferReset(pDevIns, pThis, pThisCC); 1977 PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect); 1978 } 1963 1979 LogRel(("Serial#%d: no unit\n", pDevIns->iInstance)); 1964 1980 } … … 1983 1999 pThisCC->pDrvBase = NULL; 1984 2000 pThisCC->pDrvSerial = NULL; 1985 PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED); 2001 int const rcLock = PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED); 2002 PDM_CRITSECT_RELEASE_ASSERT_RC_DEV(pDevIns, &pThis->CritSect, rcLock); 2003 1986 2004 uartR3XferReset(pDevIns, pThis, pThisCC); 2005 1987 2006 PDMDevHlpCritSectLeave(pDevIns, &pThis->CritSect); 1988 2007 }
Note:
See TracChangeset
for help on using the changeset viewer.