allocate_and_clear macro now clears even the last odd bytes. (fix problem with RTL8139)

git-svn-id: svn://kolibrios.org@3635 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2013-06-10 17:32:49 +00:00
parent e7b74632f9
commit 6a2df080e4
2 changed files with 8 additions and 2 deletions

View File

@ -211,6 +211,7 @@ virtual at ebx
.irq_line db ? .irq_line db ?
.hw_ver_id db ? .hw_ver_id db ?
db ? ; align 4
.TX_DESC rd NUM_TX_DESC .TX_DESC rd NUM_TX_DESC
.size = $ - device .size = $ - device
@ -821,7 +822,7 @@ int_handler:
cmp eax, RX_BUFFER_SIZE cmp eax, RX_BUFFER_SIZE
jb .no_wrap jb .no_wrap
DEBUGF 2, "Wrapping" DEBUGF 1, "Wrapping"
sub eax, RX_BUFFER_SIZE sub eax, RX_BUFFER_SIZE
.no_wrap: .no_wrap:
mov [device.rx_data_offset], eax mov [device.rx_data_offset], eax
@ -960,7 +961,7 @@ int_handler:
call cable call cable
.fail: .fail:
DEBUGF 2, "\n" DEBUGF 1, "\n"
pop edi esi ebx pop edi esi ebx
xor eax, eax xor eax, eax
inc eax inc eax

View File

@ -76,6 +76,11 @@ macro allocate_and_clear dest, size, err {
xor eax, eax xor eax, eax
rep stosd rep stosd
if (size - size/4*4)
mov ecx, size - size/4*4
rep stosb
end if
} }
struc IOCTL { struc IOCTL {