Changeset 49173 in vbox for trunk/src/VBox/Devices/Storage
- Timestamp:
- Oct 17, 2013 8:42:22 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 90046
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Storage/DevAHCI.cpp
r48744 r49173 82 82 83 83 /** The current saved state version. */ 84 #define AHCI_SAVED_STATE_VERSION 6 84 #define AHCI_SAVED_STATE_VERSION 7 85 /** Saved state version before the per port hotplug port was added. */ 86 #define AHCI_SAVED_STATE_VERSION_PRE_HOTPLUG_FLAG 6 85 87 /** Saved state version before legacy ATA emulation was dropped. */ 86 #define AHCI_SAVED_STATE_VERSION_IDE_EMULATION 588 #define AHCI_SAVED_STATE_VERSION_IDE_EMULATION 5 87 89 /** Saved state version before ATAPI support was added. */ 88 #define AHCI_SAVED_STATE_VERSION_PRE_ATAPI 390 #define AHCI_SAVED_STATE_VERSION_PRE_ATAPI 3 89 91 /** The saved state version use in VirtualBox 3.0 and earlier. 90 92 * This was before the config was added and ahciIOTasks was dropped. */ 91 #define AHCI_SAVED_STATE_VERSION_VBOX_30 293 #define AHCI_SAVED_STATE_VERSION_VBOX_30 2 92 94 /* for Older ATA state Read handling */ 93 95 #define ATA_CTL_SAVED_STATE_VERSION 3 … … 417 419 uint32_t regCI; 418 420 419 #if HC_ARCH_BITS == 64 420 uint32_t Alignment1; 421 #endif 422 421 /** Current number of active tasks. */ 422 volatile uint32_t cTasksActive; 423 423 /** Command List Base Address */ 424 424 volatile RTGCPHYS GCPhysAddrClb; 425 425 /** FIS Base Address */ 426 426 volatile RTGCPHYS GCPhysAddrFb; 427 /** Current number of active tasks. */428 volatile uint32_t cTasksActive;429 427 430 428 /** Device is powered on. */ … … 446 444 /** Flag if we are in a device reset. */ 447 445 bool fResetDevice; 446 /** Flag whether this port is hot plug capable. */ 447 bool fHotpluggable; 448 448 /** Flag whether the I/O thread idles. */ 449 449 volatile bool fAsyncIOThreadIdle; … … 452 452 /** Flag whether the worker thread is sleeping. */ 453 453 volatile bool fWrkThreadSleeping; 454 455 bool afAlignment[3]; 454 456 455 457 /** Number of total sectors. */ … … 514 516 PDMLED Led; 515 517 516 #if HC_ARCH_BITS == 64517 518 uint32_t u32Alignment3; 518 #endif519 519 520 520 /** Async IO Thread. */ … … 1934 1934 pAhciPort->regIE = 0; 1935 1935 pAhciPort->regCMD = AHCI_PORT_CMD_CPD | /* Cold presence detection */ 1936 AHCI_PORT_CMD_HPCP | /* Hotplugging supported. */1937 1936 AHCI_PORT_CMD_SUD | /* Device has spun up. */ 1938 1937 AHCI_PORT_CMD_POD; /* Port is powered on. */ 1938 1939 /* Hotplugging supported?. */ 1940 if (pAhciPort->fHotpluggable) 1941 pAhciPort->regCMD |= AHCI_PORT_CMD_HPCP; 1942 1939 1943 pAhciPort->regTFD = (1 << 8) | ATA_STAT_SEEK | ATA_STAT_WRERR; 1940 1944 pAhciPort->regSIG = ~0; … … 6790 6794 { 6791 6795 SSMR3PutBool(pSSM, pThis->ahciPort[i].pDrvBase != NULL); 6796 SSMR3PutBool(pSSM, pThis->ahciPort[i].fHotpluggable); 6792 6797 SSMR3PutStrZ(pSSM, pThis->ahciPort[i].szSerialNumber); 6793 6798 SSMR3PutStrZ(pSSM, pThis->ahciPort[i].szFirmwareRevision); … … 6994 6999 fInUse ? "target" : "source", i ); 6995 7000 7001 if (uVersion > AHCI_SAVED_STATE_VERSION_PRE_HOTPLUG_FLAG) 7002 { 7003 bool fHotpluggable; 7004 rc = SSMR3GetBool(pSSM, &fHotpluggable); 7005 AssertRCReturn(rc, rc); 7006 if (fHotpluggable != pThis->ahciPort[i].fHotpluggable) 7007 return SSMR3SetCfgError(pSSM, RT_SRC_POS, 7008 N_("AHCI: Port %u config mismatch: Hotplug flag - saved=%RTbool config=%RTbool\n"), 7009 i, fHotpluggable, pThis->ahciPort[i].fHotpluggable); 7010 } 7011 else 7012 Assert(pThis->ahciPort[i].fHotpluggable); 7013 6996 7014 char szSerialNumber[AHCI_SERIAL_NUMBER_LENGTH+1]; 6997 7015 rc = SSMR3GetStrZ(pSSM, szSerialNumber, sizeof(szSerialNumber)); … … 7577 7595 7578 7596 AssertMsg(iLUN < pAhci->cPortsImpl, ("iLUN=%u", iLUN)); 7597 AssertMsgReturnVoid( pAhciPort->fHotpluggable 7598 || (fFlags & PDM_TACH_FLAGS_NOT_HOT_PLUG), 7599 ("AHCI: Port %d is not marked hotpluggable\n", pAhciPort->iLUN)); 7600 7579 7601 7580 7602 if (pAhciPort->pAsyncIOThread) … … 7693 7715 && !(fFlags & PDM_TACH_FLAGS_NOT_HOT_PLUG)) 7694 7716 { 7717 AssertMsgReturn(pAhciPort->fHotpluggable, 7718 ("AHCI: Port %d is not marked hotpluggable\n", pAhciPort->iLUN), 7719 VERR_NOT_SUPPORTED); 7720 7695 7721 /* 7696 7722 * Initialize registers … … 8118 8144 pAhciPort->IMountNotify.pfnUnmountNotify = ahciR3UnmountNotify; 8119 8145 pAhciPort->fAsyncIOThreadIdle = true; 8146 8147 /* Query per port configuration options if available. */ 8148 PCFGMNODE pCfgPort = CFGMR3GetChild(pDevIns->pCfg, szName); 8149 if (pCfgPort) 8150 { 8151 rc = CFGMR3QueryBoolDef(pCfgPort, "Hotpluggable", &pAhciPort->fHotpluggable, true); 8152 if (RT_FAILURE(rc)) 8153 return PDMDEV_SET_ERROR(pDevIns, rc, 8154 N_("AHCI configuration error: failed to read Hotpluggable as boolean")); 8155 } 8120 8156 8121 8157 /*
Note:
See TracChangeset
for help on using the changeset viewer.