git: 9front

Download patch

ref: ba03871d5896b057ff190bf1e2931750c13be09c
parent: c90d57131dc9e5c4ca7c20cf20297983b1599bfd
author: cinap_lenrek <cinap_lenrek@felloff.net>
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;
--