diff options
author | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-03-29 12:15:35 +0000 |
---|---|---|
committer | aurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162> | 2008-03-29 12:15:35 +0000 |
commit | 1d8cde5beb2ec5178ea08b131a97ed948d291a78 (patch) | |
tree | ef8404df557c9d014c333ca3926e8a8c372c9777 /hw/ide.c | |
parent | 6ae20372d4d27c8fca02b70a76f51d031b3e2848 (diff) | |
download | qemu-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.c | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -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 |