summaryrefslogtreecommitdiff
path: root/hw/ide.c
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-04-23 22:21:30 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2006-04-23 22:21:30 +0000
commite774a278d82c9391c9fb6c9af42cd08bb9364b9f (patch)
tree3e75c2c66c4b67fb91dbc7b526c426756dd5f63d /hw/ide.c
parentfa7cf687ac84f2cecdedec86fa4d5297c2415db0 (diff)
downloadqemu-e774a278d82c9391c9fb6c9af42cd08bb9364b9f.tar.gz
qemu-e774a278d82c9391c9fb6c9af42cd08bb9364b9f.tar.bz2
qemu-e774a278d82c9391c9fb6c9af42cd08bb9364b9f.zip
-win2k-hack performance+DMA support (Leonardo E. Reiter)
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1841 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/ide.c')
-rw-r--r--hw/ide.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/hw/ide.c b/hw/ide.c
index cf9a9a7bb2..decf345829 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -336,6 +336,7 @@ typedef struct IDEState {
uint8_t *data_end;
uint8_t io_buffer[MAX_MULT_SECTORS*512 + 4];
QEMUTimer *sector_write_timer; /* only used for win2k instal hack */
+ uint32_t irq_count; /* counts IRQs when using win2k install hack */
} IDEState;
#define BM_STATUS_DMAING 0x01
@@ -712,7 +713,7 @@ static void ide_sector_write(IDEState *s)
ide_set_sector(s, sector_num + n);
#ifdef TARGET_I386
- if (win2k_install_hack) {
+ if (win2k_install_hack && ((++s->irq_count % 16) == 0)) {
/* It seems there is a bug in the Windows 2000 installer HDD
IDE driver which fills the disk with empty logs when the
IDE write IRQ comes too early. This hack tries to correct
@@ -750,7 +751,19 @@ static int ide_write_dma_cb(IDEState *s,
if (n == 0) {
/* end of transfer */
s->status = READY_STAT | SEEK_STAT;
- ide_set_irq(s);
+#ifdef TARGET_I386
+ if (win2k_install_hack && ((++s->irq_count % 16) == 0)) {
+ /* It seems there is a bug in the Windows 2000 installer
+ HDD IDE driver which fills the disk with empty logs
+ when the IDE write IRQ comes too early. This hack tries
+ to correct that at the expense of slower write
+ performances. Use this option _only_ to install Windows
+ 2000. You must disable it for normal use. */
+ qemu_mod_timer(s->sector_write_timer,
+ qemu_get_clock(vm_clock) + (ticks_per_sec / 1000));
+ } else
+#endif
+ ide_set_irq(s);
return 0;
}
if (n > MAX_MULT_SECTORS)