mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 02:24:58 -06:00
hw/ide: Extract bmdma_status_writeb()
Every TYPE_PCI_IDE device performs the same not-so-trivial bit manipulation by copy'n'paste code. Extract this into bmdma_status_writeb(), mirroring bmdma_cmd_writeb(). Signed-off-by: Bernhard Beschow <shentey@gmail.com> Reviewed-by: BALATON Zoltan <balaton@eik.bme.hu> Message-Id: <20230531211043.41724-6-shentey@gmail.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
parent
bf0576edd7
commit
5fe24213f0
6 changed files with 11 additions and 7 deletions
|
@ -149,8 +149,7 @@ static void sii3112_reg_write(void *opaque, hwaddr addr,
|
|||
break;
|
||||
case 0x02:
|
||||
case 0x12:
|
||||
d->i.bmdma[0].status = (val & 0x60) | (d->i.bmdma[0].status & 1) |
|
||||
(d->i.bmdma[0].status & ~val & 6);
|
||||
bmdma_status_writeb(&d->i.bmdma[0], val);
|
||||
break;
|
||||
case 0x04 ... 0x07:
|
||||
bmdma_addr_ioport_ops.write(&d->i.bmdma[0], addr - 4, val, size);
|
||||
|
@ -165,8 +164,7 @@ static void sii3112_reg_write(void *opaque, hwaddr addr,
|
|||
break;
|
||||
case 0x0a:
|
||||
case 0x1a:
|
||||
d->i.bmdma[1].status = (val & 0x60) | (d->i.bmdma[1].status & 1) |
|
||||
(d->i.bmdma[1].status & ~val & 6);
|
||||
bmdma_status_writeb(&d->i.bmdma[1], val);
|
||||
break;
|
||||
case 0x0c ... 0x0f:
|
||||
bmdma_addr_ioport_ops.write(&d->i.bmdma[1], addr - 12, val, size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue