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:
parent
e8cfd5bf85
commit
6b8e389b47
1 changed files with 2 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue