Commit 5a84a5dd0b6b7009cdf3d95523579addb00b66c8
1 parent
3fda388a
Fix Lance on 32-bit hosts
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3033 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
29 additions
and
6 deletions
hw/pcnet.c
... | ... | @@ -2011,16 +2011,39 @@ void pci_pcnet_init(PCIBus *bus, NICInfo *nd, int devfn) |
2011 | 2011 | |
2012 | 2012 | #if defined (TARGET_SPARC) && !defined(TARGET_SPARC64) // Avoid compile failure |
2013 | 2013 | |
2014 | +static void lance_mem_writew(void *opaque, target_phys_addr_t addr, | |
2015 | + uint32_t val) | |
2016 | +{ | |
2017 | +#ifdef PCNET_DEBUG_IO | |
2018 | + printf("lance_mem_writew addr=" TARGET_FMT_plx " val=0x%04x\n", addr, | |
2019 | + val & 0xffff); | |
2020 | +#endif | |
2021 | + pcnet_ioport_writew(opaque, addr & 7, val & 0xffff); | |
2022 | +} | |
2023 | + | |
2024 | +static uint32_t lance_mem_readw(void *opaque, target_phys_addr_t addr) | |
2025 | +{ | |
2026 | + uint32_t val; | |
2027 | + | |
2028 | + val = pcnet_ioport_readw(opaque, addr & 7); | |
2029 | +#ifdef PCNET_DEBUG_IO | |
2030 | + printf("pcnet_mmio_readw addr=" TARGET_FMT_plx " val = 0x%04x\n", addr, | |
2031 | + val & 0xffff); | |
2032 | +#endif | |
2033 | + | |
2034 | + return val & 0xffff; | |
2035 | +} | |
2036 | + | |
2014 | 2037 | static CPUReadMemoryFunc *lance_mem_read[3] = { |
2015 | - (CPUReadMemoryFunc *)&pcnet_ioport_readw, | |
2016 | - (CPUReadMemoryFunc *)&pcnet_ioport_readw, | |
2017 | - (CPUReadMemoryFunc *)&pcnet_ioport_readw, | |
2038 | + lance_mem_readw, | |
2039 | + lance_mem_readw, | |
2040 | + lance_mem_readw, | |
2018 | 2041 | }; |
2019 | 2042 | |
2020 | 2043 | static CPUWriteMemoryFunc *lance_mem_write[3] = { |
2021 | - (CPUWriteMemoryFunc *)&pcnet_ioport_writew, | |
2022 | - (CPUWriteMemoryFunc *)&pcnet_ioport_writew, | |
2023 | - (CPUWriteMemoryFunc *)&pcnet_ioport_writew, | |
2044 | + lance_mem_writew, | |
2045 | + lance_mem_writew, | |
2046 | + lance_mem_writew, | |
2024 | 2047 | }; |
2025 | 2048 | |
2026 | 2049 | void lance_init(NICInfo *nd, target_phys_addr_t leaddr, void *dma_opaque, | ... | ... |