static void bmdma_writeb(void *opaque, uint32_t addr, uint32_t val)

{

    BMDMAState *bm = opaque;

    PCIIDEState *pci_dev = pci_from_bm(bm);

#ifdef DEBUG_IDE

    printf("bmdma: writeb 0x%02x : 0x%02x\n", addr, val);

#endif

    switch(addr & 3) {

    case 1:

        pci_dev->dev.config[MRDMODE] =

            (pci_dev->dev.config[MRDMODE] & ~0x30) | (val & 0x30);

        cmd646_update_irq(pci_dev);

        break;

    case 2:

        bm->status = (val & 0x60) | (bm->status & 1) | (bm->status & ~val & 0x06);

        break;

    case 3:

        if (bm->unit == 0)

            pci_dev->dev.config[UDIDETCR0] = val;

        else

            pci_dev->dev.config[UDIDETCR1] = val;

        break;

    }

}

static void bmdma_writeb(void *opaque, uint32_t addr, uint32_t val)

{

    BMDMAState *bm = opaque;

    PCIIDEState *pci_dev = pci_from_bm(bm);

#ifdef DEBUG_IDE

    printf("bmdma: writeb 0x%02x : 0x%02x\n", addr, val);

#endif

    switch(addr & 3) {

    case 1:

        pci_dev->dev.config[MRDMODE] =

            (pci_dev->dev.config[MRDMODE] & ~0x30) | (val & 0x30);

        cmd646_update_irq(pci_dev);

        break;

    case 2:

        bm->status = (val & 0x60) | (bm->status & 1) | (bm->status & ~val & 0x06);

        break;

    case 3:

        if (bm->unit == 0)

            pci_dev->dev.config[UDIDETCR0] = val;

        else

            pci_dev->dev.config[UDIDETCR1] = val;

        break;

    }

}

static void FUNC_0(void *VAR_0, uint32_t VAR_1, uint32_t VAR_2)

{

    BMDMAState *bm = VAR_0;

    PCIIDEState *pci_dev = pci_from_bm(bm);

#ifdef DEBUG_IDE

    printf("bmdma: writeb 0x%02x : 0x%02x\n", VAR_1, VAR_2);

#endif

    switch(VAR_1 & 3) {

    case 1:

        pci_dev->dev.config[MRDMODE] =

            (pci_dev->dev.config[MRDMODE] & ~0x30) | (VAR_2 & 0x30);

        cmd646_update_irq(pci_dev);

        break;

    case 2:

        bm->status = (VAR_2 & 0x60) | (bm->status & 1) | (bm->status & ~VAR_2 & 0x06);

        break;

    case 3:

        if (bm->unit == 0)

            pci_dev->dev.config[UDIDETCR0] = VAR_2;

        else

            pci_dev->dev.config[UDIDETCR1] = VAR_2;

        break;

    }

}

static void FUNC_0(void *VAR_0, uint32_t VAR_1, uint32_t VAR_2)
{ BMDMAState *bm = VAR_0; PCIIDEState *pci_dev = pci_from_bm(bm); #ifdef DEBUG_IDE
printf("bmdma: writeb 0x%02x : 0x%02x\n", VAR_1, VAR_2); #endif
switch(VAR_1 & 3) { case 1:
pci_dev->dev.config[MRDMODE] =
(pci_dev->dev.config[MRDMODE] & ~0x30) | (VAR_2 & 0x30); cmd646_update_irq(pci_dev); break; case 2:
bm->status = (VAR_2 & 0x60) | (bm->status & 1) | (bm->status & ~VAR_2 & 0x06); break; case 3:
if (bm->unit == 0)
pci_dev->dev.config[UDIDETCR0] = VAR_2; else
pci_dev->dev.config[UDIDETCR1] = VAR_2; break; } }