diff options
author | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-06-28 15:28:18 +0000 |
---|---|---|
committer | blueswir1 <blueswir1@c046a42c-6fe2-441c-8c8c-71466251a162> | 2007-06-28 15:28:18 +0000 |
commit | 5a84a5dd0b6b7009cdf3d95523579addb00b66c8 (patch) | |
tree | b3226451a813e491fb45e399a9dfbb29aff7b8bc /hw | |
parent | 3fda388a1c19bef4aa8615d91693260e74564bd8 (diff) |
Fix Lance on 32-bit hosts
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3033 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r-- | hw/pcnet.c | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/hw/pcnet.c b/hw/pcnet.c index 3fffd44fb9..7f7c2de378 100644 --- a/hw/pcnet.c +++ b/hw/pcnet.c @@ -2011,16 +2011,39 @@ void pci_pcnet_init(PCIBus *bus, NICInfo *nd, int devfn) #if defined (TARGET_SPARC) && !defined(TARGET_SPARC64) // Avoid compile failure +static void lance_mem_writew(void *opaque, target_phys_addr_t addr, + uint32_t val) +{ +#ifdef PCNET_DEBUG_IO + printf("lance_mem_writew addr=" TARGET_FMT_plx " val=0x%04x\n", addr, + val & 0xffff); +#endif + pcnet_ioport_writew(opaque, addr & 7, val & 0xffff); +} + +static uint32_t lance_mem_readw(void *opaque, target_phys_addr_t addr) +{ + uint32_t val; + + val = pcnet_ioport_readw(opaque, addr & 7); +#ifdef PCNET_DEBUG_IO + printf("pcnet_mmio_readw addr=" TARGET_FMT_plx " val = 0x%04x\n", addr, + val & 0xffff); +#endif + + return val & 0xffff; +} + static CPUReadMemoryFunc *lance_mem_read[3] = { - (CPUReadMemoryFunc *)&pcnet_ioport_readw, - (CPUReadMemoryFunc *)&pcnet_ioport_readw, - (CPUReadMemoryFunc *)&pcnet_ioport_readw, + lance_mem_readw, + lance_mem_readw, + lance_mem_readw, }; static CPUWriteMemoryFunc *lance_mem_write[3] = { - (CPUWriteMemoryFunc *)&pcnet_ioport_writew, - (CPUWriteMemoryFunc *)&pcnet_ioport_writew, - (CPUWriteMemoryFunc *)&pcnet_ioport_writew, + lance_mem_writew, + lance_mem_writew, + lance_mem_writew, }; void lance_init(NICInfo *nd, target_phys_addr_t leaddr, void *dma_opaque, |