diff options
author | Blue Swirl <blauwirbel@gmail.com> | 2010-03-29 19:23:57 +0000 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2010-03-29 19:23:57 +0000 |
commit | 02c7c992f0036bca8f1256e8a1f0d80a81e173f0 (patch) | |
tree | 86b99319d8d6eb7ded47589ae4f64c3c646c301b /hw/ide/macio.c | |
parent | 3d08ff698b938613699682b5c5432547a7ebe898 (diff) |
Compile ide/macio only once
Replace TARGET_PAGE_SIZE with 4096. Make byte swapping unconditional
since PPC is big endian.
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/ide/macio.c')
-rw-r--r-- | hw/ide/macio.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/hw/ide/macio.c b/hw/ide/macio.c index d1bdb4967f..639f3f6a65 100644 --- a/hw/ide/macio.c +++ b/hw/ide/macio.c @@ -40,6 +40,8 @@ typedef struct MACIOIDEState { BlockDriverAIOCB *aiocb; } MACIOIDEState; +#define MACIO_PAGE_SIZE 4096 + static void pmac_ide_atapi_transfer_cb(void *opaque, int ret) { DBDMA_io *io = opaque; @@ -77,7 +79,7 @@ static void pmac_ide_atapi_transfer_cb(void *opaque, int ret) s->io_buffer_size = io->len; - qemu_sglist_init(&s->sg, io->len / TARGET_PAGE_SIZE + 1); + qemu_sglist_init(&s->sg, io->len / MACIO_PAGE_SIZE + 1); qemu_sglist_add(&s->sg, io->addr, io->len); io->addr += io->len; io->len = 0; @@ -139,7 +141,7 @@ static void pmac_ide_transfer_cb(void *opaque, int ret) s->io_buffer_index = 0; s->io_buffer_size = io->len; - qemu_sglist_init(&s->sg, io->len / TARGET_PAGE_SIZE + 1); + qemu_sglist_init(&s->sg, io->len / MACIO_PAGE_SIZE + 1); qemu_sglist_add(&s->sg, io->addr, io->len); io->addr += io->len; io->len = 0; @@ -223,9 +225,7 @@ static void pmac_ide_writew (void *opaque, MACIOIDEState *d = opaque; addr = (addr & 0xFFF) >> 4; -#ifdef TARGET_WORDS_BIGENDIAN val = bswap16(val); -#endif if (addr == 0) { ide_data_writew(&d->bus, 0, val); } @@ -242,9 +242,7 @@ static uint32_t pmac_ide_readw (void *opaque,target_phys_addr_t addr) } else { retval = 0xFFFF; } -#ifdef TARGET_WORDS_BIGENDIAN retval = bswap16(retval); -#endif return retval; } @@ -254,9 +252,7 @@ static void pmac_ide_writel (void *opaque, MACIOIDEState *d = opaque; addr = (addr & 0xFFF) >> 4; -#ifdef TARGET_WORDS_BIGENDIAN val = bswap32(val); -#endif if (addr == 0) { ide_data_writel(&d->bus, 0, val); } @@ -273,9 +269,7 @@ static uint32_t pmac_ide_readl (void *opaque,target_phys_addr_t addr) } else { retval = 0xFFFFFFFF; } -#ifdef TARGET_WORDS_BIGENDIAN retval = bswap32(retval); -#endif return retval; } |