From 0d5c57a1325410fd6f1362facc45802afb953be3 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 6 Jan 2013 23:39:02 +0100 Subject: vga: dont confuse io bar with mem bar in vgas3 and vgavesa harmless bug. just make sure we loop over the memory bars only and skip the io bars. --- sys/src/9/pc/vgas3.c | 1 + sys/src/9/pc/vgavesa.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/sys/src/9/pc/vgas3.c b/sys/src/9/pc/vgas3.c index bbf034560..ed203af65 100644 --- a/sys/src/9/pc/vgas3.c +++ b/sys/src/9/pc/vgas3.c @@ -120,6 +120,7 @@ s3linear(VGAscr* scr, int, int) * much space they would need in the first design. */ for(j=0; jmem); j++){ + if((p->mem[j].bar&1) == 0) if((p->mem[j].bar&~0x0F) != scr->paddr) if(p->mem[j].size==512*1024 || p->mem[j].size==16*1024*1024){ mmiobase = p->mem[j].bar & ~0x0F; diff --git a/sys/src/9/pc/vgavesa.c b/sys/src/9/pc/vgavesa.c index ea1f26ad3..fbe051f5f 100644 --- a/sys/src/9/pc/vgavesa.c +++ b/sys/src/9/pc/vgavesa.c @@ -136,6 +136,8 @@ vesalinear(VGAscr *scr, int, int) for(i=0; imem); i++){ ulong a, e; + if(pci->mem[i].bar&1) /* not memory */ + continue; a = pci->mem[i].bar & ~0xF; e = a + pci->mem[i].size; if(paddr >= a && (paddr+size) <= e){ -- cgit v1.2.3