Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 4291 → Rev 4290

/kernel/trunk/blkdev/hd_drv.inc
112,22 → 112,6
ja .nodma
cmp [dma_hdd], 1
jnz .nodma
;--------------------------------------
push eax
mov eax, [hd_address_table]
cmp [hdbase], eax ; 0x1F0
pop eax
jnz @f
 
test [DRIVE_DATA+1], byte 10100000b
jnz .nodma
 
jmp .dma
@@:
test [DRIVE_DATA+1], byte 1010b
jnz .nodma
.dma:
;--------------------------------------
call hd_read_dma
jmp @f
.nodma:
220,22 → 204,6
jae .nodma
cmp [dma_hdd], 1
jnz .nodma
;--------------------------------------
push eax
mov eax, [hd_address_table]
cmp [hdbase], eax ; 0x1F0
pop eax
jnz @f
 
test [DRIVE_DATA+1], byte 10100000b
jnz .nodma
 
jmp .dma
@@:
test [DRIVE_DATA+1], byte 1010b
jnz .nodma
.dma:
;--------------------------------------
call cache_write_dma
jmp .common
.nodma:
835,37 → 803,23
pushfd
cli
pushad
; clear Bus Master IDE Command register
mov [IDE_common_irq_param], 0
mov dx, [IDEContrRegsBaseAddr]
; test whether it is our interrupt?
add edx, 2
in al, dx
test al, 100b
jz @f
mov al, 0
out dx, al
; clear Bus Master IDE Status register
; clear Interrupt bit
add edx, 2
mov al, 4 ; 100b
out dx, al
; clear Bus Master IDE Command register
sub edx, 2
xor eax, eax
out dx, al
; read status register and remove the interrupt request
mov edx, [hdbase]
add edx, 0x7
in al, dx
 
popad
popfd
mov al, 1
ret
;--------------------------------------
align 4
@@:
popad
popfd
;--------------------------------------
align 4
.exit:
mov al, 0
mov al, 1
ret
;-----------------------------------------------------------------------------
align 4
876,38 → 830,24
pushfd
cli
pushad
; clear Bus Master IDE Command register
mov [IDE_common_irq_param], 0
mov dx, [IDEContrRegsBaseAddr]
add dx, 8
; test whether it is our interrupt?
add edx, 2
in al, dx
test al, 100b
jz @f
mov al, 0
out dx, al
; clear Bus Master IDE Status register
; clear Interrupt bit
add edx, 2
mov al, 4 ; 100b
out dx, al
; clear Bus Master IDE Command register
sub edx, 2
mov al, 0
out dx, al
; read status register and remove the interrupt request
mov edx, [hdbase]
add edx, 0x7
in al, dx
 
popad
popfd
mov al, 1
ret
;--------------------------------------
align 4
@@:
popad
popfd
;--------------------------------------
align 4
.exit:
mov al, 0
mov al, 1
ret
;-----------------------------------------------------------------------------
align 4
918,11 → 858,13
pushfd
cli
pushad
; clear Bus Master IDE Command register
xor ebx, ebx
mov dx, [IDEContrRegsBaseAddr]
mov eax, IDE_common_irq_param
cmp [eax], irq14_num
mov [eax], bl
xor eax, eax
je @f
 
add dx, 8
929,35 → 871,19
;--------------------------------------
align 4
@@:
; test whether it is our interrupt?
add edx, 2
in al, dx
test al, 100b
jz @f
out dx, al
; clear Bus Master IDE Status register
; clear Interrupt bit
add edx, 2
mov al, 4 ; 100b
out dx, al
; clear Bus Master IDE Command register
sub edx, 2
xor eax, eax
out dx, al
; read status register and remove the interrupt request
mov edx, [hdbase]
add edx, 0x7
in al, dx
 
popad
popfd
mov al, 1
ret
;--------------------------------------
align 4
@@:
popad
popfd
;--------------------------------------
align 4
.exit:
mov al, 0
mov al, 1
ret
;-----------------------------------------------------------------------------
align 4