VirtualBox

Changeset 63478 in vbox for trunk


Ignore:
Timestamp:
Aug 15, 2016 2:04:10 PM (8 years ago)
Author:
vboxsync
Message:

Devices: warnings (clang)

Location:
trunk/src/VBox/Devices
Files:
27 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Audio/DevIchHda.cpp

    r63373 r63478  
    11631163
    11641164#ifdef IN_RING3
     1165
    11651166DECLINLINE(uint32_t) hdaStreamUpdateLPIB(PHDASTATE pThis, PHDASTREAM pStream, uint32_t u32LPIB)
    11661167{
     
    11871188    return u32LPIB;
    11881189}
    1189 #endif
     1190
    11901191
    11911192/**
     
    12201221}
    12211222
     1223
    12221224/**
    12231225 * Retrieves the number of bytes of a FIFOW register.
     
    12361238    }
    12371239
    1238 #ifdef RT_STRICT
    12391240    Assert(RT_IS_POWER_OF_TWO(cb));
    1240 #endif
    12411241    return cb;
    12421242}
    12431243
    1244 #ifdef IN_RING3
     1244
    12451245/**
    12461246 * Fetches the next BDLE to use for a stream.
     
    12591259    LogFlowFuncEnter();
    12601260
    1261 #ifdef DEBUG
    1262     uint32_t uOldBDLE = pStream->State.uCurBDLE;
    1263 #endif
     1261# ifdef LOG_ENABLED
     1262    uint32_t const uOldBDLE = pStream->State.uCurBDLE;
     1263# endif
    12641264
    12651265    PHDABDLE pBDLE = &pStream->State.BDLE;
     
    12821282    int rc = hdaBDLEFetch(pThis, pBDLE, pStream->u64BDLBase, pStream->State.uCurBDLE);
    12831283
    1284 #ifdef DEBUG
    12851284    LogFlowFunc(("[SD%RU8]: uOldBDLE=%RU16, uCurBDLE=%RU16, LVI=%RU32, rc=%Rrc, %R[bdle]\n",
    12861285                 pStream->u8SD, uOldBDLE, pStream->State.uCurBDLE, pStream->u16LVI, rc, pBDLE));
    1287 #endif
    1288 
    12891286    return rc;
    12901287}
    1291 #endif /* IN_RING3 */
     1288
    12921289
    12931290/**
     
    13131310}
    13141311
     1312
    13151313/**
    13161314 * Returns the HDA stream of specified stream descriptor number.
     
    13281326    return &pThis->aStreams[uSD];
    13291327}
     1328
    13301329
    13311330/**
     
    13561355    AssertPtrReturn(pStream, 0);
    13571356
    1358 #ifdef VBOX_HDA_WITH_FIFO
     1357# ifdef VBOX_HDA_WITH_FIFO
    13591358    return hdaSDFIFOWToBytes(HDA_STREAM_REG(pThis, FIFOW, pStream->u8SD));
    1360 #else
     1359# else
    13611360    return 0;
    1362 #endif
    1363 }
     1361# endif
     1362}
     1363
     1364#endif /* IN_RING3 */
    13641365
    13651366static int hdaProcessInterrupt(PHDASTATE pThis)
     
    15111512
    15121513#ifdef IN_RING3
     1514
    15131515static int hdaCmdSync(PHDASTATE pThis, bool fLocal)
    15141516{
     
    15241526        if (RT_FAILURE(rc))
    15251527            AssertRCReturn(rc, rc);
    1526 #ifdef DEBUG_CMD_BUFFER
     1528# ifdef DEBUG_CMD_BUFFER
    15271529        uint8_t i = 0;
    15281530        do
     
    15451547            i += 8;
    15461548        } while(i != 0);
    1547 #endif
     1549# endif
    15481550    }
    15491551    else
     
    15531555        if (RT_FAILURE(rc))
    15541556            AssertRCReturn(rc, rc);
    1555 #ifdef DEBUG_CMD_BUFFER
     1557# ifdef DEBUG_CMD_BUFFER
    15561558        uint8_t i = 0;
    15571559        do {
     
    15691571            i += 8;
    15701572        } while (i != 0);
    1571 #endif
     1573# endif
    15721574    }
    15731575    return rc;
     
    17001702                 pStream->u8SD, pStream->u64BDLBase, pStream->u32CBL, pStream->u16LVI, pStream->u16FIFOS));
    17011703
    1702 #ifdef DEBUG
     1704# ifdef DEBUG
    17031705    uint64_t u64BaseDMA = RT_MAKE_U64(HDA_STREAM_REG(pThis, BDPL, pStream->u8SD),
    17041706                                      HDA_STREAM_REG(pThis, BDPU, pStream->u8SD));
     
    17091711
    17101712    hdaBDLEDumpAll(pThis, u64BaseDMA, u16LVI + 1);
    1711 #endif
     1713# endif
    17121714
    17131715    return VINF_SUCCESS;
     
    17211723    const uint8_t uSD = pStream->u8SD;
    17221724
    1723 #ifdef VBOX_STRICT
     1725# ifdef VBOX_STRICT
    17241726    AssertReleaseMsg(!RT_BOOL(HDA_STREAM_REG(pThis, CTL, uSD) & HDA_REG_FIELD_FLAG_MASK(SDCTL, RUN)),
    17251727                     ("[SD%RU8] Cannot reset stream while in running state\n", uSD));
    1726 #endif
     1728# endif
    17271729
    17281730    LogFunc(("[SD%RU8]: Reset\n", uSD));
     
    17701772}
    17711773
    1772 #if 0 /* unused */
     1774# if 0 /* unused */
    17731775static bool hdaStreamIsActive(PHDASTATE pThis, PHDASTREAM pStream)
    17741776{
     
    17811783    return fActive;
    17821784}
    1783 #endif
     1785# endif
    17841786
    17851787static int hdaStreamSetActive(PHDASTATE pThis, PHDASTREAM pStream, bool fActive)
     
    18241826            pThis->cStreamsActive--;
    18251827
    1826 #ifndef VBOX_WITH_AUDIO_CALLBACKS
     1828# ifndef VBOX_WITH_AUDIO_CALLBACKS
    18271829        hdaTimerMaybeStop(pThis);
    1828 #endif
     1830# endif
    18291831    }
    18301832    else
    18311833    {
    18321834        pThis->cStreamsActive++;
    1833 #ifndef VBOX_WITH_AUDIO_CALLBACKS
     1835# ifndef VBOX_WITH_AUDIO_CALLBACKS
    18341836        hdaTimerMaybeStart(pThis);
    1835 #endif
     1837# endif
    18361838    }
    18371839
     
    18541856}
    18551857
    1856 #if 0 /** @todo hdaStreamStart is unused */
     1858# if 0 /** @todo hdaStreamStart is unused */
    18571859static int hdaStreamStart(PHDASTREAM pStream)
    18581860{
     
    18651867    return VINF_SUCCESS;
    18661868}
    1867 #endif /* unused */
     1869# endif /* unused */
    18681870
    18691871static int hdaStreamStop(PHDASTREAM pStream)
     
    18761878        return VINF_SUCCESS;
    18771879
    1878 #if 0 /** @todo Does not work (yet), as EMT deadlocks then. */
     1880# if 0 /** @todo Does not work (yet), as EMT deadlocks then. */
    18791881    /*
    18801882     * Wait for the stream to stop.
     
    18931895                pStream->u8Strm, fActive ? "active" : "stopped", rc));
    18941896    }
    1895 #else
     1897# else
    18961898    int rc = VINF_SUCCESS;
    1897 #endif
     1899# endif
    18981900
    18991901    LogFlowFuncLeaveRC(rc);
     
    19011903}
    19021904
    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)
    19041906static int hdaStreamChannelExtract(PPDMAUDIOSTREAMCHANNEL pChan, const void *pvBuf, size_t cbBuf)
    19051907{
     
    19491951    return VINF_SUCCESS;
    19501952}
    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 */
    19541956static int hdaStreamChannelAdvance(PPDMAUDIOSTREAMCHANNEL pChan, size_t cbAdv)
    19551957{
     
    19611963    return VINF_SUCCESS;
    19621964}
    1963 #endif
     1965# endif
    19641966
    19651967static int hdaStreamChannelDataInit(PPDMAUDIOSTREAMCHANNELDATA pChanData, uint32_t fFlags)
     
    19931995}
    19941996
    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)
    19961998
    19971999static int hdaStreamChannelAcquireData(PPDMAUDIOSTREAMCHANNELDATA pChanData, void *pvData, size_t *pcbData)
     
    20152017}
    20162018
    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) */
    20182020
    20192021# if 0 /* currently unused */
  • trunk/src/VBox/Devices/Audio/DevSB16.cpp

    r63215 r63478  
    416416}
    417417
    418 #ifdef DEBUG
    419 static inline void log_dsp(PSB16STATE pThis)
     418#if 0 // unused // def DEBUG
     419DECLINLINE(void) log_dsp(PSB16STATE pThis)
    420420{
    421421    LogFlowFunc(("%s:%s:%d:%s:dmasize=%d:freq=%d:const=%d:speaker=%d\n",
  • trunk/src/VBox/Devices/Bus/DevPciIch9.cpp

    r62889 r63478  
    541541}
    542542
     543#ifdef IN_RING3
     544
    543545/* return the global irq number corresponding to a given device irq
    544546   pin. We could also use the bus number to have a more precise
     
    553555/* irqs corresponding to PCI irqs A-D, must match pci_irq_list in rombios.c */
    554556static const uint8_t aPciIrqs[4] = { 11, 10, 9, 5 };
     557
     558#endif /* IN_RING3 */
    555559
    556560/* Add one more level up request on APIC input line */
  • trunk/src/VBox/Devices/Bus/MsiCommon.cpp

    r62885 r63478  
    9999}
    100100
     101#ifdef IN_RING3
     102
    101103DECLINLINE(bool) msiBitJustCleared(uint32_t uOldValue,
    102104                                   uint32_t uNewValue,
     
    113115}
    114116
    115 #ifdef IN_RING3
    116117void     MsiPciConfigWrite(PPDMDEVINS pDevIns, PCPDMPCIHLP pPciHlp, PPCIDEVICE pDev,
    117118                           uint32_t u32Address, uint32_t val, unsigned len)
  • trunk/src/VBox/Devices/EFI/DevEFI.cpp

    r63016 r63478  
    19091909}
    19101910
     1911
     1912#if 0 /* unused */
    19111913/**
    19121914 * Helper that searches for a FFS file of a given type.
     
    19221924efiFwVolFindFileByType(EFI_FFS_FILE_HEADER const *pFfsFile, uint8_t const *pbEnd, EFI_FV_FILETYPE FileType, uint32_t *pcbFile)
    19231925{
    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)
    19251927    while ((uintptr_t)pFfsFile < (uintptr_t)pbEnd)
    19261928    {
     
    19331935        pFfsFile = (EFI_FFS_FILE_HEADER *)((uintptr_t)pFfsFile + RT_ALIGN(FFS_SIZE(pFfsFile), 8));
    19341936    }
    1935 #undef FFS_SIZE
     1937# undef FFS_SIZE
    19361938    return NULL;
    19371939}
     1940#endif /* unused */
    19381941
    19391942
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA.cpp

    r63421 r63478  
    31063106            default:
    31073107# ifdef VBOX_WITH_VMSVGA3D
    3108                 if (    enmCmdId >= SVGA_3D_CMD_BASE
    3109                     &&  enmCmdId <  SVGA_3D_CMD_MAX)
     3108                if (    (int)enmCmdId >= SVGA_3D_CMD_BASE
     3109                    &&  (int)enmCmdId <  SVGA_3D_CMD_MAX)
    31103110                {
    31113111                    /* 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  
    10901090
    10911091#ifdef RT_OS_DARWIN
     1092    RT_NOREF(pOldViewport);
    10921093    PVMSVGA3DSTATE pState = pThis->svga.p3dState;
    10931094    if (   pState
     
    36013602
    36023603#elif defined(RT_OS_DARWIN)
     3604    RT_NOREF(pState);
    36033605    vmsvga3dCocoaViewSetSize(pContext->cocoaView, pThis->svga.uWidth, pThis->svga.uHeight);
    36043606
  • trunk/src/VBox/Devices/Graphics/DevVGA.cpp

    r63218 r63478  
    269269*   Global Variables                                                                                                             *
    270270*********************************************************************************************************************************/
     271#ifdef IN_RING3
    271272/* "Press F12 to select boot device." bitmap. */
    272273static const uint8_t g_abLogoF12BootText[] =
     
    306307    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
    307308};
     309#endif /* IN_RING3 */
    308310
    309311
  • trunk/src/VBox/Devices/Graphics/DevVGA_VDMA.cpp

    r63427 r63478  
    10391039}
    10401040
    1041 DECLINLINE(void) vboxVDMACrCtlRetain (PVBOXVDMACMD_CHROMIUM_CTL pCmd)
     1041#if 0 /* unused */
     1042DECLINLINE(void) vboxVDMACrCtlRetain(PVBOXVDMACMD_CHROMIUM_CTL pCmd)
    10421043{
    10431044    PVBOXVDMACMD_CHROMIUM_CTL_PRIVATE pHdr = VBOXVDMACMD_CHROMIUM_CTL_PRIVATE_FROM_CTL(pCmd);
    10441045    ASMAtomicIncU32(&pHdr->cRefs);
    10451046}
     1047#endif /* unused */
    10461048
    10471049DECLINLINE(int) vboxVDMACrCtlGetRc (PVBOXVDMACMD_CHROMIUM_CTL pCmd)
  • trunk/src/VBox/Devices/Graphics/shaderlib/directx.c

    r62948 r63478  
    5656
    5757/* The d3d device ID */
     58#if 0 /* VBox: unused */
    5859static const GUID IID_D3DDEVICE_D3DUID = { 0xaeb2cdd4, 0x6e41, 0x43ea, { 0x94,0x1c,0x83,0x61,0xcc,0x76,0x07,0x81 } };
     60#endif
    5961
    6062
     
    904906};
    905907
     908#if 0 /* VBox: unused */
    906909static const struct driver_version_information driver_version_table[] =
    907910{
     
    960963    /* TODO: Add information about legacy ATI hardware, Intel and other cards. */
    961964};
     965#endif /* VBox: unused */
    962966
    963967
  • trunk/src/VBox/Devices/Input/PS2K.cpp

    r62885 r63478  
    267267} key_def;
    268268
     269
     270/*********************************************************************************************************************************
     271*   Global Variables                                                                                                             *
     272*********************************************************************************************************************************/
     273#ifdef IN_RING3
    269274/* USB to PS/2 conversion table for regular keys. */
    270275static const   key_def   aPS2Keys[] = {
     
    461466};
    462467
    463 
    464 /*********************************************************************************************************************************
    465 *   Global Variables                                                                                                             *
    466 *********************************************************************************************************************************/
    467 
    468 
    469 /*********************************************************************************************************************************
    470 *   Internal Functions                                                                                                           *
    471 *********************************************************************************************************************************/
     468#endif /* IN_RING3 */
     469
    472470
    473471
  • trunk/src/VBox/Devices/Input/UsbKbd.cpp

    r62956 r63478  
    463463
    464464
     465#if 0 /* unused */
    465466/**
    466467 * Checks if the queue is empty or not.
     
    473474    return pQueue->pHead == NULL;
    474475}
     476#endif /* unused */
    475477
    476478
  • trunk/src/VBox/Devices/Input/UsbMouse.cpp

    r62956 r63478  
    10711071
    10721072
     1073#if 0 /* unused */
    10731074/**
    10741075 * Checks if the queue is empty or not.
     
    10811082    return pQueue->pHead == NULL;
    10821083}
     1084#endif /* unused */
    10831085
    10841086
  • trunk/src/VBox/Devices/Network/DevE1000.cpp

    r63218 r63478  
    218218#define E1K_CHIP_82545EM 2
    219219
     220#ifdef IN_RING3
    220221/** Different E1000 chips. */
    221222static const struct E1kChips
     
    226227    uint16_t uPCISubsystemId;
    227228    const char *pcszName;
    228 } g_Chips[] =
     229} g_aChips[] =
    229230{
    230231    /* Vendor Device SSVendor SubSys  Name */
    231232    { 0x8086,
    232233      /* Temporary code, as MSI-aware driver dislike 0x100E. How to do that right? */
    233 #ifdef E1K_WITH_MSI
     234# ifdef E1K_WITH_MSI
    234235      0x105E,
    235 #else
     236# else
    236237      0x100E,
    237 #endif
     238# endif
    238239                      0x8086, 0x001E, "82540EM" }, /* Intel 82540EM-A in Intel PRO/1000 MT Desktop */
    239240    { 0x8086, 0x1004, 0x8086, 0x1004, "82543GC" }, /* Intel 82543GC   in Intel PRO/1000 T  Server */
    240241    { 0x8086, 0x100F, 0x15AD, 0x0750, "82545EM" }  /* Intel 82545EM-A in VMWare Network Adapter */
    241242};
     243#endif /* IN_RING3 */
    242244
    243245
     
    15521554}
    15531555
     1556#ifdef IN_RING3
    15541557/**
    15551558 * Cancel a timer.
     
    15681571    RT_NOREF1(pThis);
    15691572}
     1573#endif /* IN_RING3 */
    15701574
    15711575#define e1kCsEnter(ps, rc) PDMCritSectEnter(&ps->cs, rc)
     
    17481752}
    17491753
     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 */
    17501756/**
    17511757 * Dump receive descriptor to debug log.
     
    17771783             E1K_SPEC_PRI(pDesc->status.u16Special)));
    17781784}
     1785#endif /* E1K_WITH_RXD_CACHE && IN_RING3 */
    17791786
    17801787/**
     
    19541961}
    19551962
     1963#ifdef IN_RING3 /* currently only used in ring-3 due to stack space requirements of the caller */
    19561964/**
    19571965 * Advance the head pointer of the receive descriptor queue.
     
    19922000    //e1kCsLeave(pThis);
    19932001}
     2002#endif /* IN_RING3 */
    19942003
    19952004#ifdef E1K_WITH_RXD_CACHE
     2005
    19962006/**
    19972007 * Return the number of RX descriptor that belong to the hardware.
     
    20872097}
    20882098
     2099# ifdef IN_RING3 /* currently only used in ring-3 due to stack space requirements of the caller */
     2100
    20892101/**
    20902102 * Obtain the next RX descriptor from RXD cache, fetching descriptors from the
     
    21112123    return NULL;
    21122124}
     2125
    21132126
    21142127/**
     
    21362149}
    21372150
    2138 # ifdef IN_RING3 /* currently only used in ring-3 due to stack space requirements of the caller */
    21392151/**
    21402152 * Store a fragment of received packet at the specifed address.
     
    21542166    STAM_PROFILE_ADV_STOP(&pThis->StatReceiveStore, a);
    21552167}
     2168
    21562169# endif
    21572170
     
    22062219    STAM_PROFILE_ADV_STOP(&pThis->StatReceiveStore, a);
    22072220}
     2221
    22082222#endif /* !E1K_WITH_RXD_CACHE */
    22092223
     
    32443258#  ifndef E1K_NO_TAD
    32453259    e1kCancelTimer(pThis, pThis->CTX_SUFF(pTADTimer));
    3246 #  endif /* E1K_NO_TAD */
     3260#  endif
    32473261    e1kRaiseInterrupt(pThis, ICR_TXDW);
    32483262}
     
    44514465                /* Cancel both timers if armed and fire immediately. */
    44524466                e1kCancelTimer(pThis, pThis->CTX_SUFF(pTADTimer));
    4453 # endif /* E1K_NO_TAD */
     4467# endif
    44544468#endif /* E1K_USE_TX_TIMERS */
    44554469                E1K_INC_ISTAT_CNT(pThis->uStatIntTx);
     
    70187032    pHlp->pfnPrintf(pHlp, "E1000 #%d: port=%RTiop mmio=%RGp mac-cfg=%RTmac %s%s%s\n",
    70197033                    pDevIns->iInstance, pThis->IOPortBase, pThis->addrMMReg,
    7020                     &pThis->macConfigured, g_Chips[pThis->eChip].pcszName,
     7034                    &pThis->macConfigured, g_aChips[pThis->eChip].pcszName,
    70217035                    pThis->fRCEnabled ? " GC" : "", pThis->fR0Enabled ? " R0" : "");
    70227036
     
    73757389static DECLCALLBACK(void) e1kConfigurePciDev(PPCIDEVICE pPciDev, E1KCHIP eChip)
    73767390{
    7377     Assert(eChip < RT_ELEMENTS(g_Chips));
     7391    Assert(eChip < RT_ELEMENTS(g_aChips));
    73787392    /* 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);
    73837397
    73847398    PCIDevSetWord( pPciDev, VBOX_PCI_COMMAND,            0x0000);
     
    75687582
    75697583    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,
    75717585            pThis->fEthernetCRC ? "on" : "off",
    75727586            pThis->fGSOEnabled ? "enabled" : "disabled",
  • trunk/src/VBox/Devices/Network/DevVirtioNet.cpp

    r62962 r63478  
    274274AssertCompileSize(VNETCTLHDR, 2);
    275275
     276#ifdef IN_RING3
     277
    276278/** Returns true if large packets are written into several RX buffers. */
    277279DECLINLINE(bool) vnetMergeableRxBuffers(PVNETSTATE pThis)
     
    289291    vpciCsLeave(&pThis->VPCI);
    290292}
     293
     294#endif /* IN_RING3 */
    291295
    292296DECLINLINE(int) vnetCsRxEnter(PVNETSTATE pThis, int rcBusy)
     
    307311}
    308312
     313#ifdef IN_RING3
    309314/**
    310315 * Dump a packet to debug log.
     
    317322DECLINLINE(void) vnetPacketDump(PVNETSTATE pThis, const uint8_t *pbPacket, size_t cb, const char *pszText)
    318323{
    319 #ifdef DEBUG
     324# ifdef DEBUG
    320325    Log(("%s %s packet #%d (%d bytes):\n",
    321326         INSTANCE(pThis), pszText, ++pThis->u32PktNo, cb));
    322327    Log3(("%.*Rhxd\n", cb, pbPacket));
    323 #else
     328# else
    324329    RT_NOREF4(pThis, pbPacket, cb, pszText);
    325 #endif
    326 }
     330# endif
     331}
     332#endif /* IN_RING3 */
    327333
    328334/**
  • trunk/src/VBox/Devices/Network/DrvIntNet.cpp

    r63461 r63478  
    269269 * @param   pThis               The instance data..
    270270 */
    271 DECLINLINE(int) drvIntNetSignalXmit(PDRVINTNET pThis)
     271DECLINLINE(int) drvR0IntNetSignalXmit(PDRVINTNET pThis)
    272272{
    273273    /// @todo if (!ASMAtomicXchgBool(&pThis->fXmitSignalled, true)) - needs careful optimizing.
     
    279279    return VERR_TRY_AGAIN;
    280280}
    281 #endif
     281#endif /* !IN_RING3 */
    282282
    283283
     
    306306    {
    307307        ASMAtomicUoWriteBool(&pThis->fXmitProcessRing, true);
    308         drvIntNetSignalXmit(pThis);
     308        drvR0IntNetSignalXmit(pThis);
    309309        rc = VINF_SUCCESS;
    310310    }
     
    351351        rc = VERR_TRY_AGAIN;
    352352#else  /* IN_RING0 */
    353         rc = drvIntNetSignalXmit(pThis);
     353        rc = drvR0IntNetSignalXmit(pThis);
    354354#endif /* IN_RING0 */
    355355    }
     
    381381    PPDMSCATTERGATHER pSgBuf = &pThis->u.Sg;
    382382    if (RT_UNLIKELY(pSgBuf->fFlags != 0))
    383         return drvIntNetSignalXmit(pThis);
     383        return drvR0IntNetSignalXmit(pThis);
    384384#endif
    385385
     
    444444    {
    445445        pThis->fXmitProcessRing = true;
    446         rc = drvIntNetSignalXmit(pThis);
     446        rc = drvR0IntNetSignalXmit(pThis);
    447447    }
    448448    else
  • trunk/src/VBox/Devices/Network/DrvNAT.cpp

    r63214 r63478  
    11451145            else
    11461146                LogRel(("NAT: DNS server list is empty (2)\n"));
     1147#else
     1148            RT_NOREF(hDynStor);
    11471149#endif
    11481150            drvNATUpdateDNS(pThis, /* fFlapLink */ true);
  • trunk/src/VBox/Devices/Network/SrvIntNetR0.cpp

    r63458 r63478  
    897897    return Addr.u == UINT32_MAX;
    898898}
    899 #endif
     899#endif /* unused */
    900900
    901901
     
    10321032    return intnetR0IfAddrCacheLookup(pCache, pAddr, cbAddr);
    10331033}
    1034 
    10351034
    10361035#if 0 /* unused */
     
    12201219
    12211220#if 0 /* unused */
    1222 
    12231221/**
    12241222 * Deletes the address from all the interface caches except the specified one.
     
    12521250    RTSpinlockRelease(pNetwork->hAddrSpinlock);
    12531251}
    1254 
    1255 #endif
     1252#endif /* unused */
    12561253
    12571254
  • trunk/src/VBox/Devices/Network/slirp/ip_icmp.c

    r63459 r63478  
    6464/* The message sent when emulating PING */
    6565/* Be nice and tell them it's just a psuedo-ping packet */
    66 #if 0
     66#if 0 /* unused */
    6767static const char icmp_ping_msg[] = "This is a psuedo-PING packet used by Slirp to emulate ICMP ECHO-REQUEST packets.\n";
    6868#endif
  • trunk/src/VBox/Devices/Network/slirp/tftp.c

    r63014 r63478  
    196196
    197197
     198#if 0 /* unused */
    198199DECLINLINE(bool) tftpIsAcceptableOption(const char *pszOptionName)
    199200{
     
    214215    return false;
    215216}
     217#endif /* unused */
    216218
    217219
  • trunk/src/VBox/Devices/PC/DevRTC.cpp

    r62890 r63478  
    264264
    265265
     266#ifdef IN_RING3
    266267DECLINLINE(int) to_bcd(PRTCSTATE pThis, int a)
    267268{
     
    270271    return ((a / 10) << 4) | (a % 10);
    271272}
     273#endif
    272274
    273275
  • trunk/src/VBox/Devices/Storage/DevAHCI.cpp

    r63218 r63478  
    54765476}
    54775477
     5478#if 0 /* unused */
    54785479DECLINLINE(uint8_t) ahciGetTagQueued(uint8_t *pCmdFis)
    54795480{
    54805481    return pCmdFis[AHCI_CMDFIS_SECTC] >> 3;
    54815482}
     5483#endif /* unused */
    54825484
    54835485/**
  • trunk/src/VBox/Devices/Storage/DevATA.cpp

    r62925 r63478  
    548548
    549549
     550#ifdef IN_RING3
    550551DECLINLINE(void) ataSetStatusValue(ATADevState *s, uint8_t stat)
    551552{
     
    559560    }
    560561}
     562#endif /* IN_RING3 */
    561563
    562564
     
    722724static const ATARequest g_ataDMARequest    = { ATA_AIO_DMA,            { { 0, 0, 0, 0, 0 } } };
    723725static const ATARequest g_ataPIORequest    = { ATA_AIO_PIO,            { { 0, 0, 0, 0, 0 } } };
     726# ifdef IN_RING3
    724727static const ATARequest g_ataResetARequest = { ATA_AIO_RESET_ASSERTED, { { 0, 0, 0, 0, 0 } } };
    725728static const ATARequest g_ataResetCRequest = { ATA_AIO_RESET_CLEARED,  { { 0, 0, 0, 0, 0 } } };
     729# endif
    726730
    727731# ifdef IN_RING3
     
    11661170}
    11671171
     1172
     1173#if 0 /* unused */
    11681174/**
    11691175 * Compares two MSF values.
     
    11931199    return iRes;
    11941200}
     1201#endif /* unused */
    11951202
    11961203static void ataR3CmdOK(ATADevState *s, uint8_t status)
  • trunk/src/VBox/Devices/Storage/DevBusLogic.cpp

    r63218 r63478  
    304304#define ISA_BASE_DISABLED   6
    305305
     306#ifdef IN_RING3
    306307static uint16_t const g_aISABases[NUM_ISA_BASES] =
    307308{
    308309    0x330, 0x334, 0x230, 0x234, 0x130, 0x134, 0, 0
    309310};
     311#endif
    310312/** @}  */
    311313
  • trunk/src/VBox/Devices/Storage/DrvHostBase.cpp

    r62956 r63478  
    664664static void drvHostBaseDADoneCallback(DADiskRef DiskRef, DADissenterRef DissenterRef, void *pvContext)
    665665{
     666    RT_NOREF(DiskRef);
    666667    int *prc = (int *)pvContext;
    667668    if (!DissenterRef)
     
    792793{
    793794# ifdef RT_OS_DARWIN
     795    RT_NOREF(fReadOnly);
     796
    794797    /* Darwin is kind of special... */
    795798    Assert(!pFileDevice); NOREF(pFileDevice);
    796799    Assert(!pThis->cbBlock);
    797     Assert(!pThis->MasterPort);
     800    Assert(pThis->MasterPort == IO_OBJECT_NULL);
    798801    Assert(!pThis->ppMMCDI);
    799802    Assert(!pThis->ppScsiTaskDI);
     
    818821     * do the search and get a collection of keyboards.
    819822     */
    820     io_iterator_t DVDServices = NULL;
     823    io_iterator_t DVDServices = IO_OBJECT_NULL;
    821824    IOReturn irc = IOServiceGetMatchingServices(pThis->MasterPort, RefMatchingDict, &DVDServices);
    822825    AssertMsgReturn(irc == kIOReturnSuccess, ("irc=%d\n", irc), VERR_NOT_FOUND);
     
    11381141        RTFileClose(pThis->hFileDevice);
    11391142    pThis->hFileDevice = hFileDevice;
    1140 #endif /* !RT_OS_DARWIN */
     1143#else  /* RT_OS_DARWIN */
     1144    RT_NOREF(pThis);
     1145#endif /* RT_OS_DARWIN */
    11411146    return VINF_SUCCESS;
    11421147}
     
    17921797        pThis->ppMMCDI = NULL;
    17931798    }
    1794     if (pThis->MasterPort)
     1799    if (pThis->MasterPort != IO_OBJECT_NULL)
    17951800    {
    17961801        mach_port_deallocate(mach_task_self(), pThis->MasterPort);
    1797         pThis->MasterPort = 0;
     1802        pThis->MasterPort = IO_OBJECT_NULL;
    17981803    }
    17991804    if (pThis->pDASession)
     
    18751880    pThis->ThreadPoller                     = NIL_RTTHREAD;
    18761881#ifdef RT_OS_DARWIN
    1877     pThis->MasterPort                       = NULL;
     1882    pThis->MasterPort                       = IO_OBJECT_NULL;
    18781883    pThis->ppMMCDI                          = NULL;
    18791884    pThis->ppScsiTaskDI                     = NULL;
  • trunk/src/VBox/Devices/USB/DevOHCI.cpp

    r63016 r63478  
    772772#ifndef VBOX_DEVICE_STRUCT_TESTCASE
    773773
     774#ifdef VBOX_WITH_OHCI_PHYS_READ_STATS
     775/*
     776 * Explain
     777 */
     778typedef 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;
     788typedef OHCIDESCREADSTATS *POHCIDESCREADSTATS;
     789
     790typedef 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;
     800typedef OHCIPHYSREADSTATS *POHCIPHYSREADSTATS;
     801typedef OHCIPHYSREADSTATS const *PCOHCIPHYSREADSTATS;
     802#endif /* VBOX_WITH_OHCI_PHYS_READ_STATS */
     803
    774804
    775805/*********************************************************************************************************************************
    776806*   Global Variables                                                                                                             *
    777807*********************************************************************************************************************************/
     808#if defined(VBOX_WITH_OHCI_PHYS_READ_STATS) && defined(IN_RING3)
     809static OHCIPHYSREADSTATS g_PhysReadState;
     810#endif
     811
    778812#if defined(LOG_ENABLED) && defined(IN_RING3)
    779813static bool g_fLogBulkEPs = false;
     
    873907}
    874908
     909#ifdef IN_RING3
     910
    875911/**
    876912 * Set an interrupt, use the wrapper ohciSetInterrupt.
     
    895931 * Set an interrupt wrapper macro for logging purposes.
    896932 */
    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
    901935
    902936/* Carry out a hardware remote wakeup */
     
    12171251        VUSBIDevReset(pThis->RootHub.pIDev, fResetOnLinux, NULL, NULL, NULL);
    12181252}
    1219 #endif /* IN_RING3 */
    12201253
    12211254/**
     
    12431276{
    12441277    ohciPhysRead(pThis, Addr, pau32s, c32s * sizeof(uint32_t));
    1245 #ifndef RT_LITTLE_ENDIAN
     1278# ifndef RT_LITTLE_ENDIAN
    12461279    for(int i = 0; i < c32s; i++)
    12471280        pau32s[i] = RT_H2LE_U32(pau32s[i]);
    1248 #endif
     1281# endif
    12491282}
    12501283
     
    12541287DECLINLINE(void) ohciPutDWords(POHCI pThis, uint32_t Addr, const uint32_t *pau32s, int cu32s)
    12551288{
    1256 #ifdef RT_LITTLE_ENDIAN
     1289# ifdef RT_LITTLE_ENDIAN
    12571290    ohciPhysWrite(pThis, Addr, pau32s, cu32s << 2);
    1258 #else
     1291# else
    12591292    for (int i = 0; i < c32s; i++, pau32s++, Addr += sizeof(*pau32s))
    12601293    {
     
    12621295        ohciPhysWrite(pThis, Addr, (uint8_t *)&u32Tmp, sizeof(u32Tmp));
    12631296    }
    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
     1304static void descReadStatsReset(POHCIDESCREADSTATS p)
    12961305{
    12971306    p->cReads = 0;
     
    13041313}
    13051314
    1306 static void physReadStatsReset(struct PhysReadStats *p)
     1315static void physReadStatsReset(POHCIPHYSREADSTATS p)
    13071316{
    13081317    descReadStatsReset(&p->ed);
     
    13151324}
    13161325
    1317 static void physReadStatsUpdateDesc(struct DescReadStats *p, uint32_t u32Addr)
     1326static void physReadStatsUpdateDesc(POHCIDESCREADSTATS p, uint32_t u32Addr)
    13181327{
    13191328    const uint32_t u32PageAddr = u32Addr & ~UINT32_C(0xFFF);
     
    13451354}
    13461355
    1347 static void physReadStatsPrint(struct PhysReadStats *p)
     1356static void physReadStatsPrint(PCOHCIPHYSREADSTATS p)
    13481357{
    13491358    p->ed.cMinReadsPerPage = RT_MIN(p->ed.cMinReadsPerPage, p->ed.cReadsLastPage);
     
    13701379    physReadStatsReset(p);
    13711380}
    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
    13751385static POHCIPAGECACHE ohciPhysReadCacheAlloc(void)
    13761386{
     
    13991409                              pPageCache->au8PhysReadCache, sizeof(pPageCache->au8PhysReadCache));
    14001410            pPageCache->GCPhysReadCacheAddr = PageAddr;
    1401 #ifdef VBOX_WITH_OHCI_PHYS_READ_STATS
    1402             ++physReadStats.cPageReads;
    1403 #endif
     1411#  ifdef VBOX_WITH_OHCI_PHYS_READ_STATS
     1412            ++g_PhysReadState.cPageReads;
     1413#  endif
    14041414        }
    14051415
    14061416        memcpy(pvBuf, &pPageCache->au8PhysReadCache[GCPhys & PAGE_OFFSET_MASK], cbBuf);
    1407 #ifdef VBOX_WITH_OHCI_PHYS_READ_STATS
    1408         ++physReadStats.cCacheReads;
    1409 #endif
     1417#  ifdef VBOX_WITH_OHCI_PHYS_READ_STATS
     1418        ++g_PhysReadState.cCacheReads;
     1419#  endif
    14101420    }
    14111421    else
    14121422    {
    14131423        PDMDevHlpPhysRead(pThis->pDevInsR3, GCPhys, pvBuf, cbBuf);
    1414 #ifdef VBOX_WITH_OHCI_PHYS_READ_STATS
    1415         ++physReadStats.cCrossReads;
    1416 #endif
     1424#  ifdef VBOX_WITH_OHCI_PHYS_READ_STATS
     1425        ++g_PhysReadState.cCrossReads;
     1426#  endif
    14171427    }
    14181428}
     
    14271437    ohciPhysReadCacheRead(pThis, pThis->pCacheTD, TdAddr, pTd, sizeof(*pTd));
    14281438}
    1429 #endif /* VBOX_WITH_OHCI_PHYS_READ_CACHE */
     1439
     1440# endif /* VBOX_WITH_OHCI_PHYS_READ_CACHE */
    14301441
    14311442/**
     
    14341445DECLINLINE(void) ohciReadEd(POHCI pThis, uint32_t EdAddr, POHCIED pEd)
    14351446{
    1436 #ifdef VBOX_WITH_OHCI_PHYS_READ_STATS
    1437     physReadStatsUpdateDesc(&physReadStats.ed, EdAddr);
    1438     physReadStatsUpdateDesc(&physReadStats.all, EdAddr);
    1439 #endif
     1447# ifdef VBOX_WITH_OHCI_PHYS_READ_STATS
     1448    physReadStatsUpdateDesc(&g_PhysReadState.ed, EdAddr);
     1449    physReadStatsUpdateDesc(&g_PhysReadState.all, EdAddr);
     1450# endif
    14401451    ohciGetDWords(pThis, EdAddr, (uint32_t *)pEd, sizeof(*pEd) >> 2);
    14411452}
     
    14461457DECLINLINE(void) ohciReadTd(POHCI pThis, uint32_t TdAddr, POHCITD pTd)
    14471458{
    1448 #ifdef VBOX_WITH_OHCI_PHYS_READ_STATS
    1449     physReadStatsUpdateDesc(&physReadStats.td, TdAddr);
    1450     physReadStatsUpdateDesc(&physReadStats.all, TdAddr);
    1451 #endif
     1459# ifdef VBOX_WITH_OHCI_PHYS_READ_STATS
     1460    physReadStatsUpdateDesc(&g_PhysReadState.td, TdAddr);
     1461    physReadStatsUpdateDesc(&g_PhysReadState.all, TdAddr);
     1462# endif
    14521463    ohciGetDWords(pThis, TdAddr, (uint32_t *)pTd, sizeof(*pTd) >> 2);
    1453 #ifdef LOG_ENABLED
     1464# ifdef LOG_ENABLED
    14541465    if (LogIs3Enabled())
    14551466    {
     
    14681479              pTd->be,
    14691480              pTd->hwinfo & TD_HWINFO_UNKNOWN_MASK));
    1470 #if 0
     1481#  if 0
    14711482        if (LogIs3Enabled())
    14721483        {
     
    14931504                  sizeof(abXpTd), &abXpTd[0]));
    14941505        }
    1495 #endif
    1496     }
    1497 #endif
     1506#  endif
     1507    }
     1508# endif
    14981509}
    14991510
     
    15041515{
    15051516    ohciGetDWords(pThis, ITdAddr, (uint32_t *)pITd, sizeof(*pITd) / sizeof(uint32_t));
    1506 #ifdef LOG_ENABLED
     1517# ifdef LOG_ENABLED
    15071518    if (LogIs3Enabled())
    15081519    {
     
    15261537              pITd->aPSW[7] >> 12, pITd->aPSW[7] & 0xfff));
    15271538    }
    1528 #endif
     1539# endif
    15291540}
    15301541
     
    15351546DECLINLINE(void) ohciWriteEd(POHCI pThis, uint32_t EdAddr, PCOHCIED pEd)
    15361547{
    1537 #ifdef LOG_ENABLED
     1548# ifdef LOG_ENABLED
    15381549    if (LogIs3Enabled())
    15391550    {
     
    15581569              EdOld.NextED != pEd->NextED ? "*" : "", pEd->NextED));
    15591570    }
    1560 #endif
     1571# endif
    15611572
    15621573    ohciPutDWords(pThis, EdAddr, (uint32_t *)pEd, sizeof(*pEd) >> 2);
     
    15691580DECLINLINE(void) ohciWriteTd(POHCI pThis, uint32_t TdAddr, PCOHCITD pTd, const char *pszLogMsg)
    15701581{
    1571 #ifdef LOG_ENABLED
     1582# ifdef LOG_ENABLED
    15721583    if (LogIs3Enabled())
    15731584    {
     
    15881599              pszLogMsg));
    15891600    }
    1590 #else
     1601# else
    15911602    RT_NOREF(pszLogMsg);
    1592 #endif
     1603# endif
    15931604    ohciPutDWords(pThis, TdAddr, (uint32_t *)pTd, sizeof(*pTd) >> 2);
    15941605}
     
    15991610DECLINLINE(void) ohciWriteITd(POHCI pThis, uint32_t ITdAddr, PCOHCIITD pITd, const char *pszLogMsg)
    16001611{
    1601 #ifdef LOG_ENABLED
     1612# ifdef LOG_ENABLED
    16021613    if (LogIs3Enabled())
    16031614    {
     
    16251636              (ITdOld.aPSW[7] >> 12) != (pITd->aPSW[7] >> 12) ? "*" : "", pITd->aPSW[7] >> 12,  (ITdOld.aPSW[7] & 0xfff) != (pITd->aPSW[7] & 0xfff) ? "*" : "", pITd->aPSW[7] & 0xfff));
    16261637    }
    1627 #else
     1638# else
    16281639    RT_NOREF(pszLogMsg);
    1629 #endif
     1640# endif
    16301641    ohciPutDWords(pThis, ITdAddr, (uint32_t *)pITd, sizeof(*pITd) / sizeof(uint32_t));
    16311642}
    16321643
    16331644
    1634 #ifdef LOG_ENABLED
     1645# ifdef LOG_ENABLED
    16351646
    16361647/**
     
    17701781}
    17711782
    1772 #endif /* LOG_ENABLED */
     1783# endif /* LOG_ENABLED */
    17731784
    17741785
     
    18041815    if (i >= 0)
    18051816    {
    1806 #ifdef LOG_ENABLED
     1817# ifdef LOG_ENABLED
    18071818        pUrb->pHci->u32FrameNo = pThis->HcFmNumber;
    1808 #endif
     1819# endif
    18091820        pThis->aInFlight[i].GCPhysTD = GCPhysTD;
    18101821        pThis->aInFlight[i].pUrb = pUrb;
     
    19081919    if (i >= 0)
    19091920    {
    1910 #ifdef LOG_ENABLED
     1921# ifdef LOG_ENABLED
    19111922        const int cFramesInFlight = pThis->HcFmNumber - pThis->aInFlight[i].pUrb->pHci->u32FrameNo;
    1912 #else
     1923# else
    19131924        const int cFramesInFlight = 0;
    1914 #endif
     1925# endif
    19151926        Log2(("ohci_in_flight_remove: reaping TD=%#010x %d frames (%#010x-%#010x)\n",
    19161927              GCPhysTD, cFramesInFlight, pThis->aInFlight[i].pUrb->pHci->u32FrameNo, pThis->HcFmNumber));
     
    19461957
    19471958
    1948 #if defined(VBOX_STRICT) || defined(LOG_ENABLED)
     1959# if defined(VBOX_STRICT) || defined(LOG_ENABLED)
    19491960
    19501961/**
     
    19811992{
    19821993    int i = ohci_in_done_queue_find(pThis, GCPhysTD);
    1983 #if 0
     1994#  if 0
    19841995    /* This condition has been observed with the USB tablet emulation or with
    19851996     * a real USB mouse and an SMP XP guest.  I am also not sure if this is
     
    19932004     */
    19942005    AssertMsg(i < 0, ("TD %#010x (i=%d)\n", GCPhysTD, i));
    1995 #endif
     2006#  endif
    19962007    return i < 0;
    19972008}
    19982009
    19992010
    2000 # ifdef VBOX_STRICT
     2011#  ifdef VBOX_STRICT
    20012012/**
    20022013 * Adds a TD to the in-done-queue tracking, checking that it's not there already.
     
    20102021        pThis->aInDoneQueue[pThis->cInDoneQueue++].GCPhysTD = GCPhysTD;
    20112022}
    2012 # endif /* VBOX_STRICT */
    2013 #endif /* defined(VBOX_STRICT) || defined(LOG_ENABLED) */
     2023#  endif /* VBOX_STRICT */
     2024# endif /* defined(VBOX_STRICT) || defined(LOG_ENABLED) */
    20142025
    20152026
     
    25242535         * Move on to the done list and write back the modified TD.
    25252536         */
    2526 #ifdef LOG_ENABLED
     2537# ifdef LOG_ENABLED
    25272538        if (!pThis->done)
    25282539            pThis->u32FmDoneQueueTail = pThis->HcFmNumber;
    2529 # ifdef VBOX_STRICT
     2540#  ifdef VBOX_STRICT
    25302541        ohci_in_done_queue_add(pThis, ITdAddr);
     2542#  endif
    25312543# endif
    2532 #endif
    25332544        pITd->NextTD = pThis->done;
    25342545        pThis->done = ITdAddr;
     
    26632674         * Move on to the done list and write back the modified TD.
    26642675         */
    2665 #ifdef LOG_ENABLED
     2676# ifdef LOG_ENABLED
    26662677        if (!pThis->done)
    26672678            pThis->u32FmDoneQueueTail = pThis->HcFmNumber;
    2668 # ifdef VBOX_STRICT
     2679#  ifdef VBOX_STRICT
    26692680        ohci_in_done_queue_add(pThis, TdAddr);
     2681#  endif
    26702682# endif
    2671 #endif
    26722683        pTd->NextTD = pThis->done;
    26732684        pThis->done = TdAddr;
     
    29432954    if (ohciIsTdInFlight(pThis, TdAddr))
    29442955        return false;
    2945 #if defined(VBOX_STRICT) || defined(LOG_ENABLED)
     2956# if defined(VBOX_STRICT) || defined(LOG_ENABLED)
    29462957    ohci_in_done_queue_check(pThis, TdAddr);
    2947 #endif
     2958# endif
    29482959    return ohciServiceTd(pThis, enmType, pEd, EdAddr, TdAddr, &TdAddr, pszListName);
    29492960}
     
    29732984    }   Head;
    29742985
    2975 #ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE
     2986# ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE
    29762987    ohciPhysReadCacheClear(pThis->pCacheTD);
    2977 #endif
     2988# endif
    29782989
    29792990    /* read the head */
    2980 #ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE
     2991# ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE
    29812992    ohciReadTdCached(pThis, TdAddr, &Head.Td);
    2982 #else
     2993# else
    29832994    ohciReadTd(pThis, TdAddr, &Head.Td);
    2984 #endif
     2995# endif
    29852996    ohciBufInit(&Head.Buf, Head.Td.cbp, Head.Td.be);
    29862997    Head.TdAddr = TdAddr;
     
    30003011        pCur->pNext = NULL;
    30013012        pCur->TdAddr = pTail->Td.NextTD & ED_PTR_MASK;
    3002 #ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE
     3013# ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE
    30033014        ohciReadTdCached(pThis, pCur->TdAddr, &pCur->Td);
    3004 #else
     3015# else
    30053016        ohciReadTd(pThis, pCur->TdAddr, &pCur->Td);
    3006 #endif
     3017# endif
    30073018        ohciBufInit(&pCur->Buf, pCur->Td.cbp, pCur->Td.be);
    30083019
     
    31213132    if (ohciIsTdInFlight(pThis, TdAddr))
    31223133        return false;
    3123 #if defined(VBOX_STRICT) || defined(LOG_ENABLED)
     3134# if defined(VBOX_STRICT) || defined(LOG_ENABLED)
    31243135    ohci_in_done_queue_check(pThis, TdAddr);
    3125 #endif
     3136# endif
    31263137    return ohciServiceTdMultiple(pThis, enmType, pEd, EdAddr, TdAddr, &TdAddr, pszListName);
    31273138}
     
    32743285    AssertCompile(sizeof(pUrb->paTds[0].TdCopy) >= sizeof(*pITd));
    32753286    memcpy(pUrb->paTds[0].TdCopy, pITd, sizeof(*pITd));
    3276 #if 0 /* color the data */
     3287# if 0 /* color the data */
    32773288    memset(pUrb->abData, 0xfe, cbTotal);
    3278 #endif
     3289# endif
    32793290
    32803291    /* copy the data */
     
    33993410        else
    34003411        {
    3401 #if 1
     3412# if 1
    34023413            /*
    34033414             * Ok, the launch window for this TD has passed.
     
    34223433                break;
    34233434            }
    3424 #else /* BAD IDEA: */
     3435# else /* BAD IDEA: */
    34253436            /*
    34263437             * Ok, the launch window for this TD has passed.
     
    34393450                break;
    34403451            }
    3441 #endif
     3452# endif
    34423453        }
    34433454
     
    34843495static void ohciServiceBulkList(POHCI pThis)
    34853496{
    3486 #ifdef LOG_ENABLED
     3497# ifdef LOG_ENABLED
    34873498    if (g_fLogBulkEPs)
    34883499        ohciDumpEdList(pThis, pThis->bulk_head, "Bulk before", true);
    34893500    if (pThis->bulk_cur)
    34903501        Log(("ohciServiceBulkList: bulk_cur=%#010x before listprocessing!!! HCD have positioned us!!!\n", pThis->bulk_cur));
    3491 #endif
     3502# endif
    34923503
    34933504    /*
     
    35043515    {
    35053516        OHCIED Ed;
    3506 #ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE
     3517# ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE
    35073518        ohciReadEdCached(pThis, EdAddr, &Ed);
    3508 #else
     3519# else
    35093520        ohciReadEd(pThis, EdAddr, &Ed);
    3510 #endif
     3521# endif
    35113522        Assert(!(Ed.hwinfo & ED_HWINFO_ISO)); /* the guest is screwing us */
    35123523        if (ohciIsEdReady(&Ed))
     
    35153526            pThis->fBulkNeedsCleaning = true;
    35163527
    3517 #if 1
     3528# if 1
    35183529            /*
    35193530
     
    35253536             */
    35263537            ohciServiceHeadTdMultiple(pThis, VUSBXFERTYPE_BULK, &Ed, EdAddr, "Bulk");
    3527 #else
     3538# else
    35283539            /*
    35293540             * This alternative code was used before we started reassembling URBs from
     
    35503561                } while (ohciIsEdReady(&Ed));
    35513562            }
    3552 #endif
     3563# endif
    35533564        }
    35543565        else
     
    35723583    }
    35733584
    3574 #ifdef LOG_ENABLED
     3585# ifdef LOG_ENABLED
    35753586    if (g_fLogBulkEPs)
    35763587        ohciDumpEdList(pThis, pThis->bulk_head, "Bulk after ", true);
    3577 #endif
     3588# endif
    35783589}
    35793590
     
    35883599static void ohciUndoBulkList(POHCI pThis)
    35893600{
    3590 #ifdef LOG_ENABLED
     3601# ifdef LOG_ENABLED
    35913602    if (g_fLogBulkEPs)
    35923603        ohciDumpEdList(pThis, pThis->bulk_head, "Bulk before", true);
    35933604    if (pThis->bulk_cur)
    35943605        Log(("ohciUndoBulkList: bulk_cur=%#010x before list processing!!! HCD has positioned us!!!\n", pThis->bulk_cur));
    3595 #endif
     3606# endif
    35963607
    35973608    /* This flag follows OHCI_STATUS_BLF, but BLF doesn't change when list processing is disabled. */
     
    36023613    {
    36033614        OHCIED Ed;
    3604 #ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE
     3615# ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE
    36053616        ohciReadEdCached(pThis, EdAddr, &Ed);
    3606 #else
     3617# else
    36073618        ohciReadEd(pThis, EdAddr, &Ed);
    3608 #endif
     3619# endif
    36093620        Assert(!(Ed.hwinfo & ED_HWINFO_ISO)); /* the guest is screwing us */
    36103621        if (ohciIsEdPresent(&Ed))
     
    36333644static void ohciServiceCtrlList(POHCI pThis)
    36343645{
    3635 #ifdef LOG_ENABLED
     3646# ifdef LOG_ENABLED
    36363647    if (g_fLogControlEPs)
    36373648        ohciDumpEdList(pThis, pThis->ctrl_head, "Ctrl before", true);
    36383649    if (pThis->ctrl_cur)
    36393650        Log(("ohciServiceCtrlList: ctrl_cur=%010x before list processing!!! HCD have positioned us!!!\n", pThis->ctrl_cur));
    3640 #endif
     3651# endif
    36413652
    36423653    /*
     
    36563667        if (ohciIsEdReady(&Ed))
    36573668        {
    3658 #if 1
     3669# if 1
    36593670            /*
    36603671             * Control TDs depends on order and stage. Only one can be in-flight
     
    36733684                ohciReadEd(pThis, EdAddr, &Ed); /* It might have been updated on URB completion. */
    36743685            } while (ohciIsEdReady(&Ed));
    3675 #else
     3686# else
    36763687            /* Simplistic, for debugging. */
    36773688            ohciServiceHeadTd(pThis, VUSBXFERTYPE_CTRL, &Ed, EdAddr, "Control");
    36783689            pThis->status |= OHCI_STATUS_CLF;
    3679 #endif
     3690# endif
    36803691        }
    36813692
     
    36843695    }
    36853696
    3686 #ifdef LOG_ENABLED
     3697# ifdef LOG_ENABLED
    36873698    if (g_fLogControlEPs)
    36883699        ohciDumpEdList(pThis, pThis->ctrl_head, "Ctrl after ", true);
    3689 #endif
     3700# endif
    36903701}
    36913702
     
    37073718    ohciGetDWords(pThis, pThis->hcca + iList * sizeof(EdAddr), &EdAddr, 1);
    37083719
    3709 #ifdef LOG_ENABLED
     3720# ifdef LOG_ENABLED
    37103721    const uint32_t EdAddrHead = EdAddr;
    37113722    if (g_fLogInterruptEPs)
     
    37153726        ohciDumpEdList(pThis, EdAddrHead, sz, true);
    37163727    }
    3717 #endif
     3728# endif
    37183729
    37193730    /*
     
    37233734    {
    37243735        OHCIED Ed;
    3725 #ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE
     3736# ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE
    37263737        ohciReadEdCached(pThis, EdAddr, &Ed);
    3727 #else
     3738# else
    37283739        ohciReadEd(pThis, EdAddr, &Ed);
    3729 #endif
     3740# endif
    37303741
    37313742        if (ohciIsEdReady(&Ed))
     
    37713782    }
    37723783
    3773 #ifdef LOG_ENABLED
     3784# ifdef LOG_ENABLED
    37743785    if (g_fLogInterruptEPs)
    37753786    {
     
    37783789        ohciDumpEdList(pThis, EdAddrHead, sz, true);
    37793790    }
    3780 #endif
     3791# endif
    37813792}
    37823793
     
    38113822        Log(("ohci: Writeback Done (%#010x) on frame %#x (age %#x)\n", hcca.done,
    38123823             pThis->HcFmNumber, pThis->HcFmNumber - pThis->u32FmDoneQueueTail));
    3813 #ifdef LOG_ENABLED
     3824# ifdef LOG_ENABLED
    38143825        ohciDumpTdQueue(pThis, hcca.done & ED_PTR_MASK, "DoneQueue");
    3815 #endif
     3826# endif
    38163827        Assert(RT_OFFSETOF(struct ohci_hcca, done) == 4);
    3817 #if defined(VBOX_STRICT) || defined(LOG_ENABLED)
     3828# if defined(VBOX_STRICT) || defined(LOG_ENABLED)
    38183829        ohci_in_done_queue_zap(pThis);
    3819 #endif
     3830# endif
    38203831        fWriteDoneHeadInterrupt = true;
    38213832    }
     
    38593870    Assert(cLeft == 0);
    38603871
    3861 #ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE
     3872# ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE
    38623873    /* Get hcca data to minimize calls to ohciGetDWords/PDMDevHlpPhysRead. */
    38633874    uint32_t au32HCCA[OHCI_HCCA_NUM_INTR];
    38643875    ohciGetDWords(pThis, pThis->hcca, au32HCCA, OHCI_HCCA_NUM_INTR);
    3865 #endif
     3876# endif
    38663877
    38673878    /* Go over all bulk/control/interrupt endpoint lists; any URB found in these lists
     
    38793890            break;
    38803891        default:
    3881 #ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE
     3892# ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE
    38823893            EdAddr = au32HCCA[i];
    3883 #else
     3894# else
    38843895            ohciGetDWords(pThis, pThis->hcca + i * sizeof(EdAddr), &EdAddr, 1);
    3885 #endif
     3896# endif
    38863897            break;
    38873898        }
     
    38903901            OHCIED Ed;
    38913902            OHCITD Td;
    3892 #ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE
     3903# ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE
    38933904            ohciReadEdCached(pThis, EdAddr, &Ed);
    3894 #else
     3905# else
    38953906            ohciReadEd(pThis, EdAddr, &Ed);
    3896 #endif
     3907# endif
    38973908            uint32_t TdAddr = Ed.HeadP & ED_PTR_MASK;
    38983909            uint32_t TailP  = Ed.TailP & ED_PTR_MASK;
     
    39013912                && (TdAddr != TailP))
    39023913            {
    3903 #ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE
     3914# ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE
    39043915                ohciPhysReadCacheClear(pThis->pCacheTD);
    3905 #endif
     3916# endif
    39063917                do
    39073918                {
    3908 #ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE
     3919# ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE
    39093920                    ohciReadTdCached(pThis, TdAddr, &Td);
    3910 #else
     3921# else
    39113922                    ohciReadTd(pThis, TdAddr, &Td);
    3912 #endif
     3923# endif
    39133924                    j = ohci_in_flight_find(pThis, TdAddr);
    39143925                    if (j > -1)
     
    39563967static void ohciStartOfFrame(POHCI pThis)
    39573968{
    3958 #ifdef LOG_ENABLED
     3969# ifdef LOG_ENABLED
    39593970    const uint32_t status_old = pThis->status;
    3960 #endif
     3971# endif
    39613972
    39623973    /*
     
    39733984                        ||  pThis->hcca < ~OHCI_HCCA_MASK);
    39743985
    3975 #if 1
     3986# if 1
    39763987    /*
    39773988     * Update the HCCA.
     
    39803991    if (fValidHCCA)
    39813992        ohciUpdateHCCA(pThis);
    3982 #endif
     3993# endif
    39833994
    39843995    /* "After writing to HCCA, HC will set SF in HcInterruptStatus" - guest isn't executing, so ignore the order! */
     
    40224033        ohciUndoBulkList(pThis);    /* If list disabled but not empty, abort endpoints. */
    40234034
    4024 #if 0
     4035# if 0
    40254036    /*
    40264037     * Update the HCCA after processing the lists and everything. A bit experimental.
     
    40374048     */
    40384049    ohciUpdateHCCA(pThis);
    4039 #endif
    4040 
    4041 #ifdef LOG_ENABLED
     4050# endif
     4051
     4052# ifdef LOG_ENABLED
    40424053    if (pThis->status ^ status_old)
    40434054    {
     
    40524063              chg & (3<<16)? "*" : "", (val >> 16) & 3));
    40534064    }
    4054 #endif
     4065# endif
    40554066}
    40564067
     
    40784089    pThis->fIdle = true;
    40794090
    4080 #ifdef VBOX_WITH_OHCI_PHYS_READ_STATS
    4081     physReadStatsReset(&physReadStats);
    4082 #endif
    4083 
    4084 #ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE
     4091# ifdef VBOX_WITH_OHCI_PHYS_READ_STATS
     4092    physReadStatsReset(&g_PhysReadState);
     4093# endif
     4094
     4095# ifdef VBOX_WITH_OHCI_PHYS_READ_CACHE
    40854096    ohciPhysReadCacheClear(pThis->pCacheED);
    40864097    ohciPhysReadCacheClear(pThis->pCacheTD);
    4087 #endif
     4098# endif
    40884099
    40894100    /* Frame boundary, so do EOF stuff here. */
     
    40984109    ohciStartOfFrame(pThis);
    40994110
    4100 #ifdef VBOX_WITH_OHCI_PHYS_READ_STATS
    4101     physReadStatsPrint(&physReadStats);
    4102 #endif
     4111# ifdef VBOX_WITH_OHCI_PHYS_READ_STATS
     4112    physReadStatsPrint(&g_PhysReadState);
     4113# endif
    41034114
    41044115    RTCritSectLeave(&pThis->CritSect);
  • trunk/src/VBox/Devices/VirtIO/Virtio.cpp

    r63369 r63478  
    623623}
    624624
     625#if 0 /* unused */
    625626/**
    626627 * Sets 32-bit register in PCI configuration space.
     
    635636    *(uint32_t*)&refPciDev.config[uOffset] = u32Value;
    636637}
     638#endif /* unused */
    637639
    638640
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette