VirtualBox

Changeset 37466 in vbox for trunk/src/VBox/Devices/Serial


Ignore:
Timestamp:
Jun 15, 2011 12:44:16 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
72280
Message:

VMM,Devices: Automatically use a per-device lock instead of the giant IOM lock. With exception of the PIC, APIC, IOAPIC and PCI buses which are all using the PDM crit sect, there should be no calls between devices. So, this change should be relatively safe.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Serial/DevSerial.cpp

    r37324 r37466  
    11901190
    11911191    /*
    1192      * We have a critical section make TM and IOM take it for callbacks.
    1193      */
    1194     pDevIns->pCritSectR3 = &pThis->CritSect;
    1195 
    1196     /*
    11971192     * Validate and read the configuration.
    11981193     */
     
    12701265
    12711266    /*
    1272      * Initialize critical section and the semaphore.
    1273      * This must of be done before attaching drivers or doing anything else
    1274      * which can call us back.
     1267     * Initialize critical section and the semaphore.  Change the default
     1268     * critical section to ours so that TM and IOM will enter it before
     1269     * calling us.
     1270     *
     1271     * Note! This must of be done BEFORE creating timers, registering I/O ports
     1272     *       and other things which might pick up the default CS or end up
     1273     *       calling back into the device.
    12751274     */
    1276     rc = PDMDevHlpCritSectInit(pDevIns, &pThis->CritSect, RT_SRC_POS, "Serial#%d", iInstance);
    1277     if (RT_FAILURE(rc))
    1278         return rc;
     1275    rc = PDMDevHlpCritSectInit(pDevIns, &pThis->CritSect, RT_SRC_POS, "Serial#%u", iInstance);
     1276    AssertRCReturn(rc, rc);
     1277
     1278    rc = PDMDevHlpSetDeviceCritSect(pDevIns, &pThis->CritSect);
     1279    AssertRCReturn(rc, rc);
    12791280
    12801281    rc = RTSemEventCreate(&pThis->ReceiveSem);
    12811282    AssertRCReturn(rc, rc);
    12821283
     1284    /*
     1285     * Create the timers.
     1286     */
    12831287    rc = PDMDevHlpTMTimerCreate(pDevIns, TMCLOCK_VIRTUAL, serialFifoTimer, pThis,
    12841288                                TMTIMER_FLAGS_DEFAULT_CRIT_SECT, "Serial Fifo Timer",
Note: See TracChangeset for help on using the changeset viewer.

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