VirtualBox

Changeset 1812 in vbox for trunk/src/VBox/VMM


Ignore:
Timestamp:
Mar 29, 2007 5:49:36 PM (18 years ago)
Author:
vboxsync
Message:

r=bird: Not entirely sure if inverting the destruction order is a good thing or not, but if it is, we should also invert the notification order for consistency. It would be better if drivers/devices didn't rely on order at all.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/PDM.cpp

    r1774 r1812  
    328328     * The attached drivers are processed first.
    329329     * N.B. There is no need to mess around freeing memory allocated
    330      *      from any MM heap since MM will do that in it's Term function.
     330     *      from any MM heap since MM will do that in its Term function.
    331331     */
    332332    for (PPDMDEVINS pDevIns = pVM->pdm.s.pDevInstances; pDevIns; pDevIns = pDevIns->Internal.s.pNextHC)
     
    334334        for (PPDMLUN pLun = pDevIns->Internal.s.pLunsHC; pLun; pLun = pLun->pNext)
    335335        {
    336             PPDMDRVINS pDrvIns;
    337 
    338             /* Find the bottom driver */
    339             for (pDrvIns = pLun->pTop; pDrvIns && pDrvIns->Internal.s.pDown; pDrvIns = pDrvIns->Internal.s.pDown)
    340                 ;
    341 
    342             /* And destroy them one at a time from the bottom up */
     336            /* Find the bottom driver. */
     337            /** @todo Add pBottom to PDMLUN, this might not be the only place we will have to work it from the bottom up. */
     338            PPDMDRVINS pDrvIns = pLun->pTop;
     339            while (pDrvIns && pDrvIns->Internal.s.pDown)
     340                pDrvIns = pDrvIns->Internal.s.pDown;
     341
     342            /* And destroy them one at a time from the bottom up. */
    343343            while (pDrvIns)
    344344            {
     
    352352                    TMR3TimerDestroyDriver(pVM, pDrvIns);
    353353                }
     354
    354355                pDrvIns = pDrvNext;
    355356            }
     
    600601    {
    601602        for (PPDMLUN pLun = pDevIns->Internal.s.pLunsHC; pLun; pLun = pLun->pNext)
     603            /** @todo Inverse the order here? */
    602604            for (PPDMDRVINS pDrvIns = pLun->pTop; pDrvIns; pDrvIns = pDrvIns->Internal.s.pDown)
    603605                if (pDrvIns->pDrvReg->pfnPowerOn)
     
    646648    {
    647649        for (PPDMLUN pLun = pDevIns->Internal.s.pLunsHC; pLun; pLun = pLun->pNext)
     650            /** @todo Inverse the order here? */
    648651            for (PPDMDRVINS pDrvIns = pLun->pTop; pDrvIns; pDrvIns = pDrvIns->Internal.s.pDown)
    649652                if (pDrvIns->pDrvReg->pfnReset)
     
    683686    {
    684687        for (PPDMLUN pLun = pDevIns->Internal.s.pLunsHC; pLun; pLun = pLun->pNext)
     688            /** @todo Inverse the order here? */
    685689            for (PPDMDRVINS pDrvIns = pLun->pTop; pDrvIns; pDrvIns = pDrvIns->Internal.s.pDown)
    686690                if (pDrvIns->pDrvReg->pfnSuspend)
     
    720724    {
    721725        for (PPDMLUN pLun = pDevIns->Internal.s.pLunsHC; pLun; pLun = pLun->pNext)
     726            /** @todo Inverse the order here? */
    722727            for (PPDMDRVINS pDrvIns = pLun->pTop; pDrvIns; pDrvIns = pDrvIns->Internal.s.pDown)
    723728                if (pDrvIns->pDrvReg->pfnResume)
     
    757762    {
    758763        for (PPDMLUN pLun = pDevIns->Internal.s.pLunsHC; pLun; pLun = pLun->pNext)
     764            /** @todo Inverse the order here? */
    759765            for (PPDMDRVINS pDrvIns = pLun->pTop; pDrvIns; pDrvIns = pDrvIns->Internal.s.pDown)
    760766                if (pDrvIns->pDrvReg->pfnPowerOff)
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