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
This commit is contained in:
parent
eb26db16d7
commit
57ccbabecb
@ -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,
|
static inline void ne2000_mem_writel(NE2000State *s, uint32_t addr,
|
||||||
uint32_t val)
|
uint32_t val)
|
||||||
{
|
{
|
||||||
addr &= ~3; /* XXX: check exact behaviour if not even */
|
addr &= ~1; /* XXX: check exact behaviour if not even */
|
||||||
if (addr < 32 ||
|
if (addr < 32 ||
|
||||||
(addr >= NE2000_PMEM_START && addr < NE2000_MEM_SIZE)) {
|
(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)
|
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 ||
|
if (addr < 32 ||
|
||||||
(addr >= NE2000_PMEM_START && addr < NE2000_MEM_SIZE)) {
|
(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 {
|
} else {
|
||||||
return 0xffffffff;
|
return 0xffffffff;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user