Changeset 82137 in vbox
- Timestamp:
- Nov 23, 2019 11:38:01 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 134947
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevPCNet.cpp
r82136 r82137 314 314 /** Pointer to the device instance - R3. */ 315 315 PPDMDEVINSR3 pDevInsR3; 316 /** Transmit signaller - R3. */317 R3PTRTYPE(PPDMQUEUE) pXmitQueueR3;318 316 /** Pointer to the connector of the attached network driver - R3. */ 319 317 PPDMINETWORKUPR3 pDrvR3; … … 329 327 /** Pointer to the device instance - R0. */ 330 328 PPDMDEVINSR0 pDevInsR0; 331 /** Transmit signaller - R0. */332 R0PTRTYPE(PPDMQUEUE) pXmitQueueR0;333 329 /** Pointer to the connector of the attached network driver - R0. */ 334 330 PPDMINETWORKUPR0 pDrvR0; … … 336 332 /** Pointer to the device instance - RC. */ 337 333 PPDMDEVINSRC pDevInsRC; 338 /** Transmit signaller - RC. */339 RCPTRTYPE(PPDMQUEUE) pXmitQueueRC;340 334 /** Pointer to the connector of the attached network driver - RC. */ 341 335 PPDMINETWORKUPRC pDrvRC; 342 RTRCPTR RCPtrAlignment;343 336 344 337 /** Software Interrupt timer - R3. */ … … 351 344 * This is used to disconnect and reconnect the link after a restore. */ 352 345 TMTIMERHANDLE hTimerRestore; 346 347 /** Transmit signaller. */ 348 PDMTASKHANDLE hXmitTask; 353 349 354 350 /** Register Address Pointer */ … … 1644 1640 /** 1645 1641 * Poll Receive Descriptor Table Entry and cache the results in the appropriate registers. 1646 * Note: Once a descriptor belongs to the network card (this driver), it cannot be changed 1647 * by the host (the guest driver) anymore. Well, it could but the results are undefined by 1648 * definition. 1649 * @param fSkipCurrent if true, don't scan the current RDTE. 1642 * 1643 * @note Once a descriptor belongs to the network card (this driver), it 1644 * cannot be changed by the host (the guest driver) anymore. Well, it 1645 * could but the results are undefined by definition. 1646 * 1647 * @param pDevIns The device instance. 1648 * @param fSkipCurrent if true, don't scan the current RDTE. 1650 1649 */ 1651 1650 static void pcnetRdtePoll(PPCNETSTATE pThis, bool fSkipCurrent=false) … … 2097 2096 #ifdef IN_RING3 2098 2097 /** 2099 * Transmit queue consumer 2100 * This is just a very simple way of delaying sending to R3. 2101 * 2102 * @returns Success indicator. 2103 * If false the item will not be removed and the flushing will stop. 2104 * @param pDevIns The device instance. 2105 * @param pItem The item to consume. Upon return this item will be freed. 2106 */ 2107 static DECLCALLBACK(bool) pcnetXmitQueueConsumer(PPDMDEVINS pDevIns, PPDMQUEUEITEMCORE pItem) 2098 * @callback_method_impl{FNPDMTASKDEV, 2099 * This is just a very simple way of delaying sending to R3.} 2100 */ 2101 static DECLCALLBACK(void) pcnetR3XmitTaskCallback(PPDMDEVINS pDevIns, void *pvUser) 2108 2102 { 2109 2103 PPCNETSTATE pThis = PDMDEVINS_2_DATA(pDevIns, PPCNETSTATE); 2110 NOREF(p Item);2104 NOREF(pvUser); 2111 2105 2112 2106 /* … … 2114 2108 */ 2115 2109 pcnetXmitPending(pThis, true /*fOnWorkerThread*/); 2116 2117 return true;2118 2110 } 2119 2111 #endif /* IN_RING3 */ … … 2416 2408 if (!pThis->CTX_SUFF(pDrv)) 2417 2409 { 2418 PPDMQUEUEITEMCORE pItem = PDMQueueAlloc(pThis->CTX_SUFF(pXmitQueue)); 2419 if (RT_UNLIKELY(pItem)) 2420 PDMQueueInsert(pThis->CTX_SUFF(pXmitQueue), pItem); 2410 int rc = PDMDevHlpTaskTrigger(pThis->CTX_SUFF(pDevIns), pThis->hXmitTask); 2411 AssertRC(rc); 2421 2412 } 2422 2413 else … … 5042 5033 PPCNETSTATE pThis = PDMDEVINS_2_DATA(pDevIns, PPCNETSTATE); 5043 5034 pThis->pDevInsRC = PDMDEVINS_2_RCPTR(pDevIns); 5044 pThis->pXmitQueueRC = PDMQueueRCPtr(pThis->pXmitQueueR3);5045 5035 #ifdef PCNET_NO_POLLING 5046 5036 pThis->pfnEMInterpretInstructionRC += offDelta; … … 5334 5324 * Create the transmit queue. 5335 5325 */ 5336 rc = PDMDevHlpQueueCreate(pDevIns, sizeof(PDMQUEUEITEMCORE), 1, 0, 5337 pcnetXmitQueueConsumer, true, "PCnet-Xmit", &pThis->pXmitQueueR3); 5326 rc = PDMDevHlpTaskCreate(pDevIns, PDMTASK_F_RZ, "PCnet-Xmit", pcnetR3XmitTaskCallback, NULL /*pvUser*/, &pThis->hXmitTask); 5338 5327 AssertRCReturn(rc, rc); 5339 pThis->pXmitQueueR0 = PDMQueueR0Ptr(pThis->pXmitQueueR3);5340 pThis->pXmitQueueRC = PDMQueueRCPtr(pThis->pXmitQueueR3);5341 5328 5342 5329 /*
Note:
See TracChangeset
for help on using the changeset viewer.