diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2009-08-28 16:37:42 +0200 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2009-09-04 09:37:27 -0500 |
commit | 9cdd03a791af17a1b7d3cbbaddcf46d64d704795 (patch) | |
tree | d7ef4fb1fe5e1f96706dd49edae32f20c4693a16 /hw/ide/internal.h | |
parent | f455e98cf437c7bb8f2b23888bbd302fef3a3b28 (diff) |
ide: move cmd+irq from IDEState to IDEBus.
These variables are per bus, not per drive. Lets move them and
cleanup things a bit. And fix the cmd migration bug for real.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/ide/internal.h')
-rw-r--r-- | hw/ide/internal.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/hw/ide/internal.h b/hw/ide/internal.h index 1420e253aa..b9a7c721a6 100644 --- a/hw/ide/internal.h +++ b/hw/ide/internal.h @@ -379,7 +379,6 @@ struct IDEState { int mult_sectors; int identify_set; uint16_t identify_data[256]; - qemu_irq irq; int drive_serial; char drive_serial_str[21]; /* ide regs */ @@ -399,8 +398,6 @@ struct IDEState { uint8_t select; uint8_t status; - /* 0x3f6 command, only meaningful for drive 0 */ - uint8_t cmd; /* set for lba48 access */ uint8_t lba48; BlockDriverState *bs; @@ -446,6 +443,8 @@ struct IDEBus { BMDMAState *bmdma; IDEState ifs[2]; uint8_t unit; + uint8_t cmd; + qemu_irq irq; }; #define BM_STATUS_DMAING 0x01 @@ -490,14 +489,14 @@ static inline IDEState *bmdma_active_if(BMDMAState *bmdma) return bmdma->bus->ifs + bmdma->unit; } -static inline void ide_set_irq(IDEState *s) +static inline void ide_set_irq(IDEBus *bus) { - BMDMAState *bm = s->bus->bmdma; - if (!(s->cmd & IDE_CMD_DISABLE_IRQ)) { + BMDMAState *bm = bus->bmdma; + if (!(bus->cmd & IDE_CMD_DISABLE_IRQ)) { if (bm) { bm->status |= BM_STATUS_INT; } - qemu_irq_raise(s->irq); + qemu_irq_raise(bus->irq); } } |