From 85d31dcef6dfbf2d0d5a9a716cb7b8d61d83faad Mon Sep 17 00:00:00 2001 From: CleverMouse Date: Thu, 20 Feb 2014 13:01:13 +0000 Subject: [PATCH] quick fix for active IDE interrupts at boot stage git-svn-id: svn://kolibrios.org@4578 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/blkdev/hd_drv.inc | 32 ++++++++++++++++++++++++++++++++ kernel/trunk/kernel.asm | 1 + 2 files changed, 33 insertions(+) diff --git a/kernel/trunk/blkdev/hd_drv.inc b/kernel/trunk/blkdev/hd_drv.inc index e610b89954..d7303dc682 100644 --- a/kernel/trunk/blkdev/hd_drv.inc +++ b/kernel/trunk/blkdev/hd_drv.inc @@ -1183,3 +1183,35 @@ IDE_BAR2_val dw ? IDE_BAR3_val dw ? endg ;----------------------------------------------------------------------------- + +proc clear_pci_ide_interrupts + mov esi, pcidev_list +.loop: + mov esi, [esi+PCIDEV.fd] + cmp esi, pcidev_list + jz .done + cmp [esi+PCIDEV.class], 0x01018F + jnz .loop + mov ah, [esi+PCIDEV.bus] + mov al, 2 + mov bh, [esi+PCIDEV.devfn] + mov bl, 0x20 + call pci_read_reg + and eax, 0FFFCh + mov edx, eax + add edx, 2 + in al, dx + DEBUGF 1,'K : clear_pci_ide_interrupts: port[%x] = %x ',dx,al + out dx, al + in al, dx + DEBUGF 1,'-> %x; ',al + add edx, 8 + in al, dx + DEBUGF 1,'port[%x] = %x ',dx,al + out dx, al + in al, dx + DEBUGF 1,'-> %x\n',al + jmp .loop +.done: + ret +endp diff --git a/kernel/trunk/kernel.asm b/kernel/trunk/kernel.asm index 311f92df6d..ac10f44e4b 100644 --- a/kernel/trunk/kernel.asm +++ b/kernel/trunk/kernel.asm @@ -1027,6 +1027,7 @@ end if mov [pci_access_enabled], 1 call pci_enum + call clear_pci_ide_interrupts include "detect/vortex86.inc" ; Vortex86 SoC detection code