Lines Matching refs:pAhci

994 static void ahciHbaClearInterrupt(PAHCI pAhci)
997 PDMDevHlpPCISetIrq(pAhci->CTX_SUFF(pDevIns), 0, 0);
1003 static int ahciHbaSetInterrupt(PAHCI pAhci, uint8_t iPort, int rcBusy)
1007 int rc = PDMCritSectEnter(&pAhci->lock, rcBusy);
1011 if (pAhci->regHbaCtrl & AHCI_HBA_CTRL_IE)
1013 if ((pAhci->regHbaCccCtl & AHCI_HBA_CCC_CTL_EN) && (pAhci->regHbaCccPorts & (1 << iPort)))
1015 pAhci->uCccCurrentNr++;
1016 if (pAhci->uCccCurrentNr >= pAhci->uCccNr)
1019 TMTimerSetMillies(pAhci->CTX_SUFF(pHbaCccTimer), pAhci->uCccTimeout);
1020 pAhci->uCccCurrentNr = 0;
1022 pAhci->u32PortsInterrupted |= (1 << pAhci->uCccPortNr);
1023 if (!(pAhci->u32PortsInterrupted & ~(1 << pAhci->uCccPortNr)))
1026 PDMDevHlpPCISetIrq(pAhci->CTX_SUFF(pDevIns), 0, 1);
1037 ASMAtomicOrU32((volatile uint32_t *)&pAhci->u32PortsInterrupted, (1 << iPort));
1038 if (!(pAhci->u32PortsInterrupted & ~(1 << iPort)))
1041 PDMDevHlpPCISetIrq(pAhci->CTX_SUFF(pDevIns), 0, 1);
1046 PDMCritSectLeave(&pAhci->lock);
1056 PAHCI pAhci = (PAHCI)pvUser;
1058 int rc = ahciHbaSetInterrupt(pAhci, pAhci->uCccPortNr, VERR_IGNORED);
1092 int rc = ahciHbaSetInterrupt(pAhciPort->CTX_SUFF(pAhci), pAhciPort->iLUN, VERR_IGNORED);
1124 * @param pAhci The AHCI controller instance.
1127 static void ahciIoThreadKick(PAHCI pAhci, PAHCIPort pAhciPort)
1130 PDEVPORTNOTIFIERQUEUEITEM pItem = (PDEVPORTNOTIFIERQUEUEITEM)PDMQueueAlloc(pAhci->CTX_SUFF(pNotifierQueue));
1136 PDMQueueInsert(pAhci->CTX_SUFF(pNotifierQueue), (PPDMQUEUEITEMCORE)pItem);
1140 int rc = SUPSemEventSignal(pAhci->pSupDrvSession, pAhciPort->hEvtProcess);
1453 int rc = ahciHbaSetInterrupt(pAhciPort->CTX_SUFF(pAhci), pAhciPort->iLUN, VERR_IGNORED);
2171 * @param pAhci The AHCI instance.
2176 static int ahciRegisterRead(PAHCI pAhci, uint32_t uReg, void *pv, unsigned cb)
2192 rc = pReg->pfnRead(pAhci, iReg, (uint32_t *)pv);
2213 if (RT_LIKELY( iPort < pAhci->cPortsImpl
2217 rc = pPortReg->pfnRead(pAhci, &pAhci->ahciPort[iPort], iReg, (uint32_t *)pv);
2261 * @param pAhci The AHCI instance.
2265 static int ahciRegisterWrite(PAHCI pAhci, uint32_t offReg, uint32_t u32Value)
2281 rc = pReg->pfnWrite(pAhci, iReg, u32Value);
2298 if (RT_LIKELY( iPort < pAhci->cPortsImpl
2302 rc = pPortReg->pfnWrite(pAhci, &pAhci->ahciPort[iPort], iReg, u32Value);
2327 PAHCI pAhci = PDMINS_2_DATA(pDevIns, PAHCI);
2331 int rc = ahciRegisterRead(pAhci, GCPhysAddr - pAhci->MMIOBase, pv, cb);
2352 PAHCI pAhci = PDMINS_2_DATA(pDevIns, PAHCI);
2369 if (!pAhci->f8ByteMMIO4BytesWrittenSuccessfully)
2375 pAhci->f8ByteMMIO4BytesWrittenSuccessfully = true;
2384 pAhci->f8ByteMMIO4BytesWrittenSuccessfully = false;
2391 return ahciRegisterWrite(pAhci, GCPhysAddr - pAhci->MMIOBase, *(uint32_t const *)pv);
2419 PAHCI pAhci = PDMINS_2_DATA(pDevIns, PAHCI);
2422 if (Port - pAhci->IOPortBase >= 8)
2424 unsigned iReg = (Port - pAhci->IOPortBase - 8) / 4;
2431 pAhci->regIdx = u32;
2437 rc = ahciRegisterWrite(pAhci, pAhci->regIdx, u32);
2462 PAHCI pAhci = PDMINS_2_DATA(pDevIns, PAHCI);
2465 if (Port - pAhci->IOPortBase >= 8)
2467 unsigned iReg = (Port - pAhci->IOPortBase - 8) / 4;
2474 *pu32 = pAhci->regIdx;
2480 rc = ahciRegisterRead(pAhci, pAhci->regIdx, pu32, cb);
2624 PAHCI pAhci = PDMILEDPORTS_2_PAHCI(pInterface);
2627 *ppLed = &pAhci->ahciPort[iLUN].Led;
3130 p[75] = RT_H2LE_U16(pAhciPort->CTX_SUFF(pAhci)->cCmdSlotsAvail-1); /* Number of commands we support, 0's based */
4636 PAHCI pAhci = pAhciPort->CTX_SUFF(pAhci);
4637 PPDMDEVINS pDevIns = pAhci->CTX_SUFF(pDevIns);
4654 if (RT_SUCCESS(rc) && pAhci->pMediaNotify)
4657 (PFNRT)pAhci->pMediaNotify->pfnEjected, 2,
4658 pAhci->pMediaNotify, pAhciPort->iLUN);
5133 rc = ahciHbaSetInterrupt(pAhciPort->CTX_SUFF(pAhci), pAhciPort->iLUN, VERR_IGNORED);
5171 PAHCI pAhci = pAhciPort->CTX_SUFF(pAhci);
5217 int rc = ahciHbaSetInterrupt(pAhci, pAhciPort->iLUN, VERR_IGNORED);
5236 PAHCI pAhci = pAhciPort->CTX_SUFF(pAhci);
5286 int rc = ahciHbaSetInterrupt(pAhci, pAhciPort->iLUN, VERR_IGNORED);
5304 PAHCI pAhci = pAhciPort->CTX_SUFF(pAhci);
5353 int rc = ahciHbaSetInterrupt(pAhci, pAhciPort->iLUN, VERR_IGNORED);
6066 ahciHbaSetInterrupt(pAhciPort->CTX_SUFF(pAhci), pAhciPort->iLUN, VERR_IGNORED);
6605 PAHCI pAhci = pAhciPort->CTX_SUFF(pAhci);
6629 rc = SUPSemEventWaitNoResume(pAhci->pSupDrvSession, pAhciPort->hEvtProcess, RT_INDEFINITE_WAIT);
6638 ASMAtomicIncU32(&pAhci->cThreadsActive);
6641 if (pAhci->fSignalIdle)
6643 if (!ASMAtomicDecU32(&pAhci->cThreadsActive))
6652 u32RegHbaCtrl = ASMAtomicReadU32(&pAhci->regHbaCtrl);
6654 && !ASMAtomicDecU32(&pAhci->cThreadsActive))
6656 ahciHBAReset(pAhci);
6657 if (pAhci->fSignalIdle)
6869 u32RegHbaCtrl = ASMAtomicReadU32(&pAhci->regHbaCtrl);
6870 uint32_t cThreadsActive = ASMAtomicDecU32(&pAhci->cThreadsActive);
6873 ahciHBAReset(pAhci);
6875 if (!cThreadsActive && pAhci->fSignalIdle)
7419 PAHCI pAhci = PDMINS_2_DATA(pDevIns, PAHCI);
7421 pAhci->pDevInsRC += offDelta;
7422 pAhci->pHbaCccTimerRC = TMTimerRCPtr(pAhci->pHbaCccTimerR3);
7423 pAhci->pNotifierQueueRC = PDMQueueRCPtr(pAhci->pNotifierQueueR3);
7426 for (i = 0; i < RT_ELEMENTS(pAhci->ahciPort); i++)
7428 PAHCIPort pAhciPort = &pAhci->ahciPort[i];
7695 PAHCI pAhci = PDMINS_2_DATA(pDevIns, PAHCI);
7701 for (unsigned i = 0; i < RT_ELEMENTS(pAhci->ahciPort); i++)
7703 PAHCIPort pAhciPort = &pAhci->ahciPort[i];
7707 PDEVPORTNOTIFIERQUEUEITEM pItem = (PDEVPORTNOTIFIERQUEUEITEM)PDMQueueAlloc(pAhci->CTX_SUFF(pNotifierQueue));
7716 pItem->iPort = pAhci->ahciPort[i].iLUN;
7717 PDMQueueInsert(pAhci->CTX_SUFF(pNotifierQueue), (PPDMQUEUEITEMCORE)pItem);
7735 PAHCI pAhci = PDMINS_2_DATA(pDevIns, PAHCI);
7856 PAHCI pAhci = PDMINS_2_DATA(pDevIns, PAHCI);
7857 PAHCIPort pAhciPort = &pAhci->ahciPort[iLUN];
7862 AssertMsg(iLUN < pAhci->cPortsImpl, ("iLUN=%u", iLUN));
7903 ahciHbaSetInterrupt(pAhciPort->CTX_SUFF(pAhci), pAhciPort->iLUN, VERR_IGNORED);
8023 ahciHbaSetInterrupt(pAhciPort->CTX_SUFF(pAhci), pAhciPort->iLUN, VERR_IGNORED);
8038 PAHCI pAhci = PDMINS_2_DATA(pDevIns, PAHCI);
8040 ahciHBAReset(pAhci);
8043 for (uint32_t i = 0; i < RT_ELEMENTS(pAhci->ahciPort); i++)
8044 ahciPortHwReset(&pAhci->ahciPort[i]);