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 dec ecx
js irqover js irqover
mov dx,[esi] ; 2+ movzx edx, word [esi] ; 2+
cmp dx,0 ; 1 test edx, edx ; 1
jz irqover jz irqover
cmp [esi+3],byte 1 ; 2 ; byte read
jne noirqbyte ; 4-11
in al,dx
mov edx,[edi] mov ebx, [edi] ; address of begin of buffer in edi ; + 0x0 dword - data size
cmp edx,4000 mov eax, 4000 ; + 0x4 dword - data begin offset
cmp ebx, eax
je irqfull je irqfull
mov ebx,edi add ebx, [edi + 0x4] ; add data size to data begin offset
add ebx,0x10 cmp ebx, eax ; if end of buffer, begin cycle again
add ebx,edx jb @f
mov [ebx],al
inc edx
mov [edi],edx
add esi,4 xor ebx, ebx
jmp irqnewread
noirqbyte: @@:
add ebx, edi
movzx eax, byte[esi + 3] ; get type of data being received 1 - byte, 2 - word
cmp [esi+3],byte 2 ; word read dec eax
jne noirqword jz irqbyte
dec eax
jnz noirqword
in ax,dx 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 irqbyte:
je irqfull in al,dx
mov ebx,edi mov [ebx + 0x10],al
add ebx,0x10 inc dword [edi]
add ebx,edx nextport:
mov [ebx],ax
add edx,2
mov [edi],edx
add esi,4 add esi,4
jmp irqnewread jmp irqnewread
noirqword: noirqword:
irqfull: irqfull:
irqover: irqover:

View File

@ -3948,25 +3948,33 @@ get_irq_data:
gidril1: gidril1:
shl ebx,12 shl ebx,12
mov ecx,1 xor ecx, ecx
lea eax,[ebx + IRQ_SAVE + 0x10] inc ecx
mov edx,[eax - 0x10] lea eax,[ebx + IRQ_SAVE]
mov edx,[eax]
test edx,edx test edx,edx
jz gid1 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 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: gid1:
mov [esp+32],edx mov [esp+32],edx
mov [esp+28],ecx mov [esp+28],ecx