Anonymous user
AHCI: Difference between revisions
Jump to navigation
Jump to search
Added some extra error handling
[unchecked revision] | [unchecked revision] |
(Added link to Haiku) |
(Added some extra error handling) |
||
Line 553:
{
port->is = (DWORD)-1; // Clear pending interrupt bits
int spin = 0; // Spin lock timeout counter
int slot = find_cmdslot(port);
if (slot == -1)
Line 600:
cmdfis->countl = LOBYTE(count);
cmdfis->counth = HIBYTE(count);
// The below loop waits until the port is no longer busy before issuing a new command
while ((port->tfd & (ATA_DEV_BUSY | ATA_DEV_DRQ)) && spin < 1000000)
{
spin++;
}
if (spin == 1000000)
{
trace_ahci("Port is hung\n");
return FALSE;
}
port->ci = 1<<slot; // Issue command
Line 606 ⟶ 617:
while (1)
{
// in the PxIS port field as well (1 << 5)
if ((port->ci & (1<<slot)) == 0)
break;
if (port->is & HBA_PxIS_TFES) // Task file error
|