aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-02-19 00:59:34 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-02-19 00:59:34 +0000
commit292eef5acb679a65c5f0fbdee65fb372263d50da (patch)
tree16567ad392dc646b72ba8358c8f1d2d4190f20e5 /hw
parent43523e9332e79a8ecbcec8444f975b8a705aa9d3 (diff)
Ignore special flags in nsector variable.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2436 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r--hw/ide.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/ide.c b/hw/ide.c
index 190f07493e..9e5451fb98 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -794,7 +794,7 @@ static void ide_sector_write(IDEState *s)
ret = bdrv_write(s->bs, sector_num, s->io_buffer, n);
s->nsector -= n;
if (s->nsector == 0) {
- /* no more sector to write */
+ /* no more sectors to write */
ide_transfer_stop(s);
} else {
n1 = s->nsector;
@@ -1631,12 +1631,12 @@ static void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val)
ide_set_irq(s);
break;
case WIN_SETMULT:
- if (s->nsector > MAX_MULT_SECTORS ||
+ if ((s->nsector & 0xff) > MAX_MULT_SECTORS ||
s->nsector == 0 ||
(s->nsector & (s->nsector - 1)) != 0) {
ide_abort_command(s);
} else {
- s->mult_sectors = s->nsector;
+ s->mult_sectors = s->nsector & 0xff;
s->status = READY_STAT;
}
ide_set_irq(s);