提交 a4d5f62c 编写于 作者: B Blue Swirl

Sparc64: byte swap IO port access

This requires an updated OpenBIOS image.
Signed-off-by: NBlue Swirl <blauwirbel@gmail.com>
上级 6c510fbf
...@@ -189,13 +189,13 @@ static void pci_apb_iowriteb (void *opaque, target_phys_addr_t addr, ...@@ -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, static void pci_apb_iowritew (void *opaque, target_phys_addr_t addr,
uint32_t val) 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, static void pci_apb_iowritel (void *opaque, target_phys_addr_t addr,
uint32_t val) 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) 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) ...@@ -210,7 +210,7 @@ static uint32_t pci_apb_ioreadw (void *opaque, target_phys_addr_t addr)
{ {
uint32_t val; uint32_t val;
val = cpu_inw(addr & IOPORTS_MASK); val = bswap16(cpu_inw(addr & IOPORTS_MASK));
return val; return val;
} }
...@@ -218,7 +218,7 @@ static uint32_t pci_apb_ioreadl (void *opaque, target_phys_addr_t addr) ...@@ -218,7 +218,7 @@ static uint32_t pci_apb_ioreadl (void *opaque, target_phys_addr_t addr)
{ {
uint32_t val; uint32_t val;
val = cpu_inl(addr & IOPORTS_MASK); val = bswap32(cpu_inl(addr & IOPORTS_MASK));
return val; return val;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册