Commit 292eef5a authored by ths's avatar ths
Browse files

Ignore special flags in nsector variable.


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2436 c046a42c-6fe2-441c-8c8c-71466251a162
parent 43523e93
...@@ -794,7 +794,7 @@ static void ide_sector_write(IDEState *s) ...@@ -794,7 +794,7 @@ static void ide_sector_write(IDEState *s)
ret = bdrv_write(s->bs, sector_num, s->io_buffer, n); ret = bdrv_write(s->bs, sector_num, s->io_buffer, n);
s->nsector -= n; s->nsector -= n;
if (s->nsector == 0) { if (s->nsector == 0) {
/* no more sector to write */ /* no more sectors to write */
ide_transfer_stop(s); ide_transfer_stop(s);
} else { } else {
n1 = s->nsector; n1 = s->nsector;
...@@ -1631,12 +1631,12 @@ static void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val) ...@@ -1631,12 +1631,12 @@ static void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val)
ide_set_irq(s); ide_set_irq(s);
break; break;
case WIN_SETMULT: case WIN_SETMULT:
if (s->nsector > MAX_MULT_SECTORS || if ((s->nsector & 0xff) > MAX_MULT_SECTORS ||
s->nsector == 0 || s->nsector == 0 ||
(s->nsector & (s->nsector - 1)) != 0) { (s->nsector & (s->nsector - 1)) != 0) {
ide_abort_command(s); ide_abort_command(s);
} else { } else {
s->mult_sectors = s->nsector; s->mult_sectors = s->nsector & 0xff;
s->status = READY_STAT; s->status = READY_STAT;
} }
ide_set_irq(s); ide_set_irq(s);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment