Changeset 91046 in vbox for trunk/src/VBox/Devices/Security
- Timestamp:
- Sep 1, 2021 7:52:43 AM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 146695
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Security/DrvTpmEmu.cpp
r91032 r91046 44 44 * Defined Constants And Macros * 45 45 *********************************************************************************************************************************/ 46 47 #define DRVTPMEMU_POLLSET_ID_SOCKET_CTRL 048 #define DRVTPMEMU_POLLSET_ID_SOCKET_DATA 149 #define DRVTPMEMU_POLLSET_ID_WAKEUP 250 46 51 47 … … 292 288 RTSOCKET hSockData; 293 289 294 #if 0295 /** 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 #endif307 308 290 /** Currently set locality. */ 309 291 uint8_t bLoc; … … 454 436 455 437 /** 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. 457 439 * 458 440 * @returns VBox status code. … … 460 442 * @param pThis Pointer to the TPM emulator driver instance data. 461 443 * @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).464 444 * @param cMillies Number of milliseconds to wait before aborting the command with a timeout error. 465 445 */ … … 811 791 if (pThis->hSockCtrl != NIL_RTSOCKET) 812 792 { 813 #if 0814 int rc = RTPollSetRemove(pThis->hPollSet, DRVTPMEMU_POLLSET_ID_SOCKET_CTRL);815 AssertRC(rc);816 #endif817 818 793 int rc = RTSocketShutdown(pThis->hSockCtrl, true /* fRead */, true /* fWrite */); 819 794 AssertRC(rc); … … 827 802 if (pThis->hSockData != NIL_RTSOCKET) 828 803 { 829 #if 0830 int rc = RTPollSetRemove(pThis->hPollSet, DRVTPMEMU_POLLSET_ID_SOCKET_DATA);831 AssertRC(rc);832 #endif833 834 804 int rc = RTSocketShutdown(pThis->hSockData, true /* fRead */, true /* fWrite */); 835 805 AssertRC(rc); … … 840 810 pThis->hSockCtrl = NIL_RTSOCKET; 841 811 } 842 843 #if 0844 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 #endif868 812 } 869 813 … … 884 828 pThis->enmTpmVers = TPMVERSION_UNKNOWN; 885 829 pThis->bLoc = TPM_NO_LOCALITY_SELECTED; 886 887 #if 0888 pThis->hPollSet = NIL_RTPOLLSET;889 pThis->hPipeWakeR = NIL_RTPIPE;890 pThis->hPipeWakeW = NIL_RTPIPE;891 #endif892 830 893 831 /* IBase */ … … 916 854 N_("Configuration error: querying \"Location\" resulted in %Rrc"), rc); 917 855 918 #if 0919 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 #endif937 938 856 /* 939 857 * Create/Open the socket. … … 959 877 N_("DrvTpmEmu#%d failed to connect to control socket %s"), 960 878 pDrvIns->iInstance, szLocation); 961 962 #if 0963 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 #endif971 879 972 880 rc = drvTpmEmuQueryCaps(pThis);
Note:
See TracChangeset
for help on using the changeset viewer.