isa bridge endianness fixes

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@761 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
bellard 2004-04-25 22:10:09 +00:00
parent 0c4ad8dc2a
commit f658b4db79

View File

@ -137,7 +137,6 @@ static uint32_t PPC_io_readb (target_phys_addr_t addr)
{ {
PPC_IO_DPRINTF("0x%08x <= 0x%02x\n", addr - PPC_IO_BASE, ret); PPC_IO_DPRINTF("0x%08x <= 0x%02x\n", addr - PPC_IO_BASE, ret);
} }
return ret; return ret;
} }
@ -147,24 +146,31 @@ static void PPC_io_writew (target_phys_addr_t addr, uint32_t value)
(addr < 0x80000170 || addr > 0x80000177)) { (addr < 0x80000170 || addr > 0x80000177)) {
PPC_IO_DPRINTF("0x%08x => 0x%04x\n", addr - PPC_IO_BASE, value); PPC_IO_DPRINTF("0x%08x => 0x%04x\n", addr - PPC_IO_BASE, value);
} }
#ifdef TARGET_WORDS_BIGENDIAN
value = bswap16(value);
#endif
cpu_outw(NULL, addr - PPC_IO_BASE, value); cpu_outw(NULL, addr - PPC_IO_BASE, value);
} }
static uint32_t PPC_io_readw (target_phys_addr_t addr) static uint32_t PPC_io_readw (target_phys_addr_t addr)
{ {
uint32_t ret = cpu_inw(NULL, addr - PPC_IO_BASE); uint32_t ret = cpu_inw(NULL, addr - PPC_IO_BASE);
#ifdef TARGET_WORDS_BIGENDIAN
ret = bswap16(ret);
#endif
if ((addr < 0x800001f0 || addr > 0x800001f7) && if ((addr < 0x800001f0 || addr > 0x800001f7) &&
(addr < 0x80000170 || addr > 0x80000177)) { (addr < 0x80000170 || addr > 0x80000177)) {
PPC_IO_DPRINTF("0x%08x <= 0x%04x\n", addr - PPC_IO_BASE, ret); PPC_IO_DPRINTF("0x%08x <= 0x%04x\n", addr - PPC_IO_BASE, ret);
} }
return ret; return ret;
} }
static void PPC_io_writel (target_phys_addr_t addr, uint32_t value) static void PPC_io_writel (target_phys_addr_t addr, uint32_t value)
{ {
PPC_IO_DPRINTF("0x%08x => 0x%08x\n", addr - PPC_IO_BASE, value); PPC_IO_DPRINTF("0x%08x => 0x%08x\n", addr - PPC_IO_BASE, value);
#ifdef TARGET_WORDS_BIGENDIAN
value = bswap32(value);
#endif
cpu_outl(NULL, addr - PPC_IO_BASE, value); cpu_outl(NULL, addr - PPC_IO_BASE, value);
} }
@ -172,8 +178,10 @@ static uint32_t PPC_io_readl (target_phys_addr_t addr)
{ {
uint32_t ret = cpu_inl(NULL, addr - PPC_IO_BASE); uint32_t ret = cpu_inl(NULL, addr - PPC_IO_BASE);
#ifdef TARGET_WORDS_BIGENDIAN
ret = bswap32(ret);
#endif
PPC_IO_DPRINTF("0x%08x <= 0x%08x\n", addr - PPC_IO_BASE, ret); PPC_IO_DPRINTF("0x%08x <= 0x%08x\n", addr - PPC_IO_BASE, ret);
return ret; return ret;
} }