VirtualBox

Changeset 19112 in vbox for trunk/src/VBox/Devices


Ignore:
Timestamp:
Apr 22, 2009 2:32:45 PM (16 years ago)
Author:
vboxsync
Message:

PCNet: removed dead code (will not work with the current memory model anyway)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/DevPCNet.cpp

    r19104 r19112  
    19061906            size_t count = RT_MIN(4096 - (size_t)rmd.rmd1.bcnt, size);
    19071907            RTGCPHYS32 rbadr = PHYSADDR(pThis, rmd.rmd0.rbadr);
    1908 #if 0
    1909             if (pThis->fPrivIfEnabled)
    1910             {
    1911                 uint8_t *pb = (uint8_t*)pThis->CTX_SUFF(pSharedMMIO)
    1912                             + rbadr - pThis->GCRDRA + pThis->CTX_SUFF(pSharedMMIO)->V.V1.offRxDescriptors;
    1913                 memcpy(pb, src, count);
    1914             }
    1915             else
    1916 #endif
    1917             {
    1918                 /* We have to leave the critical section here or we risk deadlocking
    1919                  * with EMT when the write is to an unallocated page or has an access
    1920                  * handler associated with it.
    1921                  *
    1922                  * This shouldn't be a problem because:
    1923                  *  - any modification to the RX descriptor by the driver is
    1924                  *    forbidden as long as it is owned by the device
    1925                  *  - we don't cache any register state beyond this point
    1926                  */
    1927                 PDMCritSectLeave(&pThis->CritSect);
    1928                 PDMDevHlpPhysWrite(pDevIns, rbadr, src, count);
    1929                 int rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
    1930                 AssertReleaseRC(rc);
    1931             }
     1908
     1909            /* We have to leave the critical section here or we risk deadlocking
     1910             * with EMT when the write is to an unallocated page or has an access
     1911             * handler associated with it.
     1912             *
     1913             * This shouldn't be a problem because:
     1914             *  - any modification to the RX descriptor by the driver is
     1915             *    forbidden as long as it is owned by the device
     1916             *  - we don't cache any register state beyond this point
     1917             */
     1918            PDMCritSectLeave(&pThis->CritSect);
     1919            PDMDevHlpPhysWrite(pDevIns, rbadr, src, count);
     1920            int rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
     1921            AssertReleaseRC(rc);
    19321922
    19331923            src  += count;
     
    19601950                count = RT_MIN(4096 - (size_t)rmd.rmd1.bcnt, size);
    19611951                RTGCPHYS32 rbadr = PHYSADDR(pThis, rmd.rmd0.rbadr);
    1962 #if 0
    1963                 if (pThis->fPrivIfEnabled)
    1964                 {
    1965                     uint8_t *pb = (uint8_t*)pThis->CTX_SUFF(pSharedMMIO)
    1966                                 + rbadr - pThis->GCRDRA + pThis->CTX_SUFF(pSharedMMIO)->V.V1.offRxDescriptors;
    1967                     memcpy(pb, src, count);
    1968                 }
    1969                 else
    1970 #endif
    1971                 {
    1972                     /* We have to leave the critical section here or we risk deadlocking
    1973                      * with EMT when the write is to an unallocated page or has an access
    1974                      * handler associated with it. See above for additional comments. */
    1975                     PDMCritSectLeave(&pThis->CritSect);
    1976                     PDMDevHlpPhysWrite(pDevIns, rbadr, src, count);
    1977                     int rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
    1978                     AssertReleaseRC(rc);
    1979                 }
     1952
     1953                /* We have to leave the critical section here or we risk deadlocking
     1954                 * with EMT when the write is to an unallocated page or has an access
     1955                 * handler associated with it. See above for additional comments. */
     1956                PDMCritSectLeave(&pThis->CritSect);
     1957                PDMDevHlpPhysWrite(pDevIns, rbadr, src, count);
     1958                int rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY);
     1959                AssertReleaseRC(rc);
     1960
    19801961                src  += count;
    19811962                size -= count;
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