aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPaul Brook <paul@codesourcery.com>2010-06-13 23:37:31 +0100
committerPaul Brook <paul@codesourcery.com>2010-06-13 23:37:31 +0100
commit09564574b868f591fb1a9cf426f0c1d64f280431 (patch)
tree2178fd84de05d63e509d8b735110f4c49d2e4b9a /hw
parent11165820d194478d493d667a11ea8480ce893c70 (diff)
OHCI address decoding fix
Ignore high address bits when PCI memory window is not mapped on a page boundary. Signed-off-by: Paul Brook <paul@codesourcery.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/usb-ohci.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/usb-ohci.c b/hw/usb-ohci.c
index 9f80e159ad..c60fd8deef 100644
--- a/hw/usb-ohci.c
+++ b/hw/usb-ohci.c
@@ -1415,6 +1415,8 @@ static uint32_t ohci_mem_read(void *ptr, target_phys_addr_t addr)
OHCIState *ohci = ptr;
uint32_t retval;
+ addr &= 0xff;
+
/* Only aligned reads are allowed on OHCI */
if (addr & 3) {
fprintf(stderr, "usb-ohci: Mis-aligned read\n");
@@ -1538,6 +1540,8 @@ static void ohci_mem_write(void *ptr, target_phys_addr_t addr, uint32_t val)
{
OHCIState *ohci = ptr;
+ addr &= 0xff;
+
#ifdef TARGET_WORDS_BIGENDIAN
val = bswap32(val);
#endif