From 290a0933c0488a5072bed5458b1b9fe4dc84cba4 Mon Sep 17 00:00:00 2001 From: ths Date: Mon, 19 Mar 2007 18:20:28 +0000 Subject: [PATCH] Fix big endian host operation, by Ben Taylor and Igor Kovalenko. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2509 c046a42c-6fe2-441c-8c8c-71466251a162 --- hw/rtl8139.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/hw/rtl8139.c b/hw/rtl8139.c index 94fc2fc..6ca275a 100644 --- a/hw/rtl8139.c +++ b/hw/rtl8139.c @@ -1192,7 +1192,10 @@ static void rtl8139_reset(RTL8139State *s) 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) @@ -2455,12 +2458,12 @@ static void rtl8139_TxAddr_write(RTL8139State *s, uint32_t txAddrOffset, uint32_ { 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)); -- 2.7.4