From 6a2df080e479f65705c8f2d5fc55d7030974ca29 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Mon, 10 Jun 2013 17:32:49 +0000 Subject: [PATCH] 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 --- drivers/ethernet/RTL8139.asm | 5 +++-- drivers/netdrv.inc | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/ethernet/RTL8139.asm b/drivers/ethernet/RTL8139.asm index 7b4d298be1..df1cb5637f 100644 --- a/drivers/ethernet/RTL8139.asm +++ b/drivers/ethernet/RTL8139.asm @@ -211,6 +211,7 @@ virtual at ebx .irq_line db ? .hw_ver_id db ? + db ? ; align 4 .TX_DESC rd NUM_TX_DESC .size = $ - device @@ -821,7 +822,7 @@ int_handler: cmp eax, RX_BUFFER_SIZE jb .no_wrap - DEBUGF 2, "Wrapping" + DEBUGF 1, "Wrapping" sub eax, RX_BUFFER_SIZE .no_wrap: mov [device.rx_data_offset], eax @@ -960,7 +961,7 @@ int_handler: call cable .fail: - DEBUGF 2, "\n" + DEBUGF 1, "\n" pop edi esi ebx xor eax, eax inc eax diff --git a/drivers/netdrv.inc b/drivers/netdrv.inc index d074c1b5b9..222bf1ebe1 100644 --- a/drivers/netdrv.inc +++ b/drivers/netdrv.inc @@ -76,6 +76,11 @@ macro allocate_and_clear dest, size, err { xor eax, eax rep stosd + if (size - size/4*4) + mov ecx, size - size/4*4 + rep stosb + end if + } struc IOCTL {