- Timestamp:
- Aug 15, 2016 2:04:10 PM (8 years ago)
- Location:
- trunk/src/VBox/Devices
- Files:
-
- 27 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Audio/DevIchHda.cpp
r63373 r63478 1163 1163 1164 1164 #ifdef IN_RING3 1165 1165 1166 DECLINLINE(uint32_t) hdaStreamUpdateLPIB(PHDASTATE pThis, PHDASTREAM pStream, uint32_t u32LPIB) 1166 1167 { … … 1187 1188 return u32LPIB; 1188 1189 } 1189 #endif 1190 1190 1191 1191 1192 /** … … 1220 1221 } 1221 1222 1223 1222 1224 /** 1223 1225 * Retrieves the number of bytes of a FIFOW register. … … 1236 1238 } 1237 1239 1238 #ifdef RT_STRICT1239 1240 Assert(RT_IS_POWER_OF_TWO(cb)); 1240 #endif1241 1241 return cb; 1242 1242 } 1243 1243 1244 #ifdef IN_RING3 1244 1245 1245 /** 1246 1246 * Fetches the next BDLE to use for a stream. … … 1259 1259 LogFlowFuncEnter(); 1260 1260 1261 # ifdef DEBUG1262 uint32_t uOldBDLE = pStream->State.uCurBDLE;1263 # endif1261 # ifdef LOG_ENABLED 1262 uint32_t const uOldBDLE = pStream->State.uCurBDLE; 1263 # endif 1264 1264 1265 1265 PHDABDLE pBDLE = &pStream->State.BDLE; … … 1282 1282 int rc = hdaBDLEFetch(pThis, pBDLE, pStream->u64BDLBase, pStream->State.uCurBDLE); 1283 1283 1284 #ifdef DEBUG1285 1284 LogFlowFunc(("[SD%RU8]: uOldBDLE=%RU16, uCurBDLE=%RU16, LVI=%RU32, rc=%Rrc, %R[bdle]\n", 1286 1285 pStream->u8SD, uOldBDLE, pStream->State.uCurBDLE, pStream->u16LVI, rc, pBDLE)); 1287 #endif1288 1289 1286 return rc; 1290 1287 } 1291 #endif /* IN_RING3 */ 1288 1292 1289 1293 1290 /** … … 1313 1310 } 1314 1311 1312 1315 1313 /** 1316 1314 * Returns the HDA stream of specified stream descriptor number. … … 1328 1326 return &pThis->aStreams[uSD]; 1329 1327 } 1328 1330 1329 1331 1330 /** … … 1356 1355 AssertPtrReturn(pStream, 0); 1357 1356 1358 # ifdef VBOX_HDA_WITH_FIFO1357 # ifdef VBOX_HDA_WITH_FIFO 1359 1358 return hdaSDFIFOWToBytes(HDA_STREAM_REG(pThis, FIFOW, pStream->u8SD)); 1360 # else1359 # else 1361 1360 return 0; 1362 #endif 1363 } 1361 # endif 1362 } 1363 1364 #endif /* IN_RING3 */ 1364 1365 1365 1366 static int hdaProcessInterrupt(PHDASTATE pThis) … … 1511 1512 1512 1513 #ifdef IN_RING3 1514 1513 1515 static int hdaCmdSync(PHDASTATE pThis, bool fLocal) 1514 1516 { … … 1524 1526 if (RT_FAILURE(rc)) 1525 1527 AssertRCReturn(rc, rc); 1526 # ifdef DEBUG_CMD_BUFFER1528 # ifdef DEBUG_CMD_BUFFER 1527 1529 uint8_t i = 0; 1528 1530 do … … 1545 1547 i += 8; 1546 1548 } while(i != 0); 1547 # endif1549 # endif 1548 1550 } 1549 1551 else … … 1553 1555 if (RT_FAILURE(rc)) 1554 1556 AssertRCReturn(rc, rc); 1555 # ifdef DEBUG_CMD_BUFFER1557 # ifdef DEBUG_CMD_BUFFER 1556 1558 uint8_t i = 0; 1557 1559 do { … … 1569 1571 i += 8; 1570 1572 } while (i != 0); 1571 # endif1573 # endif 1572 1574 } 1573 1575 return rc; … … 1700 1702 pStream->u8SD, pStream->u64BDLBase, pStream->u32CBL, pStream->u16LVI, pStream->u16FIFOS)); 1701 1703 1702 # ifdef DEBUG1704 # ifdef DEBUG 1703 1705 uint64_t u64BaseDMA = RT_MAKE_U64(HDA_STREAM_REG(pThis, BDPL, pStream->u8SD), 1704 1706 HDA_STREAM_REG(pThis, BDPU, pStream->u8SD)); … … 1709 1711 1710 1712 hdaBDLEDumpAll(pThis, u64BaseDMA, u16LVI + 1); 1711 # endif1713 # endif 1712 1714 1713 1715 return VINF_SUCCESS; … … 1721 1723 const uint8_t uSD = pStream->u8SD; 1722 1724 1723 # ifdef VBOX_STRICT1725 # ifdef VBOX_STRICT 1724 1726 AssertReleaseMsg(!RT_BOOL(HDA_STREAM_REG(pThis, CTL, uSD) & HDA_REG_FIELD_FLAG_MASK(SDCTL, RUN)), 1725 1727 ("[SD%RU8] Cannot reset stream while in running state\n", uSD)); 1726 # endif1728 # endif 1727 1729 1728 1730 LogFunc(("[SD%RU8]: Reset\n", uSD)); … … 1770 1772 } 1771 1773 1772 # if 0 /* unused */1774 # if 0 /* unused */ 1773 1775 static bool hdaStreamIsActive(PHDASTATE pThis, PHDASTREAM pStream) 1774 1776 { … … 1781 1783 return fActive; 1782 1784 } 1783 # endif1785 # endif 1784 1786 1785 1787 static int hdaStreamSetActive(PHDASTATE pThis, PHDASTREAM pStream, bool fActive) … … 1824 1826 pThis->cStreamsActive--; 1825 1827 1826 # ifndef VBOX_WITH_AUDIO_CALLBACKS1828 # ifndef VBOX_WITH_AUDIO_CALLBACKS 1827 1829 hdaTimerMaybeStop(pThis); 1828 # endif1830 # endif 1829 1831 } 1830 1832 else 1831 1833 { 1832 1834 pThis->cStreamsActive++; 1833 # ifndef VBOX_WITH_AUDIO_CALLBACKS1835 # ifndef VBOX_WITH_AUDIO_CALLBACKS 1834 1836 hdaTimerMaybeStart(pThis); 1835 # endif1837 # endif 1836 1838 } 1837 1839 … … 1854 1856 } 1855 1857 1856 # if 0 /** @todo hdaStreamStart is unused */1858 # if 0 /** @todo hdaStreamStart is unused */ 1857 1859 static int hdaStreamStart(PHDASTREAM pStream) 1858 1860 { … … 1865 1867 return VINF_SUCCESS; 1866 1868 } 1867 # endif /* unused */1869 # endif /* unused */ 1868 1870 1869 1871 static int hdaStreamStop(PHDASTREAM pStream) … … 1876 1878 return VINF_SUCCESS; 1877 1879 1878 # if 0 /** @todo Does not work (yet), as EMT deadlocks then. */1880 # if 0 /** @todo Does not work (yet), as EMT deadlocks then. */ 1879 1881 /* 1880 1882 * Wait for the stream to stop. … … 1893 1895 pStream->u8Strm, fActive ? "active" : "stopped", rc)); 1894 1896 } 1895 # else1897 # else 1896 1898 int rc = VINF_SUCCESS; 1897 # endif1899 # endif 1898 1900 1899 1901 LogFlowFuncLeaveRC(rc); … … 1901 1903 } 1902 1904 1903 # if defined(VBOX_WITH_HDA_INTERLEAVING_STREAMS_SUPPORT) || defined(VBOX_WITH_HDA_51_SURROUND)1905 # if defined(VBOX_WITH_HDA_INTERLEAVING_STREAMS_SUPPORT) || defined(VBOX_WITH_HDA_51_SURROUND) 1904 1906 static int hdaStreamChannelExtract(PPDMAUDIOSTREAMCHANNEL pChan, const void *pvBuf, size_t cbBuf) 1905 1907 { … … 1949 1951 return VINF_SUCCESS; 1950 1952 } 1951 # endif /* defined(VBOX_WITH_HDA_INTERLEAVING_STREAMS_SUPPORT) || defined(VBOX_WITH_HDA_51_SURROUND) */1952 1953 # if 0 /** @todo hdaStreamChannelAdvance is unused */1953 # endif /* defined(VBOX_WITH_HDA_INTERLEAVING_STREAMS_SUPPORT) || defined(VBOX_WITH_HDA_51_SURROUND) */ 1954 1955 # if 0 /** @todo hdaStreamChannelAdvance is unused */ 1954 1956 static int hdaStreamChannelAdvance(PPDMAUDIOSTREAMCHANNEL pChan, size_t cbAdv) 1955 1957 { … … 1961 1963 return VINF_SUCCESS; 1962 1964 } 1963 # endif1965 # endif 1964 1966 1965 1967 static int hdaStreamChannelDataInit(PPDMAUDIOSTREAMCHANNELDATA pChanData, uint32_t fFlags) … … 1993 1995 } 1994 1996 1995 # if defined(VBOX_WITH_HDA_INTERLEAVING_STREAMS_SUPPORT) || defined(VBOX_WITH_HDA_51_SURROUND)1997 # if defined(VBOX_WITH_HDA_INTERLEAVING_STREAMS_SUPPORT) || defined(VBOX_WITH_HDA_51_SURROUND) 1996 1998 1997 1999 static int hdaStreamChannelAcquireData(PPDMAUDIOSTREAMCHANNELDATA pChanData, void *pvData, size_t *pcbData) … … 2015 2017 } 2016 2018 2017 # endif /* defined(VBOX_WITH_HDA_INTERLEAVING_STREAMS_SUPPORT) || defined(VBOX_WITH_HDA_51_SURROUND) */2019 # endif /* defined(VBOX_WITH_HDA_INTERLEAVING_STREAMS_SUPPORT) || defined(VBOX_WITH_HDA_51_SURROUND) */ 2018 2020 2019 2021 # if 0 /* currently unused */ -
trunk/src/VBox/Devices/Audio/DevSB16.cpp
r63215 r63478 416 416 } 417 417 418 #if def DEBUG419 static inline voidlog_dsp(PSB16STATE pThis)418 #if 0 // unused // def DEBUG 419 DECLINLINE(void) log_dsp(PSB16STATE pThis) 420 420 { 421 421 LogFlowFunc(("%s:%s:%d:%s:dmasize=%d:freq=%d:const=%d:speaker=%d\n", -
trunk/src/VBox/Devices/Bus/DevPciIch9.cpp
r62889 r63478 541 541 } 542 542 543 #ifdef IN_RING3 544 543 545 /* return the global irq number corresponding to a given device irq 544 546 pin. We could also use the bus number to have a more precise … … 553 555 /* irqs corresponding to PCI irqs A-D, must match pci_irq_list in rombios.c */ 554 556 static const uint8_t aPciIrqs[4] = { 11, 10, 9, 5 }; 557 558 #endif /* IN_RING3 */ 555 559 556 560 /* Add one more level up request on APIC input line */ -
trunk/src/VBox/Devices/Bus/MsiCommon.cpp
r62885 r63478 99 99 } 100 100 101 #ifdef IN_RING3 102 101 103 DECLINLINE(bool) msiBitJustCleared(uint32_t uOldValue, 102 104 uint32_t uNewValue, … … 113 115 } 114 116 115 #ifdef IN_RING3116 117 void MsiPciConfigWrite(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPCIDEVICE pDev, 117 118 uint32_t u32Address, uint32_t val, unsigned len) -
trunk/src/VBox/Devices/EFI/DevEFI.cpp
r63016 r63478 1909 1909 } 1910 1910 1911 1912 #if 0 /* unused */ 1911 1913 /** 1912 1914 * Helper that searches for a FFS file of a given type. … … 1922 1924 efiFwVolFindFileByType(EFI_FFS_FILE_HEADER const *pFfsFile, uint8_t const *pbEnd, EFI_FV_FILETYPE FileType, uint32_t *pcbFile) 1923 1925 { 1924 # define FFS_SIZE(hdr) RT_MAKE_U32_FROM_U8((hdr)->Size[0], (hdr)->Size[1], (hdr)->Size[2], 0)1926 # define FFS_SIZE(hdr) RT_MAKE_U32_FROM_U8((hdr)->Size[0], (hdr)->Size[1], (hdr)->Size[2], 0) 1925 1927 while ((uintptr_t)pFfsFile < (uintptr_t)pbEnd) 1926 1928 { … … 1933 1935 pFfsFile = (EFI_FFS_FILE_HEADER *)((uintptr_t)pFfsFile + RT_ALIGN(FFS_SIZE(pFfsFile), 8)); 1934 1936 } 1935 # undef FFS_SIZE1937 # undef FFS_SIZE 1936 1938 return NULL; 1937 1939 } 1940 #endif /* unused */ 1938 1941 1939 1942 -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp
r63421 r63478 3106 3106 default: 3107 3107 # ifdef VBOX_WITH_VMSVGA3D 3108 if ( enmCmdId >= SVGA_3D_CMD_BASE3109 && enmCmdId < SVGA_3D_CMD_MAX)3108 if ( (int)enmCmdId >= SVGA_3D_CMD_BASE 3109 && (int)enmCmdId < SVGA_3D_CMD_MAX) 3110 3110 { 3111 3111 /* All 3d commands start with a common header, which defines the size of the command. */ -
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
r63211 r63478 1090 1090 1091 1091 #ifdef RT_OS_DARWIN 1092 RT_NOREF(pOldViewport); 1092 1093 PVMSVGA3DSTATE pState = pThis->svga.p3dState; 1093 1094 if ( pState … … 3601 3602 3602 3603 #elif defined(RT_OS_DARWIN) 3604 RT_NOREF(pState); 3603 3605 vmsvga3dCocoaViewSetSize(pContext->cocoaView, pThis->svga.uWidth, pThis->svga.uHeight); 3604 3606 -
trunk/src/VBox/Devices/Graphics/DevVGA.cpp
r63218 r63478 269 269 * Global Variables * 270 270 *********************************************************************************************************************************/ 271 #ifdef IN_RING3 271 272 /* "Press F12 to select boot device." bitmap. */ 272 273 static const uint8_t g_abLogoF12BootText[] = … … 306 307 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 307 308 }; 309 #endif /* IN_RING3 */ 308 310 309 311 -
trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp
r63427 r63478 1039 1039 } 1040 1040 1041 DECLINLINE(void) vboxVDMACrCtlRetain (PVBOXVDMACMD_CHROMIUM_CTL pCmd) 1041 #if 0 /* unused */ 1042 DECLINLINE(void) vboxVDMACrCtlRetain(PVBOXVDMACMD_CHROMIUM_CTL pCmd) 1042 1043 { 1043 1044 PVBOXVDMACMD_CHROMIUM_CTL_PRIVATE pHdr = VBOXVDMACMD_CHROMIUM_CTL_PRIVATE_FROM_CTL(pCmd); 1044 1045 ASMAtomicIncU32(&pHdr->cRefs); 1045 1046 } 1047 #endif /* unused */ 1046 1048 1047 1049 DECLINLINE(int) vboxVDMACrCtlGetRc (PVBOXVDMACMD_CHROMIUM_CTL pCmd) -
trunk/src/VBox/Devices/Graphics/shaderlib/directx.c
r62948 r63478 56 56 57 57 /* The d3d device ID */ 58 #if 0 /* VBox: unused */ 58 59 static const GUID IID_D3DDEVICE_D3DUID = { 0xaeb2cdd4, 0x6e41, 0x43ea, { 0x94,0x1c,0x83,0x61,0xcc,0x76,0x07,0x81 } }; 60 #endif 59 61 60 62 … … 904 906 }; 905 907 908 #if 0 /* VBox: unused */ 906 909 static const struct driver_version_information driver_version_table[] = 907 910 { … … 960 963 /* TODO: Add information about legacy ATI hardware, Intel and other cards. */ 961 964 }; 965 #endif /* VBox: unused */ 962 966 963 967 -
trunk/src/VBox/Devices/Input/PS2K.cpp
r62885 r63478 267 267 } key_def; 268 268 269 270 /********************************************************************************************************************************* 271 * Global Variables * 272 *********************************************************************************************************************************/ 273 #ifdef IN_RING3 269 274 /* USB to PS/2 conversion table for regular keys. */ 270 275 static const key_def aPS2Keys[] = { … … 461 466 }; 462 467 463 464 /********************************************************************************************************************************* 465 * Global Variables * 466 *********************************************************************************************************************************/ 467 468 469 /********************************************************************************************************************************* 470 * Internal Functions * 471 *********************************************************************************************************************************/ 468 #endif /* IN_RING3 */ 469 472 470 473 471 -
trunk/src/VBox/Devices/Input/UsbKbd.cpp
r62956 r63478 463 463 464 464 465 #if 0 /* unused */ 465 466 /** 466 467 * Checks if the queue is empty or not. … … 473 474 return pQueue->pHead == NULL; 474 475 } 476 #endif /* unused */ 475 477 476 478 -
trunk/src/VBox/Devices/Input/UsbMouse.cpp
r62956 r63478 1071 1071 1072 1072 1073 #if 0 /* unused */ 1073 1074 /** 1074 1075 * Checks if the queue is empty or not. … … 1081 1082 return pQueue->pHead == NULL; 1082 1083 } 1084 #endif /* unused */ 1083 1085 1084 1086 -
trunk/src/VBox/Devices/Network/DevE1000.cpp
r63218 r63478 218 218 #define E1K_CHIP_82545EM 2 219 219 220 #ifdef IN_RING3 220 221 /** Different E1000 chips. */ 221 222 static const struct E1kChips … … 226 227 uint16_t uPCISubsystemId; 227 228 const char *pcszName; 228 } g_ Chips[] =229 } g_aChips[] = 229 230 { 230 231 /* Vendor Device SSVendor SubSys Name */ 231 232 { 0x8086, 232 233 /* Temporary code, as MSI-aware driver dislike 0x100E. How to do that right? */ 233 # ifdef E1K_WITH_MSI234 # ifdef E1K_WITH_MSI 234 235 0x105E, 235 # else236 # else 236 237 0x100E, 237 # endif238 # endif 238 239 0x8086, 0x001E, "82540EM" }, /* Intel 82540EM-A in Intel PRO/1000 MT Desktop */ 239 240 { 0x8086, 0x1004, 0x8086, 0x1004, "82543GC" }, /* Intel 82543GC in Intel PRO/1000 T Server */ 240 241 { 0x8086, 0x100F, 0x15AD, 0x0750, "82545EM" } /* Intel 82545EM-A in VMWare Network Adapter */ 241 242 }; 243 #endif /* IN_RING3 */ 242 244 243 245 … … 1552 1554 } 1553 1555 1556 #ifdef IN_RING3 1554 1557 /** 1555 1558 * Cancel a timer. … … 1568 1571 RT_NOREF1(pThis); 1569 1572 } 1573 #endif /* IN_RING3 */ 1570 1574 1571 1575 #define e1kCsEnter(ps, rc) PDMCritSectEnter(&ps->cs, rc) … … 1748 1752 } 1749 1753 1754 1755 #if defined(E1K_WITH_RXD_CACHE) && defined(IN_RING3) /* currently only used in ring-3 due to stack space requirements of the caller */ 1750 1756 /** 1751 1757 * Dump receive descriptor to debug log. … … 1777 1783 E1K_SPEC_PRI(pDesc->status.u16Special))); 1778 1784 } 1785 #endif /* E1K_WITH_RXD_CACHE && IN_RING3 */ 1779 1786 1780 1787 /** … … 1954 1961 } 1955 1962 1963 #ifdef IN_RING3 /* currently only used in ring-3 due to stack space requirements of the caller */ 1956 1964 /** 1957 1965 * Advance the head pointer of the receive descriptor queue. … … 1992 2000 //e1kCsLeave(pThis); 1993 2001 } 2002 #endif /* IN_RING3 */ 1994 2003 1995 2004 #ifdef E1K_WITH_RXD_CACHE 2005 1996 2006 /** 1997 2007 * Return the number of RX descriptor that belong to the hardware. … … 2087 2097 } 2088 2098 2099 # ifdef IN_RING3 /* currently only used in ring-3 due to stack space requirements of the caller */ 2100 2089 2101 /** 2090 2102 * Obtain the next RX descriptor from RXD cache, fetching descriptors from the … … 2111 2123 return NULL; 2112 2124 } 2125 2113 2126 2114 2127 /** … … 2136 2149 } 2137 2150 2138 # ifdef IN_RING3 /* currently only used in ring-3 due to stack space requirements of the caller */2139 2151 /** 2140 2152 * Store a fragment of received packet at the specifed address. … … 2154 2166 STAM_PROFILE_ADV_STOP(&pThis->StatReceiveStore, a); 2155 2167 } 2168 2156 2169 # endif 2157 2170 … … 2206 2219 STAM_PROFILE_ADV_STOP(&pThis->StatReceiveStore, a); 2207 2220 } 2221 2208 2222 #endif /* !E1K_WITH_RXD_CACHE */ 2209 2223 … … 3244 3258 # ifndef E1K_NO_TAD 3245 3259 e1kCancelTimer(pThis, pThis->CTX_SUFF(pTADTimer)); 3246 # endif /* E1K_NO_TAD */3260 # endif 3247 3261 e1kRaiseInterrupt(pThis, ICR_TXDW); 3248 3262 } … … 4451 4465 /* Cancel both timers if armed and fire immediately. */ 4452 4466 e1kCancelTimer(pThis, pThis->CTX_SUFF(pTADTimer)); 4453 # endif /* E1K_NO_TAD */4467 # endif 4454 4468 #endif /* E1K_USE_TX_TIMERS */ 4455 4469 E1K_INC_ISTAT_CNT(pThis->uStatIntTx); … … 7018 7032 pHlp->pfnPrintf(pHlp, "E1000 #%d: port=%RTiop mmio=%RGp mac-cfg=%RTmac %s%s%s\n", 7019 7033 pDevIns->iInstance, pThis->IOPortBase, pThis->addrMMReg, 7020 &pThis->macConfigured, g_ Chips[pThis->eChip].pcszName,7034 &pThis->macConfigured, g_aChips[pThis->eChip].pcszName, 7021 7035 pThis->fRCEnabled ? " GC" : "", pThis->fR0Enabled ? " R0" : ""); 7022 7036 … … 7375 7389 static DECLCALLBACK(void) e1kConfigurePciDev(PPCIDEVICE pPciDev, E1KCHIP eChip) 7376 7390 { 7377 Assert(eChip < RT_ELEMENTS(g_ Chips));7391 Assert(eChip < RT_ELEMENTS(g_aChips)); 7378 7392 /* Configure PCI Device, assume 32-bit mode ******************************/ 7379 PCIDevSetVendorId(pPciDev, g_ Chips[eChip].uPCIVendorId);7380 PCIDevSetDeviceId(pPciDev, g_ Chips[eChip].uPCIDeviceId);7381 PCIDevSetWord( pPciDev, VBOX_PCI_SUBSYSTEM_VENDOR_ID, g_ Chips[eChip].uPCISubsystemVendorId);7382 PCIDevSetWord( pPciDev, VBOX_PCI_SUBSYSTEM_ID, g_ Chips[eChip].uPCISubsystemId);7393 PCIDevSetVendorId(pPciDev, g_aChips[eChip].uPCIVendorId); 7394 PCIDevSetDeviceId(pPciDev, g_aChips[eChip].uPCIDeviceId); 7395 PCIDevSetWord( pPciDev, VBOX_PCI_SUBSYSTEM_VENDOR_ID, g_aChips[eChip].uPCISubsystemVendorId); 7396 PCIDevSetWord( pPciDev, VBOX_PCI_SUBSYSTEM_ID, g_aChips[eChip].uPCISubsystemId); 7383 7397 7384 7398 PCIDevSetWord( pPciDev, VBOX_PCI_COMMAND, 0x0000); … … 7568 7582 7569 7583 LogRel(("%s Chip=%s LinkUpDelay=%ums EthernetCRC=%s GSO=%s Itr=%s ItrRx=%s R0=%s GC=%s\n", pThis->szPrf, 7570 g_ Chips[pThis->eChip].pcszName, pThis->cMsLinkUpDelay,7584 g_aChips[pThis->eChip].pcszName, pThis->cMsLinkUpDelay, 7571 7585 pThis->fEthernetCRC ? "on" : "off", 7572 7586 pThis->fGSOEnabled ? "enabled" : "disabled", -
trunk/src/VBox/Devices/Network/DevVirtioNet.cpp
r62962 r63478 274 274 AssertCompileSize(VNETCTLHDR, 2); 275 275 276 #ifdef IN_RING3 277 276 278 /** Returns true if large packets are written into several RX buffers. */ 277 279 DECLINLINE(bool) vnetMergeableRxBuffers(PVNETSTATE pThis) … … 289 291 vpciCsLeave(&pThis->VPCI); 290 292 } 293 294 #endif /* IN_RING3 */ 291 295 292 296 DECLINLINE(int) vnetCsRxEnter(PVNETSTATE pThis, int rcBusy) … … 307 311 } 308 312 313 #ifdef IN_RING3 309 314 /** 310 315 * Dump a packet to debug log. … … 317 322 DECLINLINE(void) vnetPacketDump(PVNETSTATE pThis, const uint8_t *pbPacket, size_t cb, const char *pszText) 318 323 { 319 # ifdef DEBUG324 # ifdef DEBUG 320 325 Log(("%s %s packet #%d (%d bytes):\n", 321 326 INSTANCE(pThis), pszText, ++pThis->u32PktNo, cb)); 322 327 Log3(("%.*Rhxd\n", cb, pbPacket)); 323 # else328 # else 324 329 RT_NOREF4(pThis, pbPacket, cb, pszText); 325 #endif 326 } 330 # endif 331 } 332 #endif /* IN_RING3 */ 327 333 328 334 /** -
trunk/src/VBox/Devices/Network/DrvIntNet.cpp
r63461 r63478 269 269 * @param pThis The instance data.. 270 270 */ 271 DECLINLINE(int) drv IntNetSignalXmit(PDRVINTNET pThis)271 DECLINLINE(int) drvR0IntNetSignalXmit(PDRVINTNET pThis) 272 272 { 273 273 /// @todo if (!ASMAtomicXchgBool(&pThis->fXmitSignalled, true)) - needs careful optimizing. … … 279 279 return VERR_TRY_AGAIN; 280 280 } 281 #endif 281 #endif /* !IN_RING3 */ 282 282 283 283 … … 306 306 { 307 307 ASMAtomicUoWriteBool(&pThis->fXmitProcessRing, true); 308 drv IntNetSignalXmit(pThis);308 drvR0IntNetSignalXmit(pThis); 309 309 rc = VINF_SUCCESS; 310 310 } … … 351 351 rc = VERR_TRY_AGAIN; 352 352 #else /* IN_RING0 */ 353 rc = drv IntNetSignalXmit(pThis);353 rc = drvR0IntNetSignalXmit(pThis); 354 354 #endif /* IN_RING0 */ 355 355 } … … 381 381 PPDMSCATTERGATHER pSgBuf = &pThis->u.Sg; 382 382 if (RT_UNLIKELY(pSgBuf->fFlags != 0)) 383 return drv IntNetSignalXmit(pThis);383 return drvR0IntNetSignalXmit(pThis); 384 384 #endif 385 385 … … 444 444 { 445 445 pThis->fXmitProcessRing = true; 446 rc = drv IntNetSignalXmit(pThis);446 rc = drvR0IntNetSignalXmit(pThis); 447 447 } 448 448 else -
trunk/src/VBox/Devices/Network/DrvNAT.cpp
r63214 r63478 1145 1145 else 1146 1146 LogRel(("NAT: DNS server list is empty (2)\n")); 1147 #else 1148 RT_NOREF(hDynStor); 1147 1149 #endif 1148 1150 drvNATUpdateDNS(pThis, /* fFlapLink */ true); -
trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp
r63458 r63478 897 897 return Addr.u == UINT32_MAX; 898 898 } 899 #endif 899 #endif /* unused */ 900 900 901 901 … … 1032 1032 return intnetR0IfAddrCacheLookup(pCache, pAddr, cbAddr); 1033 1033 } 1034 1035 1034 1036 1035 #if 0 /* unused */ … … 1220 1219 1221 1220 #if 0 /* unused */ 1222 1223 1221 /** 1224 1222 * Deletes the address from all the interface caches except the specified one. … … 1252 1250 RTSpinlockRelease(pNetwork->hAddrSpinlock); 1253 1251 } 1254 1255 #endif 1252 #endif /* unused */ 1256 1253 1257 1254 -
trunk/src/VBox/Devices/Network/slirp/ip_icmp.c
r63459 r63478 64 64 /* The message sent when emulating PING */ 65 65 /* Be nice and tell them it's just a psuedo-ping packet */ 66 #if 0 66 #if 0 /* unused */ 67 67 static const char icmp_ping_msg[] = "This is a psuedo-PING packet used by Slirp to emulate ICMP ECHO-REQUEST packets.\n"; 68 68 #endif -
trunk/src/VBox/Devices/Network/slirp/tftp.c
r63014 r63478 196 196 197 197 198 #if 0 /* unused */ 198 199 DECLINLINE(bool) tftpIsAcceptableOption(const char *pszOptionName) 199 200 { … … 214 215 return false; 215 216 } 217 #endif /* unused */ 216 218 217 219 -
trunk/src/VBox/Devices/PC/DevRTC.cpp
r62890 r63478 264 264 265 265 266 #ifdef IN_RING3 266 267 DECLINLINE(int) to_bcd(PRTCSTATE pThis, int a) 267 268 { … … 270 271 return ((a / 10) << 4) | (a % 10); 271 272 } 273 #endif 272 274 273 275 -
trunk/src/VBox/Devices/Storage/DevAHCI.cpp
r63218 r63478 5476 5476 } 5477 5477 5478 #if 0 /* unused */ 5478 5479 DECLINLINE(uint8_t) ahciGetTagQueued(uint8_t *pCmdFis) 5479 5480 { 5480 5481 return pCmdFis[AHCI_CMDFIS_SECTC] >> 3; 5481 5482 } 5483 #endif /* unused */ 5482 5484 5483 5485 /** -
trunk/src/VBox/Devices/Storage/DevATA.cpp
r62925 r63478 548 548 549 549 550 #ifdef IN_RING3 550 551 DECLINLINE(void) ataSetStatusValue(ATADevState *s, uint8_t stat) 551 552 { … … 559 560 } 560 561 } 562 #endif /* IN_RING3 */ 561 563 562 564 … … 722 724 static const ATARequest g_ataDMARequest = { ATA_AIO_DMA, { { 0, 0, 0, 0, 0 } } }; 723 725 static const ATARequest g_ataPIORequest = { ATA_AIO_PIO, { { 0, 0, 0, 0, 0 } } }; 726 # ifdef IN_RING3 724 727 static const ATARequest g_ataResetARequest = { ATA_AIO_RESET_ASSERTED, { { 0, 0, 0, 0, 0 } } }; 725 728 static const ATARequest g_ataResetCRequest = { ATA_AIO_RESET_CLEARED, { { 0, 0, 0, 0, 0 } } }; 729 # endif 726 730 727 731 # ifdef IN_RING3 … … 1166 1170 } 1167 1171 1172 1173 #if 0 /* unused */ 1168 1174 /** 1169 1175 * Compares two MSF values. … … 1193 1199 return iRes; 1194 1200 } 1201 #endif /* unused */ 1195 1202 1196 1203 static void ataR3CmdOK(ATADevState *s, uint8_t status) -
trunk/src/VBox/Devices/Storage/DevBusLogic.cpp
r63218 r63478 304 304 #define ISA_BASE_DISABLED 6 305 305 306 #ifdef IN_RING3 306 307 static uint16_t const g_aISABases[NUM_ISA_BASES] = 307 308 { 308 309 0x330, 0x334, 0x230, 0x234, 0x130, 0x134, 0, 0 309 310 }; 311 #endif 310 312 /** @} */ 311 313 -
trunk/src/VBox/Devices/Storage/DrvHostBase.cpp
r62956 r63478 664 664 static void drvHostBaseDADoneCallback(DADiskRef DiskRef, DADissenterRef DissenterRef, void *pvContext) 665 665 { 666 RT_NOREF(DiskRef); 666 667 int *prc = (int *)pvContext; 667 668 if (!DissenterRef) … … 792 793 { 793 794 # ifdef RT_OS_DARWIN 795 RT_NOREF(fReadOnly); 796 794 797 /* Darwin is kind of special... */ 795 798 Assert(!pFileDevice); NOREF(pFileDevice); 796 799 Assert(!pThis->cbBlock); 797 Assert( !pThis->MasterPort);800 Assert(pThis->MasterPort == IO_OBJECT_NULL); 798 801 Assert(!pThis->ppMMCDI); 799 802 Assert(!pThis->ppScsiTaskDI); … … 818 821 * do the search and get a collection of keyboards. 819 822 */ 820 io_iterator_t DVDServices = NULL;823 io_iterator_t DVDServices = IO_OBJECT_NULL; 821 824 IOReturn irc = IOServiceGetMatchingServices(pThis->MasterPort, RefMatchingDict, &DVDServices); 822 825 AssertMsgReturn(irc == kIOReturnSuccess, ("irc=%d\n", irc), VERR_NOT_FOUND); … … 1138 1141 RTFileClose(pThis->hFileDevice); 1139 1142 pThis->hFileDevice = hFileDevice; 1140 #endif /* !RT_OS_DARWIN */ 1143 #else /* RT_OS_DARWIN */ 1144 RT_NOREF(pThis); 1145 #endif /* RT_OS_DARWIN */ 1141 1146 return VINF_SUCCESS; 1142 1147 } … … 1792 1797 pThis->ppMMCDI = NULL; 1793 1798 } 1794 if (pThis->MasterPort )1799 if (pThis->MasterPort != IO_OBJECT_NULL) 1795 1800 { 1796 1801 mach_port_deallocate(mach_task_self(), pThis->MasterPort); 1797 pThis->MasterPort = 0;1802 pThis->MasterPort = IO_OBJECT_NULL; 1798 1803 } 1799 1804 if (pThis->pDASession) … … 1875 1880 pThis->ThreadPoller = NIL_RTTHREAD; 1876 1881 #ifdef RT_OS_DARWIN 1877 pThis->MasterPort = NULL;1882 pThis->MasterPort = IO_OBJECT_NULL; 1878 1883 pThis->ppMMCDI = NULL; 1879 1884 pThis->ppScsiTaskDI = NULL; -
trunk/src/VBox/Devices/USB/DevOHCI.cpp
r63016 r63478 772 772 #ifndef VBOX_DEVICE_STRUCT_TESTCASE 773 773 774 #ifdef VBOX_WITH_OHCI_PHYS_READ_STATS 775 /* 776 * Explain 777 */ 778 typedef struct OHCIDESCREADSTATS 779 { 780 uint32_t cReads; 781 uint32_t cPageChange; 782 uint32_t cMinReadsPerPage; 783 uint32_t cMaxReadsPerPage; 784 785 uint32_t cReadsLastPage; 786 uint32_t u32LastPageAddr; 787 } OHCIDESCREADSTATS; 788 typedef OHCIDESCREADSTATS *POHCIDESCREADSTATS; 789 790 typedef struct OHCIPHYSREADSTATS 791 { 792 OHCIDESCREADSTATS ed; 793 OHCIDESCREADSTATS td; 794 OHCIDESCREADSTATS all; 795 796 uint32_t cCrossReads; 797 uint32_t cCacheReads; 798 uint32_t cPageReads; 799 } OHCIPHYSREADSTATS; 800 typedef OHCIPHYSREADSTATS *POHCIPHYSREADSTATS; 801 typedef OHCIPHYSREADSTATS const *PCOHCIPHYSREADSTATS; 802 #endif /* VBOX_WITH_OHCI_PHYS_READ_STATS */ 803 774 804 775 805 /********************************************************************************************************************************* 776 806 * Global Variables * 777 807 *********************************************************************************************************************************/ 808 #if defined(VBOX_WITH_OHCI_PHYS_READ_STATS) && defined(IN_RING3) 809 static OHCIPHYSREADSTATS g_PhysReadState; 810 #endif 811 778 812 #if defined(LOG_ENABLED) && defined(IN_RING3) 779 813 static bool g_fLogBulkEPs = false; … … 873 907 } 874 908 909 #ifdef IN_RING3 910 875 911 /** 876 912 * Set an interrupt, use the wrapper ohciSetInterrupt. … … 895 931 * Set an interrupt wrapper macro for logging purposes. 896 932 */ 897 #define ohciSetInterrupt(ohci, a_rcBusy, intr) ohciSetInterruptInt(ohci, a_rcBusy, intr, #intr) 898 #define ohciR3SetInterrupt(ohci, intr) ohciSetInterruptInt(ohci, VERR_IGNORED, intr, #intr) 899 900 #ifdef IN_RING3 933 # define ohciR3SetInterrupt(ohci, intr) ohciSetInterruptInt(ohci, VERR_IGNORED, intr, #intr) 934 901 935 902 936 /* Carry out a hardware remote wakeup */ … … 1217 1251 VUSBIDevReset(pThis->RootHub.pIDev, fResetOnLinux, NULL, NULL, NULL); 1218 1252 } 1219 #endif /* IN_RING3 */1220 1253 1221 1254 /** … … 1243 1276 { 1244 1277 ohciPhysRead(pThis, Addr, pau32s, c32s * sizeof(uint32_t)); 1245 # ifndef RT_LITTLE_ENDIAN1278 # ifndef RT_LITTLE_ENDIAN 1246 1279 for(int i = 0; i < c32s; i++) 1247 1280 pau32s[i] = RT_H2LE_U32(pau32s[i]); 1248 # endif1281 # endif 1249 1282 } 1250 1283 … … 1254 1287 DECLINLINE(void) ohciPutDWords(POHCI pThis, uint32_t Addr, const uint32_t *pau32s, int cu32s) 1255 1288 { 1256 # ifdef RT_LITTLE_ENDIAN1289 # ifdef RT_LITTLE_ENDIAN 1257 1290 ohciPhysWrite(pThis, Addr, pau32s, cu32s << 2); 1258 # else1291 # else 1259 1292 for (int i = 0; i < c32s; i++, pau32s++, Addr += sizeof(*pau32s)) 1260 1293 { … … 1262 1295 ohciPhysWrite(pThis, Addr, (uint8_t *)&u32Tmp, sizeof(u32Tmp)); 1263 1296 } 1264 #endif 1265 } 1266 1267 1268 #ifdef IN_RING3 1269 1270 #ifdef VBOX_WITH_OHCI_PHYS_READ_STATS 1271 struct DescReadStats 1272 { 1273 uint32_t cReads; 1274 uint32_t cPageChange; 1275 uint32_t cMinReadsPerPage; 1276 uint32_t cMaxReadsPerPage; 1277 1278 uint32_t cReadsLastPage; 1279 uint32_t u32LastPageAddr; 1280 }; 1281 1282 struct PhysReadStats 1283 { 1284 struct DescReadStats ed; 1285 struct DescReadStats td; 1286 struct DescReadStats all; 1287 1288 uint32_t cCrossReads; 1289 uint32_t cCacheReads; 1290 uint32_t cPageReads; 1291 }; 1292 1293 static struct PhysReadStats physReadStats; 1294 1295 static void descReadStatsReset(struct DescReadStats *p) 1297 # endif 1298 } 1299 1300 1301 1302 # ifdef VBOX_WITH_OHCI_PHYS_READ_STATS 1303 1304 static void descReadStatsReset(POHCIDESCREADSTATS p) 1296 1305 { 1297 1306 p->cReads = 0; … … 1304 1313 } 1305 1314 1306 static void physReadStatsReset( struct PhysReadStats *p)1315 static void physReadStatsReset(POHCIPHYSREADSTATS p) 1307 1316 { 1308 1317 descReadStatsReset(&p->ed); … … 1315 1324 } 1316 1325 1317 static void physReadStatsUpdateDesc( struct DescReadStats *p, uint32_t u32Addr)1326 static void physReadStatsUpdateDesc(POHCIDESCREADSTATS p, uint32_t u32Addr) 1318 1327 { 1319 1328 const uint32_t u32PageAddr = u32Addr & ~UINT32_C(0xFFF); … … 1345 1354 } 1346 1355 1347 static void physReadStatsPrint( struct PhysReadStats *p)1356 static void physReadStatsPrint(PCOHCIPHYSREADSTATS p) 1348 1357 { 1349 1358 p->ed.cMinReadsPerPage = RT_MIN(p->ed.cMinReadsPerPage, p->ed.cReadsLastPage); … … 1370 1379 physReadStatsReset(p); 1371 1380 } 1372 #endif /* VBOX_WITH_OHCI_PHYS_READ_STATS */ 1373 1374 #ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE 1381 1382 # endif /* VBOX_WITH_OHCI_PHYS_READ_STATS */ 1383 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE 1384 1375 1385 static POHCIPAGECACHE ohciPhysReadCacheAlloc(void) 1376 1386 { … … 1399 1409 pPageCache->au8PhysReadCache, sizeof(pPageCache->au8PhysReadCache)); 1400 1410 pPageCache->GCPhysReadCacheAddr = PageAddr; 1401 # ifdef VBOX_WITH_OHCI_PHYS_READ_STATS1402 ++ physReadStats.cPageReads;1403 # endif1411 # ifdef VBOX_WITH_OHCI_PHYS_READ_STATS 1412 ++g_PhysReadState.cPageReads; 1413 # endif 1404 1414 } 1405 1415 1406 1416 memcpy(pvBuf, &pPageCache->au8PhysReadCache[GCPhys & PAGE_OFFSET_MASK], cbBuf); 1407 # ifdef VBOX_WITH_OHCI_PHYS_READ_STATS1408 ++ physReadStats.cCacheReads;1409 # endif1417 # ifdef VBOX_WITH_OHCI_PHYS_READ_STATS 1418 ++g_PhysReadState.cCacheReads; 1419 # endif 1410 1420 } 1411 1421 else 1412 1422 { 1413 1423 PDMDevHlpPhysRead(pThis->pDevInsR3, GCPhys, pvBuf, cbBuf); 1414 # ifdef VBOX_WITH_OHCI_PHYS_READ_STATS1415 ++ physReadStats.cCrossReads;1416 # endif1424 # ifdef VBOX_WITH_OHCI_PHYS_READ_STATS 1425 ++g_PhysReadState.cCrossReads; 1426 # endif 1417 1427 } 1418 1428 } … … 1427 1437 ohciPhysReadCacheRead(pThis, pThis->pCacheTD, TdAddr, pTd, sizeof(*pTd)); 1428 1438 } 1429 #endif /* VBOX_WITH_OHCI_PHYS_READ_CACHE */ 1439 1440 # endif /* VBOX_WITH_OHCI_PHYS_READ_CACHE */ 1430 1441 1431 1442 /** … … 1434 1445 DECLINLINE(void) ohciReadEd(POHCI pThis, uint32_t EdAddr, POHCIED pEd) 1435 1446 { 1436 # ifdef VBOX_WITH_OHCI_PHYS_READ_STATS1437 physReadStatsUpdateDesc(& physReadStats.ed, EdAddr);1438 physReadStatsUpdateDesc(& physReadStats.all, EdAddr);1439 # endif1447 # ifdef VBOX_WITH_OHCI_PHYS_READ_STATS 1448 physReadStatsUpdateDesc(&g_PhysReadState.ed, EdAddr); 1449 physReadStatsUpdateDesc(&g_PhysReadState.all, EdAddr); 1450 # endif 1440 1451 ohciGetDWords(pThis, EdAddr, (uint32_t *)pEd, sizeof(*pEd) >> 2); 1441 1452 } … … 1446 1457 DECLINLINE(void) ohciReadTd(POHCI pThis, uint32_t TdAddr, POHCITD pTd) 1447 1458 { 1448 # ifdef VBOX_WITH_OHCI_PHYS_READ_STATS1449 physReadStatsUpdateDesc(& physReadStats.td, TdAddr);1450 physReadStatsUpdateDesc(& physReadStats.all, TdAddr);1451 # endif1459 # ifdef VBOX_WITH_OHCI_PHYS_READ_STATS 1460 physReadStatsUpdateDesc(&g_PhysReadState.td, TdAddr); 1461 physReadStatsUpdateDesc(&g_PhysReadState.all, TdAddr); 1462 # endif 1452 1463 ohciGetDWords(pThis, TdAddr, (uint32_t *)pTd, sizeof(*pTd) >> 2); 1453 # ifdef LOG_ENABLED1464 # ifdef LOG_ENABLED 1454 1465 if (LogIs3Enabled()) 1455 1466 { … … 1468 1479 pTd->be, 1469 1480 pTd->hwinfo & TD_HWINFO_UNKNOWN_MASK)); 1470 # if 01481 # if 0 1471 1482 if (LogIs3Enabled()) 1472 1483 { … … 1493 1504 sizeof(abXpTd), &abXpTd[0])); 1494 1505 } 1495 # endif1496 } 1497 # endif1506 # endif 1507 } 1508 # endif 1498 1509 } 1499 1510 … … 1504 1515 { 1505 1516 ohciGetDWords(pThis, ITdAddr, (uint32_t *)pITd, sizeof(*pITd) / sizeof(uint32_t)); 1506 # ifdef LOG_ENABLED1517 # ifdef LOG_ENABLED 1507 1518 if (LogIs3Enabled()) 1508 1519 { … … 1526 1537 pITd->aPSW[7] >> 12, pITd->aPSW[7] & 0xfff)); 1527 1538 } 1528 # endif1539 # endif 1529 1540 } 1530 1541 … … 1535 1546 DECLINLINE(void) ohciWriteEd(POHCI pThis, uint32_t EdAddr, PCOHCIED pEd) 1536 1547 { 1537 # ifdef LOG_ENABLED1548 # ifdef LOG_ENABLED 1538 1549 if (LogIs3Enabled()) 1539 1550 { … … 1558 1569 EdOld.NextED != pEd->NextED ? "*" : "", pEd->NextED)); 1559 1570 } 1560 # endif1571 # endif 1561 1572 1562 1573 ohciPutDWords(pThis, EdAddr, (uint32_t *)pEd, sizeof(*pEd) >> 2); … … 1569 1580 DECLINLINE(void) ohciWriteTd(POHCI pThis, uint32_t TdAddr, PCOHCITD pTd, const char *pszLogMsg) 1570 1581 { 1571 # ifdef LOG_ENABLED1582 # ifdef LOG_ENABLED 1572 1583 if (LogIs3Enabled()) 1573 1584 { … … 1588 1599 pszLogMsg)); 1589 1600 } 1590 # else1601 # else 1591 1602 RT_NOREF(pszLogMsg); 1592 # endif1603 # endif 1593 1604 ohciPutDWords(pThis, TdAddr, (uint32_t *)pTd, sizeof(*pTd) >> 2); 1594 1605 } … … 1599 1610 DECLINLINE(void) ohciWriteITd(POHCI pThis, uint32_t ITdAddr, PCOHCIITD pITd, const char *pszLogMsg) 1600 1611 { 1601 # ifdef LOG_ENABLED1612 # ifdef LOG_ENABLED 1602 1613 if (LogIs3Enabled()) 1603 1614 { … … 1625 1636 (ITdOld.aPSW[7] >> 12) != (pITd->aPSW[7] >> 12) ? "*" : "", pITd->aPSW[7] >> 12, (ITdOld.aPSW[7] & 0xfff) != (pITd->aPSW[7] & 0xfff) ? "*" : "", pITd->aPSW[7] & 0xfff)); 1626 1637 } 1627 # else1638 # else 1628 1639 RT_NOREF(pszLogMsg); 1629 # endif1640 # endif 1630 1641 ohciPutDWords(pThis, ITdAddr, (uint32_t *)pITd, sizeof(*pITd) / sizeof(uint32_t)); 1631 1642 } 1632 1643 1633 1644 1634 # ifdef LOG_ENABLED1645 # ifdef LOG_ENABLED 1635 1646 1636 1647 /** … … 1770 1781 } 1771 1782 1772 # endif /* LOG_ENABLED */1783 # endif /* LOG_ENABLED */ 1773 1784 1774 1785 … … 1804 1815 if (i >= 0) 1805 1816 { 1806 # ifdef LOG_ENABLED1817 # ifdef LOG_ENABLED 1807 1818 pUrb->pHci->u32FrameNo = pThis->HcFmNumber; 1808 # endif1819 # endif 1809 1820 pThis->aInFlight[i].GCPhysTD = GCPhysTD; 1810 1821 pThis->aInFlight[i].pUrb = pUrb; … … 1908 1919 if (i >= 0) 1909 1920 { 1910 # ifdef LOG_ENABLED1921 # ifdef LOG_ENABLED 1911 1922 const int cFramesInFlight = pThis->HcFmNumber - pThis->aInFlight[i].pUrb->pHci->u32FrameNo; 1912 # else1923 # else 1913 1924 const int cFramesInFlight = 0; 1914 # endif1925 # endif 1915 1926 Log2(("ohci_in_flight_remove: reaping TD=%#010x %d frames (%#010x-%#010x)\n", 1916 1927 GCPhysTD, cFramesInFlight, pThis->aInFlight[i].pUrb->pHci->u32FrameNo, pThis->HcFmNumber)); … … 1946 1957 1947 1958 1948 # if defined(VBOX_STRICT) || defined(LOG_ENABLED)1959 # if defined(VBOX_STRICT) || defined(LOG_ENABLED) 1949 1960 1950 1961 /** … … 1981 1992 { 1982 1993 int i = ohci_in_done_queue_find(pThis, GCPhysTD); 1983 # if 01994 # if 0 1984 1995 /* This condition has been observed with the USB tablet emulation or with 1985 1996 * a real USB mouse and an SMP XP guest. I am also not sure if this is … … 1993 2004 */ 1994 2005 AssertMsg(i < 0, ("TD %#010x (i=%d)\n", GCPhysTD, i)); 1995 # endif2006 # endif 1996 2007 return i < 0; 1997 2008 } 1998 2009 1999 2010 2000 # ifdef VBOX_STRICT2011 # ifdef VBOX_STRICT 2001 2012 /** 2002 2013 * Adds a TD to the in-done-queue tracking, checking that it's not there already. … … 2010 2021 pThis->aInDoneQueue[pThis->cInDoneQueue++].GCPhysTD = GCPhysTD; 2011 2022 } 2012 # endif /* VBOX_STRICT */2013 # endif /* defined(VBOX_STRICT) || defined(LOG_ENABLED) */2023 # endif /* VBOX_STRICT */ 2024 # endif /* defined(VBOX_STRICT) || defined(LOG_ENABLED) */ 2014 2025 2015 2026 … … 2524 2535 * Move on to the done list and write back the modified TD. 2525 2536 */ 2526 # ifdef LOG_ENABLED2537 # ifdef LOG_ENABLED 2527 2538 if (!pThis->done) 2528 2539 pThis->u32FmDoneQueueTail = pThis->HcFmNumber; 2529 # ifdef VBOX_STRICT2540 # ifdef VBOX_STRICT 2530 2541 ohci_in_done_queue_add(pThis, ITdAddr); 2542 # endif 2531 2543 # endif 2532 #endif2533 2544 pITd->NextTD = pThis->done; 2534 2545 pThis->done = ITdAddr; … … 2663 2674 * Move on to the done list and write back the modified TD. 2664 2675 */ 2665 # ifdef LOG_ENABLED2676 # ifdef LOG_ENABLED 2666 2677 if (!pThis->done) 2667 2678 pThis->u32FmDoneQueueTail = pThis->HcFmNumber; 2668 # ifdef VBOX_STRICT2679 # ifdef VBOX_STRICT 2669 2680 ohci_in_done_queue_add(pThis, TdAddr); 2681 # endif 2670 2682 # endif 2671 #endif2672 2683 pTd->NextTD = pThis->done; 2673 2684 pThis->done = TdAddr; … … 2943 2954 if (ohciIsTdInFlight(pThis, TdAddr)) 2944 2955 return false; 2945 # if defined(VBOX_STRICT) || defined(LOG_ENABLED)2956 # if defined(VBOX_STRICT) || defined(LOG_ENABLED) 2946 2957 ohci_in_done_queue_check(pThis, TdAddr); 2947 # endif2958 # endif 2948 2959 return ohciServiceTd(pThis, enmType, pEd, EdAddr, TdAddr, &TdAddr, pszListName); 2949 2960 } … … 2973 2984 } Head; 2974 2985 2975 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE2986 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE 2976 2987 ohciPhysReadCacheClear(pThis->pCacheTD); 2977 # endif2988 # endif 2978 2989 2979 2990 /* read the head */ 2980 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE2991 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE 2981 2992 ohciReadTdCached(pThis, TdAddr, &Head.Td); 2982 # else2993 # else 2983 2994 ohciReadTd(pThis, TdAddr, &Head.Td); 2984 # endif2995 # endif 2985 2996 ohciBufInit(&Head.Buf, Head.Td.cbp, Head.Td.be); 2986 2997 Head.TdAddr = TdAddr; … … 3000 3011 pCur->pNext = NULL; 3001 3012 pCur->TdAddr = pTail->Td.NextTD & ED_PTR_MASK; 3002 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE3013 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE 3003 3014 ohciReadTdCached(pThis, pCur->TdAddr, &pCur->Td); 3004 # else3015 # else 3005 3016 ohciReadTd(pThis, pCur->TdAddr, &pCur->Td); 3006 # endif3017 # endif 3007 3018 ohciBufInit(&pCur->Buf, pCur->Td.cbp, pCur->Td.be); 3008 3019 … … 3121 3132 if (ohciIsTdInFlight(pThis, TdAddr)) 3122 3133 return false; 3123 # if defined(VBOX_STRICT) || defined(LOG_ENABLED)3134 # if defined(VBOX_STRICT) || defined(LOG_ENABLED) 3124 3135 ohci_in_done_queue_check(pThis, TdAddr); 3125 # endif3136 # endif 3126 3137 return ohciServiceTdMultiple(pThis, enmType, pEd, EdAddr, TdAddr, &TdAddr, pszListName); 3127 3138 } … … 3274 3285 AssertCompile(sizeof(pUrb->paTds[0].TdCopy) >= sizeof(*pITd)); 3275 3286 memcpy(pUrb->paTds[0].TdCopy, pITd, sizeof(*pITd)); 3276 # if 0 /* color the data */3287 # if 0 /* color the data */ 3277 3288 memset(pUrb->abData, 0xfe, cbTotal); 3278 # endif3289 # endif 3279 3290 3280 3291 /* copy the data */ … … 3399 3410 else 3400 3411 { 3401 # if 13412 # if 1 3402 3413 /* 3403 3414 * Ok, the launch window for this TD has passed. … … 3422 3433 break; 3423 3434 } 3424 # else /* BAD IDEA: */3435 # else /* BAD IDEA: */ 3425 3436 /* 3426 3437 * Ok, the launch window for this TD has passed. … … 3439 3450 break; 3440 3451 } 3441 # endif3452 # endif 3442 3453 } 3443 3454 … … 3484 3495 static void ohciServiceBulkList(POHCI pThis) 3485 3496 { 3486 # ifdef LOG_ENABLED3497 # ifdef LOG_ENABLED 3487 3498 if (g_fLogBulkEPs) 3488 3499 ohciDumpEdList(pThis, pThis->bulk_head, "Bulk before", true); 3489 3500 if (pThis->bulk_cur) 3490 3501 Log(("ohciServiceBulkList: bulk_cur=%#010x before listprocessing!!! HCD have positioned us!!!\n", pThis->bulk_cur)); 3491 # endif3502 # endif 3492 3503 3493 3504 /* … … 3504 3515 { 3505 3516 OHCIED Ed; 3506 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE3517 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE 3507 3518 ohciReadEdCached(pThis, EdAddr, &Ed); 3508 # else3519 # else 3509 3520 ohciReadEd(pThis, EdAddr, &Ed); 3510 # endif3521 # endif 3511 3522 Assert(!(Ed.hwinfo & ED_HWINFO_ISO)); /* the guest is screwing us */ 3512 3523 if (ohciIsEdReady(&Ed)) … … 3515 3526 pThis->fBulkNeedsCleaning = true; 3516 3527 3517 # if 13528 # if 1 3518 3529 /* 3519 3530 … … 3525 3536 */ 3526 3537 ohciServiceHeadTdMultiple(pThis, VUSBXFERTYPE_BULK, &Ed, EdAddr, "Bulk"); 3527 # else3538 # else 3528 3539 /* 3529 3540 * This alternative code was used before we started reassembling URBs from … … 3550 3561 } while (ohciIsEdReady(&Ed)); 3551 3562 } 3552 # endif3563 # endif 3553 3564 } 3554 3565 else … … 3572 3583 } 3573 3584 3574 # ifdef LOG_ENABLED3585 # ifdef LOG_ENABLED 3575 3586 if (g_fLogBulkEPs) 3576 3587 ohciDumpEdList(pThis, pThis->bulk_head, "Bulk after ", true); 3577 # endif3588 # endif 3578 3589 } 3579 3590 … … 3588 3599 static void ohciUndoBulkList(POHCI pThis) 3589 3600 { 3590 # ifdef LOG_ENABLED3601 # ifdef LOG_ENABLED 3591 3602 if (g_fLogBulkEPs) 3592 3603 ohciDumpEdList(pThis, pThis->bulk_head, "Bulk before", true); 3593 3604 if (pThis->bulk_cur) 3594 3605 Log(("ohciUndoBulkList: bulk_cur=%#010x before list processing!!! HCD has positioned us!!!\n", pThis->bulk_cur)); 3595 # endif3606 # endif 3596 3607 3597 3608 /* This flag follows OHCI_STATUS_BLF, but BLF doesn't change when list processing is disabled. */ … … 3602 3613 { 3603 3614 OHCIED Ed; 3604 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE3615 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE 3605 3616 ohciReadEdCached(pThis, EdAddr, &Ed); 3606 # else3617 # else 3607 3618 ohciReadEd(pThis, EdAddr, &Ed); 3608 # endif3619 # endif 3609 3620 Assert(!(Ed.hwinfo & ED_HWINFO_ISO)); /* the guest is screwing us */ 3610 3621 if (ohciIsEdPresent(&Ed)) … … 3633 3644 static void ohciServiceCtrlList(POHCI pThis) 3634 3645 { 3635 # ifdef LOG_ENABLED3646 # ifdef LOG_ENABLED 3636 3647 if (g_fLogControlEPs) 3637 3648 ohciDumpEdList(pThis, pThis->ctrl_head, "Ctrl before", true); 3638 3649 if (pThis->ctrl_cur) 3639 3650 Log(("ohciServiceCtrlList: ctrl_cur=%010x before list processing!!! HCD have positioned us!!!\n", pThis->ctrl_cur)); 3640 # endif3651 # endif 3641 3652 3642 3653 /* … … 3656 3667 if (ohciIsEdReady(&Ed)) 3657 3668 { 3658 # if 13669 # if 1 3659 3670 /* 3660 3671 * Control TDs depends on order and stage. Only one can be in-flight … … 3673 3684 ohciReadEd(pThis, EdAddr, &Ed); /* It might have been updated on URB completion. */ 3674 3685 } while (ohciIsEdReady(&Ed)); 3675 # else3686 # else 3676 3687 /* Simplistic, for debugging. */ 3677 3688 ohciServiceHeadTd(pThis, VUSBXFERTYPE_CTRL, &Ed, EdAddr, "Control"); 3678 3689 pThis->status |= OHCI_STATUS_CLF; 3679 # endif3690 # endif 3680 3691 } 3681 3692 … … 3684 3695 } 3685 3696 3686 # ifdef LOG_ENABLED3697 # ifdef LOG_ENABLED 3687 3698 if (g_fLogControlEPs) 3688 3699 ohciDumpEdList(pThis, pThis->ctrl_head, "Ctrl after ", true); 3689 # endif3700 # endif 3690 3701 } 3691 3702 … … 3707 3718 ohciGetDWords(pThis, pThis->hcca + iList * sizeof(EdAddr), &EdAddr, 1); 3708 3719 3709 # ifdef LOG_ENABLED3720 # ifdef LOG_ENABLED 3710 3721 const uint32_t EdAddrHead = EdAddr; 3711 3722 if (g_fLogInterruptEPs) … … 3715 3726 ohciDumpEdList(pThis, EdAddrHead, sz, true); 3716 3727 } 3717 # endif3728 # endif 3718 3729 3719 3730 /* … … 3723 3734 { 3724 3735 OHCIED Ed; 3725 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE3736 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE 3726 3737 ohciReadEdCached(pThis, EdAddr, &Ed); 3727 # else3738 # else 3728 3739 ohciReadEd(pThis, EdAddr, &Ed); 3729 # endif3740 # endif 3730 3741 3731 3742 if (ohciIsEdReady(&Ed)) … … 3771 3782 } 3772 3783 3773 # ifdef LOG_ENABLED3784 # ifdef LOG_ENABLED 3774 3785 if (g_fLogInterruptEPs) 3775 3786 { … … 3778 3789 ohciDumpEdList(pThis, EdAddrHead, sz, true); 3779 3790 } 3780 # endif3791 # endif 3781 3792 } 3782 3793 … … 3811 3822 Log(("ohci: Writeback Done (%#010x) on frame %#x (age %#x)\n", hcca.done, 3812 3823 pThis->HcFmNumber, pThis->HcFmNumber - pThis->u32FmDoneQueueTail)); 3813 # ifdef LOG_ENABLED3824 # ifdef LOG_ENABLED 3814 3825 ohciDumpTdQueue(pThis, hcca.done & ED_PTR_MASK, "DoneQueue"); 3815 # endif3826 # endif 3816 3827 Assert(RT_OFFSETOF(struct ohci_hcca, done) == 4); 3817 # if defined(VBOX_STRICT) || defined(LOG_ENABLED)3828 # if defined(VBOX_STRICT) || defined(LOG_ENABLED) 3818 3829 ohci_in_done_queue_zap(pThis); 3819 # endif3830 # endif 3820 3831 fWriteDoneHeadInterrupt = true; 3821 3832 } … … 3859 3870 Assert(cLeft == 0); 3860 3871 3861 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE3872 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE 3862 3873 /* Get hcca data to minimize calls to ohciGetDWords/PDMDevHlpPhysRead. */ 3863 3874 uint32_t au32HCCA[OHCI_HCCA_NUM_INTR]; 3864 3875 ohciGetDWords(pThis, pThis->hcca, au32HCCA, OHCI_HCCA_NUM_INTR); 3865 # endif3876 # endif 3866 3877 3867 3878 /* Go over all bulk/control/interrupt endpoint lists; any URB found in these lists … … 3879 3890 break; 3880 3891 default: 3881 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE3892 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE 3882 3893 EdAddr = au32HCCA[i]; 3883 # else3894 # else 3884 3895 ohciGetDWords(pThis, pThis->hcca + i * sizeof(EdAddr), &EdAddr, 1); 3885 # endif3896 # endif 3886 3897 break; 3887 3898 } … … 3890 3901 OHCIED Ed; 3891 3902 OHCITD Td; 3892 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE3903 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE 3893 3904 ohciReadEdCached(pThis, EdAddr, &Ed); 3894 # else3905 # else 3895 3906 ohciReadEd(pThis, EdAddr, &Ed); 3896 # endif3907 # endif 3897 3908 uint32_t TdAddr = Ed.HeadP & ED_PTR_MASK; 3898 3909 uint32_t TailP = Ed.TailP & ED_PTR_MASK; … … 3901 3912 && (TdAddr != TailP)) 3902 3913 { 3903 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE3914 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE 3904 3915 ohciPhysReadCacheClear(pThis->pCacheTD); 3905 # endif3916 # endif 3906 3917 do 3907 3918 { 3908 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE3919 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE 3909 3920 ohciReadTdCached(pThis, TdAddr, &Td); 3910 # else3921 # else 3911 3922 ohciReadTd(pThis, TdAddr, &Td); 3912 # endif3923 # endif 3913 3924 j = ohci_in_flight_find(pThis, TdAddr); 3914 3925 if (j > -1) … … 3956 3967 static void ohciStartOfFrame(POHCI pThis) 3957 3968 { 3958 # ifdef LOG_ENABLED3969 # ifdef LOG_ENABLED 3959 3970 const uint32_t status_old = pThis->status; 3960 # endif3971 # endif 3961 3972 3962 3973 /* … … 3973 3984 || pThis->hcca < ~OHCI_HCCA_MASK); 3974 3985 3975 # if 13986 # if 1 3976 3987 /* 3977 3988 * Update the HCCA. … … 3980 3991 if (fValidHCCA) 3981 3992 ohciUpdateHCCA(pThis); 3982 # endif3993 # endif 3983 3994 3984 3995 /* "After writing to HCCA, HC will set SF in HcInterruptStatus" - guest isn't executing, so ignore the order! */ … … 4022 4033 ohciUndoBulkList(pThis); /* If list disabled but not empty, abort endpoints. */ 4023 4034 4024 # if 04035 # if 0 4025 4036 /* 4026 4037 * Update the HCCA after processing the lists and everything. A bit experimental. … … 4037 4048 */ 4038 4049 ohciUpdateHCCA(pThis); 4039 # endif4040 4041 # ifdef LOG_ENABLED4050 # endif 4051 4052 # ifdef LOG_ENABLED 4042 4053 if (pThis->status ^ status_old) 4043 4054 { … … 4052 4063 chg & (3<<16)? "*" : "", (val >> 16) & 3)); 4053 4064 } 4054 # endif4065 # endif 4055 4066 } 4056 4067 … … 4078 4089 pThis->fIdle = true; 4079 4090 4080 # ifdef VBOX_WITH_OHCI_PHYS_READ_STATS4081 physReadStatsReset(& physReadStats);4082 # endif4083 4084 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE4091 # ifdef VBOX_WITH_OHCI_PHYS_READ_STATS 4092 physReadStatsReset(&g_PhysReadState); 4093 # endif 4094 4095 # ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE 4085 4096 ohciPhysReadCacheClear(pThis->pCacheED); 4086 4097 ohciPhysReadCacheClear(pThis->pCacheTD); 4087 # endif4098 # endif 4088 4099 4089 4100 /* Frame boundary, so do EOF stuff here. */ … … 4098 4109 ohciStartOfFrame(pThis); 4099 4110 4100 # ifdef VBOX_WITH_OHCI_PHYS_READ_STATS4101 physReadStatsPrint(& physReadStats);4102 # endif4111 # ifdef VBOX_WITH_OHCI_PHYS_READ_STATS 4112 physReadStatsPrint(&g_PhysReadState); 4113 # endif 4103 4114 4104 4115 RTCritSectLeave(&pThis->CritSect); -
trunk/src/VBox/Devices/VirtIO/Virtio.cpp
r63369 r63478 623 623 } 624 624 625 #if 0 /* unused */ 625 626 /** 626 627 * Sets 32-bit register in PCI configuration space. … … 635 636 *(uint32_t*)&refPciDev.config[uOffset] = u32Value; 636 637 } 638 #endif /* unused */ 637 639 638 640
Note:
See TracChangeset
for help on using the changeset viewer.