Add some AHCI debugging dumps

This commit is contained in:
Justin C. Miller
2018-05-20 02:02:06 -07:00
parent 81fc559802
commit 193d9939f0
3 changed files with 25 additions and 12 deletions

View File

@@ -301,11 +301,17 @@ port::read_async(uint64_t offset, size_t length, void *dest)
size_t
port::read(uint64_t offset, size_t length, void *dest)
{
dump();
int slot = read_async(offset, length, dest);
dump();
int timeout = 0;
while (m_pending[slot].type == command_type::read) {
if (timeout++ > 10) return 0;
if (timeout++ > 5) {
m_hba->dump();
dump();
return 0;
}
asm("hlt");
}
kassert(m_pending[slot].type == command_type::finished,