Re: [Qemu-devel] Updated PATCH: hw/rtl8139.c for Sparc (BigEndian) Hosts

2007-03-13 Thread Igor Kovalenko

On 3/13/07, Ben Taylor [EMAIL PROTECTED] wrote:



Patch 1: qemu-rtl8139-bigend.diff

This fixes the big-endian problem with the hw/rtl8139.c on a Sparc host.




I updated the patch to remove one extra le32 conversion found in
rtl8139_TxAddr_read
which is called from i/o read callback.

--
Kind regards,
Igor V. Kovalenko
--- hw/rtl8139.c.old	2007-03-14 00:55:03.0 +0300
+++ hw/rtl8139.c	2007-03-13 23:57:04.0 +0300
@@ -1194,7 +1194,10 @@
 s-eeprom.contents[1] = 0x10ec;
 s-eeprom.contents[2] = 0x8139;
 #endif
-memcpy(s-eeprom.contents[7], s-macaddr, 6);
+
+s-eeprom.contents[7] = s-macaddr[0] | s-macaddr[1]  8;
+s-eeprom.contents[8] = s-macaddr[2] | s-macaddr[3]  8;
+s-eeprom.contents[9] = s-macaddr[4] | s-macaddr[5]  8;
 
 /* mark all status registers as owned by host */
 for (i = 0; i  4; ++i)
@@ -2457,12 +2460,12 @@
 {
 DEBUG_PRINT((RTL8139: TxAddr write offset=0x%x val=0x%08x\n, txAddrOffset, val));
 
-s-TxAddr[txAddrOffset/4] = le32_to_cpu(val);
+s-TxAddr[txAddrOffset/4] = val;
 }
 
 static uint32_t rtl8139_TxAddr_read(RTL8139State *s, uint32_t txAddrOffset)
 {
-uint32_t ret = cpu_to_le32(s-TxAddr[txAddrOffset/4]);
+uint32_t ret = s-TxAddr[txAddrOffset/4];
 
 DEBUG_PRINT((RTL8139: TxAddr read offset=0x%x val=0x%08x\n, txAddrOffset, ret));
 
___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel


[Qemu-devel] Updated PATCH: hw/rtl8139.c for Sparc (BigEndian) Hosts

2007-03-12 Thread Ben Taylor

Apologies to the list.  I  forgot to separate out the patches in a more
appropriate manner.

Patch 1: qemu-rtl8139-bigend.diff 

This fixes the big-endian problem with the hw/rtl8139.c on a Sparc host.

Patch 2: qemu-rtl8139-impv-debug.difff

This is an improved macro for debugging.  This patch layers on the first
patch.

The above two patches were coded by  Igor Kovalenko ([EMAIL PROTECTED])

Patch 3: qemu-rtl8139-extra-debug.diff

This just adds a lot of debugging that was used to isolate the problem
with the big-endian problem, and layers on the first two patches.

Ben

qemu-rtl8139-bigend.diff
Description: Binary data


qemu-rtl8139-extra-debug.diff
Description: Binary data


qemu-rtl8139-impr-debug.diff
Description: Binary data
___
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel