Revision dfe1ea8f
b/hw/ide/core.c | ||
---|---|---|
1694 | 1694 |
void ide_exec_cmd(IDEBus *bus, uint32_t val) |
1695 | 1695 |
{ |
1696 | 1696 |
IDEState *s; |
1697 |
bool complete; |
|
1697 | 1698 |
|
1698 | 1699 |
#if defined(DEBUG_IDE) |
1699 | 1700 |
printf("ide: CMD=%02x\n", val); |
... | ... | |
1708 | 1709 |
return; |
1709 | 1710 |
|
1710 | 1711 |
if (!ide_cmd_permitted(s, val)) { |
1711 |
goto abort_cmd; |
|
1712 |
ide_abort_command(s); |
|
1713 |
ide_set_irq(s->bus); |
|
1714 |
return; |
|
1712 | 1715 |
} |
1713 | 1716 |
|
1714 |
if (ide_cmd_table[val].handler != NULL) { |
|
1715 |
bool complete; |
|
1716 |
|
|
1717 |
s->status = READY_STAT | BUSY_STAT; |
|
1718 |
s->error = 0; |
|
1719 |
|
|
1720 |
complete = ide_cmd_table[val].handler(s, val); |
|
1721 |
if (complete) { |
|
1722 |
s->status &= ~BUSY_STAT; |
|
1723 |
assert(!!s->error == !!(s->status & ERR_STAT)); |
|
1717 |
s->status = READY_STAT | BUSY_STAT; |
|
1718 |
s->error = 0; |
|
1724 | 1719 |
|
1725 |
if ((ide_cmd_table[val].flags & SET_DSC) && !s->error) { |
|
1726 |
s->status |= SEEK_STAT; |
|
1727 |
} |
|
1720 |
complete = ide_cmd_table[val].handler(s, val); |
|
1721 |
if (complete) { |
|
1722 |
s->status &= ~BUSY_STAT; |
|
1723 |
assert(!!s->error == !!(s->status & ERR_STAT)); |
|
1728 | 1724 |
|
1729 |
ide_set_irq(s->bus); |
|
1725 |
if ((ide_cmd_table[val].flags & SET_DSC) && !s->error) { |
|
1726 |
s->status |= SEEK_STAT; |
|
1730 | 1727 |
} |
1731 | 1728 |
|
1732 |
return; |
|
1733 |
} |
|
1734 |
|
|
1735 |
switch(val) { |
|
1736 |
default: |
|
1737 |
/* should not be reachable */ |
|
1738 |
abort_cmd: |
|
1739 |
ide_abort_command(s); |
|
1740 | 1729 |
ide_set_irq(s->bus); |
1741 |
break; |
|
1742 | 1730 |
} |
1743 | 1731 |
} |
1744 | 1732 |
|
Also available in: Unified diff