summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Brook2009-05-22 18:44:32 +0200
committerPaul Brook2009-05-22 18:44:32 +0200
commit4856fcff8af1ba349baaf063af00f5e5d87a99f4 (patch)
treed6d2e9b3c73c63cdf5963c79e7b4613f6e9a854f
parentAvoid errors when curl-config does not exist (diff)
downloadqemu-4856fcff8af1ba349baaf063af00f5e5d87a99f4.tar.gz
qemu-4856fcff8af1ba349baaf063af00f5e5d87a99f4.tar.xz
qemu-4856fcff8af1ba349baaf063af00f5e5d87a99f4.zip
Fix lance segfaults
Signed-off-by: Paul Brook <paul@codesourcery.com>
-rw-r--r--hw/pcnet.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/hw/pcnet.c b/hw/pcnet.c
index 1f8e04b5e8..2c22f4a508 100644
--- a/hw/pcnet.c
+++ b/hw/pcnet.c
@@ -2068,25 +2068,28 @@ static void pci_pcnet_init(PCIDevice *pci_dev)
static void parent_lance_reset(void *opaque, int irq, int level)
{
+ SysBusPCNetState *d = opaque;
if (level)
- pcnet_h_reset(opaque);
+ pcnet_h_reset(&d->state);
}
static void lance_mem_writew(void *opaque, target_phys_addr_t addr,
uint32_t val)
{
+ SysBusPCNetState *d = opaque;
#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, val & 0xffff);
+ pcnet_ioport_writew(&d->state, addr, val & 0xffff);
}
static uint32_t lance_mem_readw(void *opaque, target_phys_addr_t addr)
{
+ SysBusPCNetState *d = opaque;
uint32_t val;
- val = pcnet_ioport_readw(opaque, addr);
+ val = pcnet_ioport_readw(&d->state, addr);
#ifdef PCNET_DEBUG_IO
printf("lance_mem_readw addr=" TARGET_FMT_plx " val = 0x%04x\n", addr,
val & 0xffff);