diff options
author | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-06-07 20:45:42 +0000 |
---|---|---|
committer | bellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162> | 2004-06-07 20:45:42 +0000 |
commit | 57ccbabecb4101200a48bfd748a6aa33ff3c27b0 (patch) | |
tree | 28d0be7636ecfdff54dcb6b96dc47877a25fa073 | |
parent | eb26db16d77fc4f2b4c6e09b0376c3e547600fe3 (diff) |
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
-rw-r--r-- | hw/ne2000.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/ne2000.c b/hw/ne2000.c index 9a04c921da..9f35f19911 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; } |