From 8ba3e5e11bcf3b3e1bd4874075d3153b7c8d8d05 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Tue, 7 Aug 2012 20:26:26 +0000 Subject: [PATCH] added latency config macro to pci.inc git-svn-id: svn://kolibrios.org@2911 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/branches/net/drivers/bus/pci.inc | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/kernel/branches/net/drivers/bus/pci.inc b/kernel/branches/net/drivers/bus/pci.inc index 26a497e4fa..6b105f71f1 100644 --- a/kernel/branches/net/drivers/bus/pci.inc +++ b/kernel/branches/net/drivers/bus/pci.inc @@ -114,11 +114,20 @@ macro make_bus_master bus, dev { movzx ecx, bus movzx edx, dev stdcall PciRead32, ecx ,edx, PCI_REG_COMMAND - - or al, PCI_BIT_MASTER ;or PCI_BIT_PIO -; and al, not PCI_BIT_MMIO + or al, PCI_BIT_MASTER stdcall PciWrite32, ecx, edx, PCI_REG_COMMAND, eax -;; TODO: try to switch to PIO, and check if PIO works or not.. +} -} \ No newline at end of file +macro adjust_latency bus, dev, min { + + movzx ecx, bus + movzx edx, dev + stdcall PciRead8, ecx ,edx, PCI_REG_LATENCY + cmp al, min + ja @f + mov al, min + stdcall PciWrite8, ecx, edx, PCI_REG_LATENCY, eax + @@: + +}