Changeset 360 in vbox for trunk/src/VBox/Devices/Network
- Timestamp:
- Jan 26, 2007 3:10:55 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Network/DevPCNet.cpp
r349 r360 219 219 220 220 #ifdef PCNET_NO_POLLING 221 RTGCPHYS T RDAPhysOld;222 uint32_t cbT RDAOld;221 RTGCPHYS TDRAPhysOld; 222 uint32_t cbTDRAOld; 223 223 224 224 RTGCPHYS RDRAPhysOld; … … 984 984 if (VBOX_SUCCESS(rc) && cb) 985 985 { 986 if (GCPhysFault >= pData->GCTDRA && GCPhysFault + cb < pcnetTdraAddr(pData, 0)) 986 if ( (GCPhysFault >= pData->GCTDRA && GCPhysFault + cb < pcnetTdraAddr(pData, 0)) 987 || (GCPhysFault >= pData->GCRDRA && GCPhysFault + cb < pcnetRdraAddr(pData, 0))) 987 988 { 988 989 int rc = PDMCritSectEnter(&pData->CritSect, VERR_SEM_BUSY); … … 1194 1195 { 1195 1196 PPDMDEVINS pDevIns = PCNETSTATE_2_DEVINS(pData); 1196 1197 Log(("pcnetUpdateRingHandlers TD %VGp size %x -> %VGp size %x\n", pData->TRDAPhysOld, pData->cbTRDAOld, pData->GCTDRA, pcnetTdraAddr(pData, 0))); 1197 int rc; 1198 1199 Log(("pcnetUpdateRingHandlers TD %VGp size %x -> %VGp size %x\n", pData->TDRAPhysOld, pData->cbTDRAOld, pData->GCTDRA, pcnetTdraAddr(pData, 0))); 1198 1200 Log(("pcnetUpdateRingHandlers RX %VGp size %x -> %VGp size %x\n", pData->RDRAPhysOld, pData->cbRDRAOld, pData->GCRDRA, pcnetRdraAddr(pData, 0))); 1199 1201 1200 #if 0 1201 if (pData->RDRAPhysOld != 0 && pData->GCRDRA != pData->RDRAPhysOld) 1202 PGMHandlerPhysicalDeregister(PDMDevHlpGetVM(pDevIns), 1203 pData->RDRAPhysOld & ~PAGE_OFFSET_MASK); 1204 if ( pData->TRDAPhysOld != 0 && pData->GCTDRA != pData->TRDAPhysOld 1205 && (pData->GCRDRA & ~PAGE_OFFSET_MASK) != (pData->GCTDRA & ~PAGE_OFFSET_MASK)) 1206 #endif 1207 #if 0 1208 if (pData->GCRDRA != oldrdra) 1209 { 1210 int rc; 1202 if (pData->GCRDRA != pData->RDRAPhysOld || CSR_RCVRL(pData) != pData->cbRDRAOld) 1203 { 1204 if (pData->RDRAPhysOld != 0) 1205 PGMHandlerPhysicalDeregister(PDMDevHlpGetVM(pDevIns), 1206 pData->RDRAPhysOld & ~PAGE_OFFSET_MASK); 1207 1211 1208 rc = PGMR3HandlerPhysicalRegister(PDMDevHlpGetVM(pDevIns), 1212 1209 PGMPHYSHANDLERTYPE_PHYSICAL_WRITE, … … 1224 1221 pData->cbRDRAOld = pcnetRdraAddr(pData, 0); 1225 1222 } 1226 #endif 1227 if (pData->GCTDRA != pData->TRDAPhysOld || CSR_XMTRL(pData) != pData->cbTRDAOld) 1228 { 1229 if (pData->TRDAPhysOld != 0) 1230 PGMHandlerPhysicalDeregister(PDMDevHlpGetVM(pDevIns), 1231 pData->TRDAPhysOld & ~PAGE_OFFSET_MASK); 1232 1233 int rc; 1234 1235 rc = PGMR3HandlerPhysicalRegister(PDMDevHlpGetVM(pDevIns), 1236 PGMPHYSHANDLERTYPE_PHYSICAL_WRITE, 1237 pData->GCTDRA & ~PAGE_OFFSET_MASK, 1238 RT_ALIGN(pcnetTdraAddr(pData, 0), PAGE_SIZE) - 1, 1239 pcnetHandleRingWrite, pDevIns, 1240 g_DevicePCNet.szR0Mod, "pcnetHandleRingWrite", 1241 pData->pDevInsHC->pvInstanceDataHC, 1242 g_DevicePCNet.szGCMod, "pcnetHandleRingWrite", 1243 pData->pDevInsHC->pvInstanceDataGC, 1244 "PCNet transmit ring write access handler"); 1245 AssertRC(rc); 1246 1247 pData->TRDAPhysOld = pData->GCTDRA; 1248 pData->cbTRDAOld = pcnetTdraAddr(pData, 0); 1249 } 1223 1224 /* 3 possibilities: 1225 * 1) TDRA on different physical page as RDRA 1226 * 2) TDRA completely on same physical page as RDRA 1227 * 3) TDRA & RDRA overlap partly with different physical pages 1228 */ 1229 RTGCPHYS RDRAPageStart = pData->GCRDRA & ~PAGE_OFFSET_MASK; 1230 RTGCPHYS RDRAPageEnd = (pcnetRdraAddr(pData, 0) - 1) & ~PAGE_OFFSET_MASK; 1231 RTGCPHYS TDRAPageStart = pData->GCTDRA & ~PAGE_OFFSET_MASK; 1232 RTGCPHYS TDRAPageEnd = (pcnetTdraAddr(pData, 0) - 1) & ~PAGE_OFFSET_MASK; 1233 1234 if ( RDRAPageStart > TDRAPageEnd 1235 || TDRAPageStart > RDRAPageEnd) 1236 { 1237 /* 1) */ 1238 if (pData->GCTDRA != pData->TDRAPhysOld || CSR_XMTRL(pData) != pData->cbTDRAOld) 1239 { 1240 if (pData->TDRAPhysOld != 0) 1241 PGMHandlerPhysicalDeregister(PDMDevHlpGetVM(pDevIns), 1242 pData->TDRAPhysOld & ~PAGE_OFFSET_MASK); 1243 1244 rc = PGMR3HandlerPhysicalRegister(PDMDevHlpGetVM(pDevIns), 1245 PGMPHYSHANDLERTYPE_PHYSICAL_WRITE, 1246 pData->GCTDRA & ~PAGE_OFFSET_MASK, 1247 RT_ALIGN(pcnetTdraAddr(pData, 0), PAGE_SIZE) - 1, 1248 pcnetHandleRingWrite, pDevIns, 1249 g_DevicePCNet.szR0Mod, "pcnetHandleRingWrite", 1250 pData->pDevInsHC->pvInstanceDataHC, 1251 g_DevicePCNet.szGCMod, "pcnetHandleRingWrite", 1252 pData->pDevInsHC->pvInstanceDataGC, 1253 "PCNet transmit ring write access handler"); 1254 AssertRC(rc); 1255 1256 pData->TDRAPhysOld = pData->GCTDRA; 1257 pData->cbTDRAOld = pcnetTdraAddr(pData, 0); 1258 } 1259 } 1260 else 1261 if ( RDRAPageStart != TDRAPageStart 1262 && ( TDRAPageStart == RDRAPageEnd 1263 || TDRAPageEnd == RDRAPageStart 1264 ) 1265 ) 1266 { 1267 /* 3) */ 1268 AssertFailed(); 1269 } 1270 /* else 2) */ 1250 1271 } 1251 1272 #endif /* PCNET_NO_POLLING */ … … 2111 2132 #ifdef LOG_ENABLED 2112 2133 TMD dummy; 2113 Log2(("#%d pcnetPollTimer time=%08x TDMD=%d TXON=%d POLL=%d TDTE=%d T RDA=%x\n",2134 Log2(("#%d pcnetPollTimer time=%08x TDMD=%d TXON=%d POLL=%d TDTE=%d TDRA=%x\n", 2114 2135 PCNETSTATE_2_DEVINS(pData)->iInstance, RTTimeMilliTS(), CSR_TDMD(pData), CSR_TXON(pData), 2115 2136 !CSR_DPOLL(pData), pcnetTdtePoll(pData, &dummy), pData->GCTDRA)); … … 3546 3567 pData->pDrv->pfnSetPromiscuousMode(pData->pDrv, CSR_PROM(pData)); 3547 3568 3569 #ifdef PCNET_NO_POLLING 3570 /* Enable physical monitoring again (!) */ 3571 pcnetUpdateRingHandlers(pData); 3572 #endif 3548 3573 /* Indicate link down to the guest OS that all network connections have been lost. */ 3549 3574 if (pData->fLinkUp)
Note:
See TracChangeset
for help on using the changeset viewer.