Commit 292eef5acb679a65c5f0fbdee65fb372263d50da

Authored by ths
1 parent 43523e93

Ignore special flags in nsector variable.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2436 c046a42c-6fe2-441c-8c8c-71466251a162
Showing 1 changed file with 3 additions and 3 deletions
hw/ide.c
... ... @@ -794,7 +794,7 @@ static void ide_sector_write(IDEState *s)
794 794 ret = bdrv_write(s->bs, sector_num, s->io_buffer, n);
795 795 s->nsector -= n;
796 796 if (s->nsector == 0) {
797   - /* no more sector to write */
  797 + /* no more sectors to write */
798 798 ide_transfer_stop(s);
799 799 } else {
800 800 n1 = s->nsector;
... ... @@ -1631,12 +1631,12 @@ static void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val)
1631 1631 ide_set_irq(s);
1632 1632 break;
1633 1633 case WIN_SETMULT:
1634   - if (s->nsector > MAX_MULT_SECTORS ||
  1634 + if ((s->nsector & 0xff) > MAX_MULT_SECTORS ||
1635 1635 s->nsector == 0 ||
1636 1636 (s->nsector & (s->nsector - 1)) != 0) {
1637 1637 ide_abort_command(s);
1638 1638 } else {
1639   - s->mult_sectors = s->nsector;
  1639 + s->mult_sectors = s->nsector & 0xff;
1640 1640 s->status = READY_STAT;
1641 1641 }
1642 1642 ide_set_irq(s);
... ...