1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

Fix 32-bit PCI devices not having bar sizes correctly determined.

This commit is contained in:
Jonas 'Sortie' Termansen 2014-03-25 18:50:41 +01:00
parent e8cfd5bf85
commit 6b8e389b47

View file

@ -198,6 +198,7 @@ pcibar_t GetBAR(uint32_t devaddr, uint8_t bar)
PCI::Write32(devaddr, 0x10 + 4 * (bar+0), low);
result.size_raw = (uint64_t) size_low << 0;
result.size_raw = ~(result.size_raw & 0xFFFFFFF0) + 1;
result.size_raw &= 0xFFFFFFFF;
}
else if ( result.is_iospace() )
{
@ -206,6 +207,7 @@ pcibar_t GetBAR(uint32_t devaddr, uint8_t bar)
PCI::Write32(devaddr, 0x10 + 4 * (bar+0), low);
result.size_raw = (uint64_t) size_low << 0;
result.size_raw = ~(result.size_raw & 0xFFFFFFFC) + 1;
result.size_raw &= 0xFFFFFFFF;
}
return result;