Changeset 49813 in vbox for trunk/src/VBox/Devices
- Timestamp:
- Dec 6, 2013 1:41:50 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevPCNet.cpp
r49809 r49813 55 55 #include <VBox/vmm/pdmnetifs.h> 56 56 #include <VBox/vmm/pgm.h> 57 #include <VBox/version.h> 57 58 #include <iprt/asm.h> 58 59 #include <iprt/assert.h> … … 403 404 bool fAm79C973; 404 405 /* Link speed to be reported through CSR68. */ 405 bool Alignment5;406 bool fSharedRegion; 406 407 /* Alignment padding. */ 407 408 uint32_t u32LinkSpeed; … … 3914 3915 3915 3916 3916 /**3917 * @callback_method_impl{FNPCIIOREGIONMAP, VBox specific MMIO2 interface.}3918 */3919 static DECLCALLBACK(int) pcnetMMIOSharedMap(PPCIDEVICE pPciDev, /*unsigned*/ int iRegion,3920 RTGCPHYS GCPhysAddress, uint32_t cb, PCIADDRESSSPACE enmType)3921 {3922 if (GCPhysAddress != NIL_RTGCPHYS)3923 return PDMDevHlpMMIO2Map(pPciDev->pDevIns, iRegion, GCPhysAddress);3924 3925 /* nothing to clean up */3926 return VINF_SUCCESS;3927 }3928 3929 3930 3917 /* -=-=-=-=-=- Debug Info Handler -=-=-=-=-=- */ 3931 3918 … … 4259 4246 4260 4247 /** 4261 * @callback_method_impl{FNSSMDEVLOADPREP ,4248 * @callback_method_impl{FNSSMDEVLOADPREP}, 4262 4249 * Serializes the receive thread, it may be working inside the critsect.} 4263 4250 */ … … 4268 4255 int rc = PDMCritSectEnter(&pThis->CritSect, VERR_SEM_BUSY); 4269 4256 AssertRC(rc); 4257 4258 uint32_t uVer = SSMR3HandleVersion(pSSM); 4259 if ( uVer < VBOX_FULL_VERSION_MAKE(4, 3, 6) 4260 || ( uVer >= VBOX_FULL_VERSION_MAKE(4, 3, 51) 4261 && uVer < VBOX_FULL_VERSION_MAKE(4, 3, 53))) 4262 { 4263 /* older saved states contain the shared memory region which was never used for ages. */ 4264 void *pvSharedMMIOR3; 4265 rc = PDMDevHlpMMIO2Register(pDevIns, 2, _512K, 0, (void **)&pvSharedMMIOR3, "PCNetSh"); 4266 if (RT_FAILURE(rc)) 4267 rc = PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS, 4268 N_("Failed to allocate the dummy shmem region for the PCNet device")); 4269 pThis->fSharedRegion = true; 4270 } 4270 4271 PDMCritSectLeave(&pThis->CritSect); 4271 4272 4272 return VINF_SUCCESS;4273 return rc; 4273 4274 } 4274 4275 … … 4377 4378 } 4378 4379 4380 /** 4381 * @callback_method_impl{FNSSMDEVLOADDONE} 4382 */ 4383 static DECLCALLBACK(int) pcnetLoadDone(PPDMDEVINS pDevIns, PSSMHANDLE pSSM) 4384 { 4385 PPCNETSTATE pThis = PDMINS_2_DATA(pDevIns, PPCNETSTATE); 4386 int rc = VINF_SUCCESS; 4387 if (pThis->fSharedRegion) 4388 { 4389 /* drop this dummy region */ 4390 rc = PDMDevHlpMMIO2Deregister(pDevIns, 2); 4391 pThis->fSharedRegion = false; 4392 } 4393 return rc; 4394 } 4379 4395 4380 4396 /* -=-=-=-=-=- PCNETSTATE::INetworkDown -=-=-=-=-=- */ … … 4956 4972 return rc; 4957 4973 4958 /** XXX remove! */4959 #define PCNET_GUEST_SHARED_MEMORY_SIZE _512K4960 void *pvSharedMMIOR3;4961 rc = PDMDevHlpMMIO2Register(pDevIns, 2, PCNET_GUEST_SHARED_MEMORY_SIZE, 0, (void **)&pvSharedMMIOR3, "PCNetSh");4962 if (RT_FAILURE(rc))4963 return PDMDevHlpVMSetError(pDevIns, rc, RT_SRC_POS,4964 N_("Failed to allocate %u bytes of memory for the PCNet device"),4965 PCNET_GUEST_SHARED_MEMORY_SIZE);4966 4967 4974 #ifdef PCNET_NO_POLLING 4968 4975 /* … … 5001 5008 NULL, pcnetLiveExec, NULL, 5002 5009 pcnetSavePrep, pcnetSaveExec, NULL, 5003 pcnetLoadPrep, pcnetLoadExec, NULL);5010 pcnetLoadPrep, pcnetLoadExec, pcnetLoadDone); 5004 5011 if (RT_FAILURE(rc)) 5005 5012 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.