mirror of https://github.com/xqemu/xqemu.git
Fix lance segfaults
Signed-off-by: Paul Brook <paul@codesourcery.com>
This commit is contained in:
parent
523685522b
commit
4856fcff8a
|
@ -2068,25 +2068,28 @@ static void pci_pcnet_init(PCIDevice *pci_dev)
|
||||||
|
|
||||||
static void parent_lance_reset(void *opaque, int irq, int level)
|
static void parent_lance_reset(void *opaque, int irq, int level)
|
||||||
{
|
{
|
||||||
|
SysBusPCNetState *d = opaque;
|
||||||
if (level)
|
if (level)
|
||||||
pcnet_h_reset(opaque);
|
pcnet_h_reset(&d->state);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void lance_mem_writew(void *opaque, target_phys_addr_t addr,
|
static void lance_mem_writew(void *opaque, target_phys_addr_t addr,
|
||||||
uint32_t val)
|
uint32_t val)
|
||||||
{
|
{
|
||||||
|
SysBusPCNetState *d = opaque;
|
||||||
#ifdef PCNET_DEBUG_IO
|
#ifdef PCNET_DEBUG_IO
|
||||||
printf("lance_mem_writew addr=" TARGET_FMT_plx " val=0x%04x\n", addr,
|
printf("lance_mem_writew addr=" TARGET_FMT_plx " val=0x%04x\n", addr,
|
||||||
val & 0xffff);
|
val & 0xffff);
|
||||||
#endif
|
#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)
|
static uint32_t lance_mem_readw(void *opaque, target_phys_addr_t addr)
|
||||||
{
|
{
|
||||||
|
SysBusPCNetState *d = opaque;
|
||||||
uint32_t val;
|
uint32_t val;
|
||||||
|
|
||||||
val = pcnet_ioport_readw(opaque, addr);
|
val = pcnet_ioport_readw(&d->state, addr);
|
||||||
#ifdef PCNET_DEBUG_IO
|
#ifdef PCNET_DEBUG_IO
|
||||||
printf("lance_mem_readw addr=" TARGET_FMT_plx " val = 0x%04x\n", addr,
|
printf("lance_mem_readw addr=" TARGET_FMT_plx " val = 0x%04x\n", addr,
|
||||||
val & 0xffff);
|
val & 0xffff);
|
||||||
|
|
Loading…
Reference in New Issue