aboutsummaryrefslogtreecommitdiff
path: root/hw/ide.c
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-03-29 12:15:35 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-03-29 12:15:35 +0000
commit1d8cde5beb2ec5178ea08b131a97ed948d291a78 (patch)
treeef8404df557c9d014c333ca3926e8a8c372c9777 /hw/ide.c
parent6ae20372d4d27c8fca02b70a76f51d031b3e2848 (diff)
downloadqemu-1d8cde5beb2ec5178ea08b131a97ed948d291a78.zip
qemu-1d8cde5beb2ec5178ea08b131a97ed948d291a78.tar.gz
qemu-1d8cde5beb2ec5178ea08b131a97ed948d291a78.tar.bz2
IDE: Improve DMA transfers by increasing the buffer size
(Ian Jackson) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4132 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw/ide.c')
-rw-r--r--hw/ide.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/hw/ide.c b/hw/ide.c
index 25f5b9f..623abd8 100644
--- a/hw/ide.c
+++ b/hw/ide.c
@@ -202,6 +202,12 @@
/* set to 1 set disable mult support */
#define MAX_MULT_SECTORS 16
+#define IDE_DMA_BUF_SECTORS 256
+
+#if (IDE_DMA_BUF_SECTORS < MAX_MULT_SECTORS)
+#error "IDE_DMA_BUF_SECTORS must be bigger or equal to MAX_MULT_SECTORS"
+#endif
+
/* ATAPI defines */
#define ATAPI_PACKET_SIZE 12
@@ -899,8 +905,8 @@ static void ide_read_dma_cb(void *opaque, int ret)
/* launch next transfer */
n = s->nsector;
- if (n > MAX_MULT_SECTORS)
- n = MAX_MULT_SECTORS;
+ if (n > IDE_DMA_BUF_SECTORS)
+ n = IDE_DMA_BUF_SECTORS;
s->io_buffer_index = 0;
s->io_buffer_size = n * 512;
#ifdef DEBUG_AIO
@@ -998,8 +1004,8 @@ static void ide_write_dma_cb(void *opaque, int ret)
/* launch next transfer */
n = s->nsector;
- if (n > MAX_MULT_SECTORS)
- n = MAX_MULT_SECTORS;
+ if (n > IDE_DMA_BUF_SECTORS)
+ n = IDE_DMA_BUF_SECTORS;
s->io_buffer_index = 0;
s->io_buffer_size = n * 512;
@@ -1293,8 +1299,8 @@ static void ide_atapi_cmd_read_dma_cb(void *opaque, int ret)
data_offset = 16;
} else {
n = s->packet_transfer_size >> 11;
- if (n > (MAX_MULT_SECTORS / 4))
- n = (MAX_MULT_SECTORS / 4);
+ if (n > (IDE_DMA_BUF_SECTORS / 4))
+ n = (IDE_DMA_BUF_SECTORS / 4);
s->io_buffer_size = n * 2048;
data_offset = 0;
}
@@ -2524,7 +2530,7 @@ static void ide_init2(IDEState *ide_state,
for(i = 0; i < 2; i++) {
s = ide_state + i;
- s->io_buffer = qemu_memalign(512, MAX_MULT_SECTORS*512 + 4);
+ s->io_buffer = qemu_memalign(512, IDE_DMA_BUF_SECTORS*512 + 4);
if (i == 0)
s->bs = hd0;
else