summaryrefslogtreecommitdiffstats
path: root/hw
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2010-01-29 18:15:21 +0000
committerBlue Swirl <blauwirbel@gmail.com>2010-01-29 18:15:21 +0000
commita4d5f62ceba66536da1a62d19840a7fd4be6ad9b (patch)
treefab112d84ed39dcfc6f2096bc94d98bc64ffe978 /hw
parent6c510fbf601fd8c6891b2f1d7165ceb82308a16f (diff)
downloadhqemu-a4d5f62ceba66536da1a62d19840a7fd4be6ad9b.zip
hqemu-a4d5f62ceba66536da1a62d19840a7fd4be6ad9b.tar.gz
Sparc64: byte swap IO port access
This requires an updated OpenBIOS image. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/apb_pci.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/hw/apb_pci.c b/hw/apb_pci.c
index 7f458c6..2b838ed 100644
--- a/hw/apb_pci.c
+++ b/hw/apb_pci.c
@@ -189,13 +189,13 @@ static void pci_apb_iowriteb (void *opaque, target_phys_addr_t addr,
static void pci_apb_iowritew (void *opaque, target_phys_addr_t addr,
uint32_t val)
{
- cpu_outw(addr & IOPORTS_MASK, val);
+ cpu_outw(addr & IOPORTS_MASK, bswap16(val));
}
static void pci_apb_iowritel (void *opaque, target_phys_addr_t addr,
uint32_t val)
{
- cpu_outl(addr & IOPORTS_MASK, val);
+ cpu_outl(addr & IOPORTS_MASK, bswap32(val));
}
static uint32_t pci_apb_ioreadb (void *opaque, target_phys_addr_t addr)
@@ -210,7 +210,7 @@ static uint32_t pci_apb_ioreadw (void *opaque, target_phys_addr_t addr)
{
uint32_t val;
- val = cpu_inw(addr & IOPORTS_MASK);
+ val = bswap16(cpu_inw(addr & IOPORTS_MASK));
return val;
}
@@ -218,7 +218,7 @@ static uint32_t pci_apb_ioreadl (void *opaque, target_phys_addr_t addr)
{
uint32_t val;
- val = cpu_inl(addr & IOPORTS_MASK);
+ val = bswap32(cpu_inl(addr & IOPORTS_MASK));
return val;
}
OpenPOWER on IntegriCloud