Changeset 21062 in vbox
- Timestamp:
- Jun 30, 2009 10:14:10 AM (15 years ago)
- Location:
- trunk/src/VBox/Devices/VMMDev
- Files:
-
- 3 edited
-
VBoxDev.cpp (modified) (6 diffs)
-
VMMDevHGCM.cpp (modified) (9 diffs)
-
VMMDevState.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/VMMDev/VBoxDev.cpp
r20991 r21062 400 400 * Port I/O Handler for the generic request interface 401 401 * @see FNIOMIOPORTOUT for details. 402 * 403 * @todo Too long, suggest doing the request copying here and moving the 404 * switch into a different function (or better case -> functions), and 405 * looing the gotos. 402 406 */ 403 407 static DECLCALLBACK(int) vmmdevRequestHandler(PPDMDEVINS pDevIns, void *pvUser, RTIOPORT Port, uint32_t u32, unsigned cb) … … 405 409 VMMDevState *pThis = (VMMDevState*)pvUser; 406 410 int rcRet = VINF_SUCCESS; 411 PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY); 407 412 408 413 /* … … 420 425 Log(("VMMDev request header size too small! size = %d\n", requestHeader.size)); 421 426 rcRet = VINF_SUCCESS; 422 goto end; 427 goto end; /** @todo shouldn't (/ no need to) write back.*/ 423 428 } 424 429 … … 428 433 Log(("VMMDev: guest header version (0x%08X) differs from ours (0x%08X)\n", requestHeader.version, VMMDEV_REQUEST_HEADER_VERSION)); 429 434 rcRet = VINF_SUCCESS; 430 goto end; 435 goto end; /** @todo shouldn't (/ no need to) write back.*/ 431 436 } 432 437 … … 1596 1601 PDMDevHlpPhysWrite(pDevIns, (RTGCPHYS)u32, &requestHeader, sizeof(requestHeader)); 1597 1602 } 1603 1604 PDMCritSectLeave(&pThis->CritSect); 1598 1605 return rcRet; 1599 1606 } … … 2276 2283 /** @todo convert this into a config parameter like we do everywhere else! */ 2277 2284 pThis->cbGuestRAM = MMR3PhysGetRamSize(PDMDevHlpGetVM(pDevIns)); 2285 2286 /* 2287 * Create the critical section for the device. 2288 */ 2289 rc = PDMDevHlpCritSectInit(pDevIns, &pThis->CritSect, "VMMDev"); 2290 AssertRCReturn(rc, rc); 2291 /* Later: pDevIns->pCritSectR3 = &pThis->CritSect; */ 2278 2292 2279 2293 /* -
trunk/src/VBox/Devices/VMMDev/VMMDevHGCM.cpp
r20731 r21062 391 391 } 392 392 393 VMMDevHGCMConnect *pHGCMConnectCopy = (VMMDevHGCMConnect *)(pSavedCmd+1); 393 VMMDevHGCMConnect *pHGCMConnectCopy = (VMMDevHGCMConnect *)(pSavedCmd+1); 394 394 395 395 memcpy(pHGCMConnectCopy, pHGCMConnect, pHGCMConnect->header.header.size); … … 1019 1019 1020 1020 AssertRCBreak(rc); 1021 1021 1022 1022 offPage = 0; /* A next page is read from 0 offset. */ 1023 1023 cbRemaining -= cbChunk; … … 1159 1159 1160 1160 AssertRCBreak(rc); 1161 1161 1162 1162 offPage = 0; /* A next page is read from 0 offset. */ 1163 1163 cbRemaining -= cbChunk; … … 1324 1324 } 1325 1325 1326 /* 1327 * Enter and leave the critical section here so we make sure 1328 * vmmdevRequestHandler has completed before we read & write 1329 * the request. (This isn't 100% optimal, but it solves the 1330 * 3.0 blocker.) 1331 */ 1332 /** @todo s/pVMMDevState/pThis/g */ 1333 /** @todo It would be faster if this interface would use MMIO2 memory and we 1334 * didn't have to mess around with PDMDevHlpPhysRead/Write. We're 1335 * reading the header 3 times now and writing the request back twice. */ 1336 PDMCritSectEnter(&pVMMDevState->CritSect, VERR_SEM_BUSY); 1337 PDMCritSectLeave(&pVMMDevState->CritSect); 1338 1326 1339 PDMDevHlpPhysRead(pVMMDevState->pDevIns, pCmd->GCPhys, pHeader, pCmd->cbSize); 1327 1340 … … 1441 1454 uint32_t size = pGuestParm->u.Pointer.size; 1442 1455 1443 if (size > 0) 1456 if (size > 0) 1444 1457 { 1445 1458 if (pGuestParm->type != VMMDevHGCMParmType_LinAddr_In) … … 1504 1517 uint32_t size = pGuestParm->u.Pointer.size; 1505 1518 1506 if (size > 0) 1519 if (size > 0) 1507 1520 { 1508 1521 if (pGuestParm->type != VMMDevHGCMParmType_LinAddr_In) … … 1583 1596 VMMDevState *pVMMDevState = PDMIHGCMPORT_2_VMMDEVSTATE(pInterface); 1584 1597 1598 /** @todo no longer necessary to forward to EMT, but it might be more 1599 * efficient...? */ 1585 1600 /* Not safe to execute asynchroneously; forward to EMT */ 1586 1601 int rc = VMR3ReqCallEx(PDMDevHlpGetVM(pVMMDevState->pDevIns), VMCPUID_ANY, NULL, 0, VMREQFLAGS_NO_WAIT | VMREQFLAGS_VOID, … … 1857 1872 rc = SSMR3GetU32(pSSM, &u32); 1858 1873 AssertRCReturn(rc, rc); 1859 1874 1860 1875 vmmdevHGCMAddCommand (pVMMDevState, pCmd, GCPhys, cbSize, VBOXHGCMCMDTYPE_LOADSTATE); 1861 1876 } … … 2138 2153 2139 2154 RTMemFree(pIter); 2140 2155 2141 2156 VMMDevNotifyGuest (pVMMDevState, VMMDEV_EVENT_HGCM); 2142 2157 } -
trunk/src/VBox/Devices/VMMDev/VMMDevState.h
r12687 r21062 91 91 RTGCPHYS32 GCPhysVMMDevRAM; 92 92 93 /** R3 pointer to VMMDev Heap RAM area 93 /** R3 pointer to VMMDev Heap RAM area 94 94 */ 95 95 R3PTRTYPE(VMMDevMemory *) pVMMDevHeapR3; … … 191 191 } SharedFolders; 192 192 193 /** The critical section for this device. */ 194 PDMCRITSECT CritSect; 193 195 } VMMDevState; 194 196
Note:
See TracChangeset
for help on using the changeset viewer.

