Changeset 1627 in vbox
- Timestamp:
- Mar 22, 2007 4:24:20 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevPCNet.cpp
r1622 r1627 214 214 /** If set the link is temporarily down because of a saved state load. */ 215 215 bool fLinkTempDown; 216 /** This flag is set on SavePrep to prevent altering of memory after pgmR3Save() was called */ 217 bool fSaving; 216 218 217 219 /** Number of times we've reported the link down. */ … … 1990 1992 pcnetXmitFlushFrames(pData); 1991 1993 #else 1992 1993 #if 1 1994 # if 1 1994 1995 PPDMQUEUEITEMCORE pItem = PDMQueueAlloc(CTXSUFF(pData->pXmitQueue)); 1995 1996 if (RT_UNLIKELY(pItem)) 1996 1997 PDMQueueInsert(CTXSUFF(pData->pXmitQueue), pItem); 1997 # else1998 # else 1998 1999 if (ASMAtomicIncU32(&pData->cPendingSends) < 16) 1999 2000 { … … 2004 2005 else 2005 2006 PDMQueueFlush(CTXSUFF(pData->pXmitQueue)); 2006 # endif2007 # endif 2007 2008 #endif 2008 2009 } … … 2270 2271 AssertReleaseRC(rc); 2271 2272 2272 rc = pcnetAsyncTransmit(pData); 2273 if (!pData->fSaving) 2274 rc = pcnetAsyncTransmit(pData); 2275 2273 2276 PDMCritSectLeave(&pData->CritSect); 2274 2277 } … … 3658 3661 3659 3662 /** 3663 * Prepares for state saving. 3664 * We must stop the RX process to prevent altering of the main memory after saving. 3665 * 3666 * @returns VBox status code. 3667 * @param pDevIns The device instance. 3668 * @param pSSMHandle The handle to save the state to. 3669 */ 3670 static DECLCALLBACK(int) pcnetSavePrep(PPDMDEVINS pDevIns, PSSMHANDLE pSSMHandle) 3671 { 3672 PCNetState *pData = PDMINS2DATA(pDevIns, PCNetState *); 3673 3674 PDMCritSectEnter(&pData->CritSect, VERR_PERMISSION_DENIED); 3675 3676 pData->fSaving = true; 3677 /* From now on drop all received packets to prevent altering of main memory after 3678 * pgmR3Save() was called but before the RX thread is terminated */ 3679 3680 PDMCritSectLeave(&pData->CritSect); 3681 return VINF_SUCCESS; 3682 } 3683 3684 3685 /** 3660 3686 * Saves a state of the PC-Net II device. 3661 3687 * … … 3827 3853 AssertReleaseRC(rc); 3828 3854 3829 if (cb > 70) /* unqualified guess */ 3830 pData->Led.Asserted.s.fReading = pData->Led.Actual.s.fReading = 1; 3831 pcnetReceiveNoSync(pData, (const uint8_t*)pvBuf, cb); 3832 pData->Led.Actual.s.fReading = 0; 3855 if (!pData->fSaving) 3856 { 3857 if (cb > 70) /* unqualified guess */ 3858 pData->Led.Asserted.s.fReading = pData->Led.Actual.s.fReading = 1; 3859 pcnetReceiveNoSync(pData, (const uint8_t*)pvBuf, cb); 3860 pData->Led.Actual.s.fReading = 0; 3861 } 3862 /* otherwise junk the data to Nirwana. */ 3833 3863 3834 3864 PDMCritSectLeave(&pData->CritSect); … … 4178 4208 rc = PDMDevHlpSSMRegister(pDevIns, pDevIns->pDevReg->szDeviceName, iInstance, 4179 4209 PCNET_SAVEDSTATE_VERSION, sizeof(*pData), 4180 NULL, pcnetSaveExec, NULL,4210 pcnetSavePrep, pcnetSaveExec, NULL, 4181 4211 NULL, pcnetLoadExec, NULL); 4182 4212 if (VBOX_FAILURE(rc))
Note:
See TracChangeset
for help on using the changeset viewer.