VirtualBox

Changeset 91046 in vbox for trunk/src/VBox/Devices/Security


Ignore:
Timestamp:
Sep 1, 2021 7:52:43 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
146695
Message:

Devices/Makefile.kmk,Security: Some cleanups, bugref:10075

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Security/DrvTpmEmu.cpp

    r91032 r91046  
    4444*   Defined Constants And Macros                                                                                                 *
    4545*********************************************************************************************************************************/
    46 
    47 #define DRVTPMEMU_POLLSET_ID_SOCKET_CTRL 0
    48 #define DRVTPMEMU_POLLSET_ID_SOCKET_DATA 1
    49 #define DRVTPMEMU_POLLSET_ID_WAKEUP      2
    5046
    5147
     
    292288    RTSOCKET            hSockData;
    293289
    294 #if 0
    295     /** Poll set used to wait for I/O events. */
    296     RTPOLLSET           hPollSet;
    297     /** Reading end of the wakeup pipe. */
    298     RTPIPE              hPipeWakeR;
    299     /** Writing end of the wakeup pipe. */
    300     RTPIPE              hPipeWakeW;
    301 
    302     /** Flag to signal listening thread to shut down. */
    303     bool volatile       fShutdown;
    304     /** Flag to signal whether the thread was woken up from external. */
    305     bool volatile       fWokenUp;
    306 #endif
    307 
    308290    /** Currently set locality. */
    309291    uint8_t             bLoc;
     
    454436
    455437/**
    456  * Executes the given command over the control connection to the TPM emulator - variant with no command payload.
     438 * Executes the given command over the control connection to the TPM emulator - variant with no command and response payload.
    457439 *
    458440 * @returns VBox status code.
     
    460442 * @param   pThis               Pointer to the TPM emulator driver instance data.
    461443 * @param   enmCmd              The command to execute.
    462  * @param   pvResp              Where to store additional resposne data.
    463  * @param   cbResp              Size of the Response data in bytes (excluding the response status code which is implicit).
    464444 * @param   cMillies            Number of milliseconds to wait before aborting the command with a timeout error.
    465445 */
     
    811791    if (pThis->hSockCtrl != NIL_RTSOCKET)
    812792    {
    813 #if 0
    814         int rc = RTPollSetRemove(pThis->hPollSet, DRVTPMEMU_POLLSET_ID_SOCKET_CTRL);
    815         AssertRC(rc);
    816 #endif
    817 
    818793        int rc = RTSocketShutdown(pThis->hSockCtrl, true /* fRead */, true /* fWrite */);
    819794        AssertRC(rc);
     
    827802    if (pThis->hSockData != NIL_RTSOCKET)
    828803    {
    829 #if 0
    830         int rc = RTPollSetRemove(pThis->hPollSet, DRVTPMEMU_POLLSET_ID_SOCKET_DATA);
    831         AssertRC(rc);
    832 #endif
    833 
    834804        int rc = RTSocketShutdown(pThis->hSockData, true /* fRead */, true /* fWrite */);
    835805        AssertRC(rc);
     
    840810        pThis->hSockCtrl = NIL_RTSOCKET;
    841811    }
    842 
    843 #if 0
    844     if (pThis->hPipeWakeR != NIL_RTPIPE)
    845     {
    846         int rc = RTPipeClose(pThis->hPipeWakeR);
    847         AssertRC(rc);
    848 
    849         pThis->hPipeWakeR = NIL_RTPIPE;
    850     }
    851 
    852     if (pThis->hPipeWakeW != NIL_RTPIPE)
    853     {
    854         int rc = RTPipeClose(pThis->hPipeWakeW);
    855         AssertRC(rc);
    856 
    857         pThis->hPipeWakeW = NIL_RTPIPE;
    858     }
    859 
    860     if (pThis->hPollSet != NIL_RTPOLLSET)
    861     {
    862         int rc = RTPollSetDestroy(pThis->hPollSet);
    863         AssertRC(rc);
    864 
    865         pThis->hPollSet = NIL_RTPOLLSET;
    866     }
    867 #endif
    868812}
    869813
     
    884828    pThis->enmTpmVers                               = TPMVERSION_UNKNOWN;
    885829    pThis->bLoc                                     = TPM_NO_LOCALITY_SELECTED;
    886 
    887 #if 0
    888     pThis->hPollSet                                 = NIL_RTPOLLSET;
    889     pThis->hPipeWakeR                               = NIL_RTPIPE;
    890     pThis->hPipeWakeW                               = NIL_RTPIPE;
    891 #endif
    892830
    893831    /* IBase */
     
    916854                                   N_("Configuration error: querying \"Location\" resulted in %Rrc"), rc);
    917855
    918 #if 0
    919     rc = RTPipeCreate(&pThis->hPipeWakeR, &pThis->hPipeWakeW, 0 /* fFlags */);
    920     if (RT_FAILURE(rc))
    921         return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS,
    922                                    N_("DrvTpmEmu#%d: Failed to create wake pipe"), pDrvIns->iInstance);
    923 
    924     rc = RTPollSetCreate(&pThis->hPollSet);
    925     if (RT_FAILURE(rc))
    926         return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS,
    927                                    N_("DrvTpmEmu#%d: Failed to create poll set"), pDrvIns->iInstance);
    928 
    929     rc = RTPollSetAddPipe(pThis->hPollSet, pThis->hPipeWakeR,
    930                             RTPOLL_EVT_READ | RTPOLL_EVT_ERROR,
    931                             DRVTPMEMU_POLLSET_ID_WAKEUP);
    932     if (RT_FAILURE(rc))
    933         return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS,
    934                                    N_("DrvTpmEmu#%d failed to add wakeup pipe for %s to poll set"),
    935                                    pDrvIns->iInstance, szLocation);
    936 #endif
    937 
    938856    /*
    939857     * Create/Open the socket.
     
    959877                                   N_("DrvTpmEmu#%d failed to connect to control socket %s"),
    960878                                   pDrvIns->iInstance, szLocation);
    961 
    962 #if 0
    963     rc = RTPollSetAddSocket(pThis->hPollSet, pThis->hSockCtrl,
    964                             RTPOLL_EVT_READ | RTPOLL_EVT_WRITE | RTPOLL_EVT_ERROR,
    965                             DRVTPMEMU_POLLSET_ID_SOCKET_CTRL);
    966     if (RT_FAILURE(rc))
    967         return PDMDrvHlpVMSetError(pDrvIns, rc, RT_SRC_POS,
    968                                    N_("DrvTpmEmu#%d failed to add socket for %s to poll set"),
    969                                    pDrvIns->iInstance, szLocation);
    970 #endif
    971879
    972880    rc = drvTpmEmuQueryCaps(pThis);
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