ref: fcd45e0cdd0591e11b876da4f378c0474c21475f
parent: b7ceab84d3abd72058c6d6532ebaa7a76921d370
author: cinap_lenrek <[email protected]>
date: Tue Apr 7 23:46:49 EDT 2015
pci: just in case the bios is drunk
--- a/sys/src/9/pc/pci.c
+++ b/sys/src/9/pc/pci.c
@@ -441,10 +441,10 @@
if((hdt & 0x7F) != 0)
break;
rno = PciBAR0;
- for(i = 0; i < nelem(p->mem); i++) {
+ for(i = 0; i <= 5; i++) {
p->mem[i].bar = pcicfgr32(p, rno);
p->mem[i].size = pcibarsize(p, rno);
- if((p->mem[i].bar & 7) == 4){
+ if((p->mem[i].bar & 7) == 4 && i < 5){
ulong hi;
rno += 4;