Changeset 81906 in vbox
- Timestamp:
- Nov 17, 2019 3:04:56 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 134703
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/PC/DevPit-i8254.cpp
r81902 r81906 214 214 215 215 /** 216 * The wholePIT state.216 * The shared PIT state. 217 217 */ 218 218 typedef struct PITSTATE … … 241 241 int afAlignment2; 242 242 #endif 243 /** PIT port interface. */244 PDMIHPETLEGACYNOTIFY IHpetLegacyNotify;245 /** Pointer to the device instance. */246 PPDMDEVINSR3 pDevIns;247 243 /** Number of IRQs that's been raised. */ 248 244 STAMCOUNTER StatPITIrq; … … 256 252 IOMIOPORTHANDLE hIoPortSpeaker; 257 253 } PITSTATE; 258 /** Pointer to the PIT device state. */254 /** Pointer to the shared PIT device state. */ 259 255 typedef PITSTATE *PPITSTATE; 256 257 258 /** 259 * The ring-3 PIT state. 260 */ 261 typedef struct PITSTATER3 262 { 263 /** PIT port interface. */ 264 PDMIHPETLEGACYNOTIFY IHpetLegacyNotify; 265 /** Pointer to the device instance. */ 266 PPDMDEVINSR3 pDevIns; 267 } PITSTATER3; 268 /** Pointer to the ring-3 PIT device state. */ 269 typedef PITSTATER3 *PPITSTATER3; 260 270 261 271 … … 1228 1238 static DECLCALLBACK(void) pitNotifyHpetLegacyNotify_ModeChanged(PPDMIHPETLEGACYNOTIFY pInterface, bool fActivated) 1229 1239 { 1230 PPITSTATE pThis = RT_FROM_MEMBER(pInterface, PITSTATE, IHpetLegacyNotify); 1231 PPDMDEVINS pDevIns = pThis->pDevIns; 1240 PPITSTATER3 pThisCC = RT_FROM_MEMBER(pInterface, PITSTATER3, IHpetLegacyNotify); 1241 PPDMDEVINS pDevIns = pThisCC->pDevIns; 1242 PPITSTATE pThis = PDMDEVINS_2_DATA(pDevIns, PPITSTATE); 1232 1243 PDMDevHlpCritSectEnter(pDevIns, &pThis->CritSect, VERR_IGNORED); 1233 1244 … … 1246 1257 { 1247 1258 PPDMDEVINS pDevIns = RT_FROM_MEMBER(pInterface, PDMDEVINS, IBase); 1248 PPITSTATE pThis = PDMDEVINS_2_DATA(pDevIns, PPITSTATE);1259 PPITSTATER3 pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PPITSTATER3); 1249 1260 PDMIBASE_RETURN_INTERFACE(pszIID, PDMIBASE, &pDevIns->IBase); 1250 PDMIBASE_RETURN_INTERFACE(pszIID, PDMIHPETLEGACYNOTIFY, &pThis ->IHpetLegacyNotify);1261 PDMIBASE_RETURN_INTERFACE(pszIID, PDMIHPETLEGACYNOTIFY, &pThisCC->IHpetLegacyNotify); 1251 1262 return NULL; 1252 1263 } … … 1299 1310 { 1300 1311 PDMDEV_CHECK_VERSIONS_RETURN(pDevIns); 1301 PPITSTATE pThis = PDMDEVINS_2_DATA(pDevIns, PPITSTATE); 1302 PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; 1312 PPITSTATE pThis = PDMDEVINS_2_DATA(pDevIns, PPITSTATE); 1313 PPITSTATER3 pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PPITSTATER3); 1314 PCPDMDEVHLPR3 pHlp = pDevIns->pHlpR3; 1303 1315 int rc; 1304 1316 uint8_t u8Irq; … … 1340 1352 * Init the data. 1341 1353 */ 1342 pThis->pDevIns = pDevIns;1343 1354 pThis->IOPortBaseCfg = u16Base; 1355 pThis->channels[0].irq = u8Irq; 1356 for (i = 0; i < RT_ELEMENTS(pThis->channels); i++) 1357 { 1358 pThis->channels[i].hTimer = NIL_TMTIMERHANDLE; 1359 pThis->channels[i].iChan = i; 1360 } 1344 1361 pThis->fSpeakerCfg = fSpeaker; 1345 1362 pThis->enmSpeakerEmu = PIT_SPEAKER_EMU_NONE; … … 1399 1416 } 1400 1417 } 1401 pThis->channels[0].irq = u8Irq;1402 for (i = 0; i < RT_ELEMENTS(pThis->channels); i++)1403 {1404 pThis->channels[i].hTimer = NIL_TMTIMERHANDLE;1405 pThis->channels[i].iChan = i;1406 }1407 1418 1408 1419 /* … … 1410 1421 */ 1411 1422 /* IBase */ 1412 pDevIns->IBase.pfnQueryInterface = pitQueryInterface;1423 pDevIns->IBase.pfnQueryInterface = pitQueryInterface; 1413 1424 /* IHpetLegacyNotify */ 1414 pThis->IHpetLegacyNotify.pfnModeChanged = pitNotifyHpetLegacyNotify_ModeChanged; 1425 pThisCC->IHpetLegacyNotify.pfnModeChanged = pitNotifyHpetLegacyNotify_ModeChanged; 1426 pThisCC->pDevIns = pDevIns; 1415 1427 1416 1428 /* … … 1506 1518 /* .uSharedVersion = */ 42, 1507 1519 /* .cbInstanceShared = */ sizeof(PITSTATE), 1508 /* .cbInstanceCC = */ 0,1520 /* .cbInstanceCC = */ CTX_EXPR(sizeof(PITSTATER3), 0, 0), 1509 1521 /* .cbInstanceRC = */ 0, 1510 1522 /* .cMaxPciDevices = */ 0,
Note:
See TracChangeset
for help on using the changeset viewer.