From 0cefdb608e23be9cc6fa322c06363b7711a29420 Mon Sep 17 00:00:00 2001 From: aaron Date: Mon, 22 May 2017 15:18:46 +0000 Subject: [PATCH] git-svn-id: https://spexeah.com:8443/svn/Asuro@188 6dbc8c32-bb84-406f-8558-d1cf31a0ab0c --- src/driver/PCI.pas | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/driver/PCI.pas b/src/driver/PCI.pas index 636b2170..481316e7 100644 --- a/src/driver/PCI.pas +++ b/src/driver/PCI.pas @@ -275,14 +275,14 @@ end; function read8(bus : uint8; slot : uint8; func : uint8; offset : uint8; part : uint8) : uint8; begin - loadConfig(bus, slot, func, offset + part); - read8 := inb($CFC); + loadConfig(bus, slot, func, offset); + read8 := (inb($CFC) shr (part * 8)) and $FF; end; function read16(bus : uint8; slot : uint8; func : uint8; offset : uint8; part : uint8) : uint16; begin - loadConfig(bus, slot, func, offset + part); - read16 := inw($CFC); + loadConfig(bus, slot, func, offset); + read16 := (inw($CFC) shr (part * 16)) and $FFFF; end; function read32(bus : uint8; slot : uint8; func : uint8; offset : uint8) : uint32; @@ -306,11 +306,11 @@ begin // end; off:= offset; - tmp.device_id := read16(bus, slot, func, off, 2); + tmp.device_id := read16(bus, slot, func, off, 1); tmp.vendor_id := read16(bus, slot, func, off, 0); off:= off+4; - tmp.status := read16(bus, slot, func, off, 2); + tmp.status := read16(bus, slot, func, off, 1); tmp.command := read16(bus, slot, func, off, 0); off:= off+4;