VirtualBox

Changeset 68699 in vbox for trunk/include/VBox/vmm


Ignore:
Timestamp:
Sep 7, 2017 3:12:54 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
117930
Message:

pdmifs.h,Serial: Reworked stream interface. The old design with the two read/write threads had a race where the read thread could access already destroyed VMM structures during destruction if data was read. This was solved by adding a poll callback which waits for data to arrive and which can be interrupt to make the thread respond to VM state changes and suspend before destruction starts. This required reworking all the drivers using it. DrvTCP was reworked to make use of the RTTcp*, RTSocket* and RTPoll* API in that process to get rid of platform dependent code there (which wasn't all available when the driver was createt).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/vmm/pdmifs.h

    r65120 r68699  
    12441244{
    12451245    /**
     1246     * Polls for the specified events.
     1247     *
     1248     * @returns VBox status code.
     1249     * @retval  VERR_INTERRUPTED if the poll was interrupted.
     1250     * @retval  VERR_TIMEOUT     if the maximum waiting time was reached.
     1251     * @param   pInterface      Pointer to the interface structure containing the called function pointer.
     1252     * @param   fEvts           The events to poll for, see RTPOLL_EVT_XXX.
     1253     * @param   *pfEvts         Where to return details about the events that occurred.
     1254     * @param   cMillies        Number of milliseconds to wait.  Use
     1255     *                          RT_INDEFINITE_WAIT to wait for ever.
     1256     */
     1257    DECLR3CALLBACKMEMBER(int, pfnPoll,(PPDMISTREAM pInterface, uint32_t fEvts, uint32_t *pfEvts, RTMSINTERVAL cMillies));
     1258
     1259    /**
     1260     * Interrupts the current poll call.
     1261     *
     1262     * @returns VBox status code.
     1263     * @param   pInterface      Pointer to the interface structure containing the called function pointer.
     1264     */
     1265    DECLR3CALLBACKMEMBER(int, pfnPollInterrupt,(PPDMISTREAM pInterface));
     1266
     1267    /**
    12461268     * Read bits.
    12471269     *
     
    12511273     * @param   pcbRead         Number of bytes to read/bytes actually read.
    12521274     * @thread  Any thread.
     1275     *
     1276     * @note: This is non blocking, use the poll callback to block when there is nothing to read.
    12531277     */
    12541278    DECLR3CALLBACKMEMBER(int, pfnRead,(PPDMISTREAM pInterface, void *pvBuf, size_t *pcbRead));
     
    12621286     * @param   pcbWrite        Number of bytes to write/bytes actually written.
    12631287     * @thread  Any thread.
     1288     *
     1289     * @note: This is non blocking, use the poll callback to block until there is room to write.
    12641290     */
    12651291    DECLR3CALLBACKMEMBER(int, pfnWrite,(PPDMISTREAM pInterface, const void *pvBuf, size_t *pcbWrite));
    12661292} PDMISTREAM;
    12671293/** PDMISTREAM interface ID. */
    1268 #define PDMISTREAM_IID                          "d1a5bf5e-3d2c-449a-bde9-addd7920b71f"
     1294#define PDMISTREAM_IID                          "f9bd1ba6-c134-44cc-8259-febe14393952"
    12691295
    12701296
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