VirtualBox

Changeset 63478 in vbox for trunk/src/VBox/Devices/USB


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

Devices: warnings (clang)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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);
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