From 70c292f41812e34cd2064c3faf2d60caaf68b1ae Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Wed, 15 Aug 2012 10:50:36 +0000 Subject: [PATCH] fixed find_mmio32 in pci.inc git-svn-id: svn://kolibrios.org@2922 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/branches/net/drivers/bus/pci.inc | 30 ++++++++++++++----------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/kernel/branches/net/drivers/bus/pci.inc b/kernel/branches/net/drivers/bus/pci.inc index 6b105f71f1..de6f579bed 100644 --- a/kernel/branches/net/drivers/bus/pci.inc +++ b/kernel/branches/net/drivers/bus/pci.inc @@ -50,40 +50,44 @@ macro find_io bus, dev, io { jz .inc and eax, PCI_BASE_ADDRESS_IO_MASK - mov io , eax jmp .got .inc: add esi, 4 cmp esi, PCI_BASE_ADDRESS_5 - jle .check + jbe .check + xor eax, eax .got: + mov io, eax } -macro find_mmio32 bus, dev, mmio32 { +macro find_mmio32 bus, dev, io { - local .check, .got + local .check, .inc, .got - xor eax, eax mov esi, PCI_BASE_ADDRESS_0 - movzx ecx, bus - movzx edx, dev .check: - stdcall PciRead32, ecx ,edx ,esi + stdcall PciRead32, bus, dev, esi - test eax, not PCI_BASE_ADDRESS_IO_MASK - jz .got + test eax, PCI_BASE_ADDRESS_SPACE_IO ; mmio address? + jnz .inc + test eax, 100b ; 64 bit? + jnz .inc + and eax, not 1111b + jmp .got + + .inc: add esi, 4 cmp esi, PCI_BASE_ADDRESS_5 - jle .check - + jbe .check xor eax, eax + .got: - mov mmio32, eax + mov io, eax }