From 57ccbabecb4101200a48bfd748a6aa33ff3c27b0 Mon Sep 17 00:00:00 2001 From: bellard Date: Mon, 7 Jun 2004 20:45:42 +0000 Subject: allow 32 but unaligned access (aka Win PCI network bug - initial patch by Renzo Davoli) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@909 c046a42c-6fe2-441c-8c8c-71466251a162 --- hw/ne2000.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'hw/ne2000.c') diff --git a/hw/ne2000.c b/hw/ne2000.c index 9a04c92..9f35f19 100644 --- a/hw/ne2000.c +++ b/hw/ne2000.c @@ -401,10 +401,10 @@ static inline void ne2000_mem_writew(NE2000State *s, uint32_t addr, static inline void ne2000_mem_writel(NE2000State *s, uint32_t addr, uint32_t val) { - addr &= ~3; /* XXX: check exact behaviour if not even */ + addr &= ~1; /* XXX: check exact behaviour if not even */ if (addr < 32 || (addr >= NE2000_PMEM_START && addr < NE2000_MEM_SIZE)) { - *(uint32_t *)(s->mem + addr) = cpu_to_le32(val); + cpu_to_le32wu((uint32_t *)(s->mem + addr), val); } } @@ -431,10 +431,10 @@ static inline uint32_t ne2000_mem_readw(NE2000State *s, uint32_t addr) static inline uint32_t ne2000_mem_readl(NE2000State *s, uint32_t addr) { - addr &= ~3; /* XXX: check exact behaviour if not even */ + addr &= ~1; /* XXX: check exact behaviour if not even */ if (addr < 32 || (addr >= NE2000_PMEM_START && addr < NE2000_MEM_SIZE)) { - return le32_to_cpu(*(uint32_t *)(s->mem + addr)); + return le32_to_cpupu((uint32_t *)(s->mem + addr)); } else { return 0xffffffff; } -- cgit v1.1