New organization of irq buffer, now its ring buffer. Its faster about 4.5 times.

*Warning! its debug version which can have many bugs, because I cannot test it all. I tested byte's receive on little size of data. If you can test it on big data size, and word's receive - do it! :)

git-svn-id: svn://kolibrios.org@759 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Rus 2008-02-27 18:05:09 +00:00
parent 6094221d05
commit 064055e18f
2 changed files with 377 additions and 365 deletions

View File

@ -318,48 +318,52 @@ irqhandler:
dec ecx
js irqover
mov dx,[esi] ; 2+
movzx edx, word [esi] ; 2+
cmp dx,0 ; 1
test edx, edx ; 1
jz irqover
cmp [esi+3],byte 1 ; 2 ; byte read
jne noirqbyte ; 4-11
in al,dx
mov edx,[edi]
cmp edx,4000
mov ebx, [edi] ; address of begin of buffer in edi ; + 0x0 dword - data size
mov eax, 4000 ; + 0x4 dword - data begin offset
cmp ebx, eax
je irqfull
mov ebx,edi
add ebx,0x10
add ebx,edx
mov [ebx],al
inc edx
mov [edi],edx
add ebx, [edi + 0x4] ; add data size to data begin offset
cmp ebx, eax ; if end of buffer, begin cycle again
jb @f
add esi,4
jmp irqnewread
xor ebx, ebx
noirqbyte:
cmp [esi+3],byte 2 ; word read
jne noirqword
@@:
add ebx, edi
movzx eax, byte[esi + 3] ; get type of data being received 1 - byte, 2 - word
dec eax
jz irqbyte
dec eax
jnz noirqword
in ax,dx
cmp ebx, 3999 ; check for address odd in the end of buffer
jne .odd
mov [ebx + 0x10], ax
jmp .add_size
.odd:
mov [ebx + 0x10], al ; I could make mistake here :)
mov [edi + 0x10], ah
.add_size:
add dword [edi], 2
jmp nextport
mov edx,[edi]
cmp edx,4000
je irqfull
mov ebx,edi
add ebx,0x10
add ebx,edx
mov [ebx],ax
add edx,2
mov [edi],edx
irqbyte:
in al,dx
mov [ebx + 0x10],al
inc dword [edi]
nextport:
add esi,4
jmp irqnewread
noirqword:
irqfull:
irqover:

View File

@ -3948,25 +3948,33 @@ get_irq_data:
gidril1:
shl ebx,12
mov ecx,1
lea eax,[ebx + IRQ_SAVE + 0x10]
mov edx,[eax - 0x10]
xor ecx, ecx
inc ecx
lea eax,[ebx + IRQ_SAVE]
mov edx,[eax]
test edx,edx
jz gid1
dec dword [eax - 0x10]
movzx ebx,byte [eax]
mov edi, eax
xchg esi, eax
inc esi
mov ecx,4000 / 4
cld
rep movsd
; xor ecx,ecx ; as result of 'rep' ecx=0
dec edx
mov [eax], edx
mov ecx, [eax + 0x4]
cmp ecx, 4000
jb @f
xor ecx, ecx
@@:
inc ecx
mov [eax + 0x4], ecx
dec ecx
add eax, ecx
movzx ebx,byte [eax + 0x10]
xor ecx, ecx
gid1:
mov [esp+32],edx
mov [esp+28],ecx