[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 16/16] PPC: Fix openpic with relative memregions
From: |
Alexander Graf |
Subject: |
[Qemu-ppc] [PATCH 16/16] PPC: Fix openpic with relative memregions |
Date: |
Thu, 15 Mar 2012 13:14:22 +0100 |
After commit 5312bd8b3152 we got memory region relative offsets into our mmio
callbacks instead of page boundary based offsets.
This broke the OpenPIC emulation which expected offsets to be on page boundary
and substracted its region offset manually.
This patch gets rid of that manual substraction and lets the memory api do its
magic instead.
Signed-off-by: Alexander Graf <address@hidden>
---
hw/openpic.c | 12 ++----------
1 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/hw/openpic.c b/hw/openpic.c
index 280b7a9..58ef871 100644
--- a/hw/openpic.c
+++ b/hw/openpic.c
@@ -713,7 +713,7 @@ static void openpic_timer_write (void *opaque, uint32_t
addr, uint32_t val)
DPRINTF("%s: addr %08x <= %08x\n", __func__, addr, val);
if (addr & 0xF)
return;
- addr -= 0x1100;
+ addr -= 0x10;
addr &= 0xFFFF;
idx = (addr & 0xFFF0) >> 6;
addr = addr & 0x30;
@@ -746,7 +746,7 @@ static uint32_t openpic_timer_read (void *opaque, uint32_t
addr)
retval = 0xFFFFFFFF;
if (addr & 0xF)
return retval;
- addr -= 0x1100;
+ addr -= 0x10;
addr &= 0xFFFF;
idx = (addr & 0xFFF0) >> 6;
addr = addr & 0x30;
@@ -1361,7 +1361,6 @@ static void mpic_src_ext_write (void *opaque,
target_phys_addr_t addr,
if (addr & 0xF)
return;
- addr -= MPIC_EXT_REG_START & (OPENPIC_PAGE_SIZE - 1);
if (addr < MPIC_EXT_REG_SIZE) {
idx += (addr & 0xFFF0) >> 5;
if (addr & 0x10) {
@@ -1385,7 +1384,6 @@ static uint32_t mpic_src_ext_read (void *opaque,
target_phys_addr_t addr)
if (addr & 0xF)
return retval;
- addr -= MPIC_EXT_REG_START & (OPENPIC_PAGE_SIZE - 1);
if (addr < MPIC_EXT_REG_SIZE) {
idx += (addr & 0xFFF0) >> 5;
if (addr & 0x10) {
@@ -1411,7 +1409,6 @@ static void mpic_src_int_write (void *opaque,
target_phys_addr_t addr,
if (addr & 0xF)
return;
- addr -= MPIC_INT_REG_START & (OPENPIC_PAGE_SIZE - 1);
if (addr < MPIC_INT_REG_SIZE) {
idx += (addr & 0xFFF0) >> 5;
if (addr & 0x10) {
@@ -1435,7 +1432,6 @@ static uint32_t mpic_src_int_read (void *opaque,
target_phys_addr_t addr)
if (addr & 0xF)
return retval;
- addr -= MPIC_INT_REG_START & (OPENPIC_PAGE_SIZE - 1);
if (addr < MPIC_INT_REG_SIZE) {
idx += (addr & 0xFFF0) >> 5;
if (addr & 0x10) {
@@ -1461,7 +1457,6 @@ static void mpic_src_msg_write (void *opaque,
target_phys_addr_t addr,
if (addr & 0xF)
return;
- addr -= MPIC_MSG_REG_START & (OPENPIC_PAGE_SIZE - 1);
if (addr < MPIC_MSG_REG_SIZE) {
idx += (addr & 0xFFF0) >> 5;
if (addr & 0x10) {
@@ -1485,7 +1480,6 @@ static uint32_t mpic_src_msg_read (void *opaque,
target_phys_addr_t addr)
if (addr & 0xF)
return retval;
- addr -= MPIC_MSG_REG_START & (OPENPIC_PAGE_SIZE - 1);
if (addr < MPIC_MSG_REG_SIZE) {
idx += (addr & 0xFFF0) >> 5;
if (addr & 0x10) {
@@ -1511,7 +1505,6 @@ static void mpic_src_msi_write (void *opaque,
target_phys_addr_t addr,
if (addr & 0xF)
return;
- addr -= MPIC_MSI_REG_START & (OPENPIC_PAGE_SIZE - 1);
if (addr < MPIC_MSI_REG_SIZE) {
idx += (addr & 0xFFF0) >> 5;
if (addr & 0x10) {
@@ -1534,7 +1527,6 @@ static uint32_t mpic_src_msi_read (void *opaque,
target_phys_addr_t addr)
if (addr & 0xF)
return retval;
- addr -= MPIC_MSI_REG_START & (OPENPIC_PAGE_SIZE - 1);
if (addr < MPIC_MSI_REG_SIZE) {
idx += (addr & 0xFFF0) >> 5;
if (addr & 0x10) {
--
1.6.0.2
- [Qemu-ppc] [PULL 00/16] ppc patch queue 2012-03-15, Alexander Graf, 2012/03/15
- [Qemu-ppc] [PATCH 01/16] Bad zero comparison for sas_ss_flags on powerpc, Alexander Graf, 2012/03/15
- [Qemu-ppc] [PATCH 03/16] ppc: Add missing 'static' to spin_rw_ops, Alexander Graf, 2012/03/15
- [Qemu-ppc] [PATCH 02/16] PPC: 405: Fix ppc405ep initialization, Alexander Graf, 2012/03/15
- [Qemu-ppc] [PATCH 13/16] kvm: Comparison with ioctl number macros needs to be unsigned, Alexander Graf, 2012/03/15
- [Qemu-ppc] [PATCH 15/16] pseries: Configure PCI bridge using properties, Alexander Graf, 2012/03/15
- [Qemu-ppc] [PATCH 08/16] pseries: Remove PCI device from PCI host bridge code, Alexander Graf, 2012/03/15
- [Qemu-ppc] [PATCH 16/16] PPC: Fix openpic with relative memregions,
Alexander Graf <=
- [Qemu-ppc] [PATCH 09/16] PPC: Add PIR register to POWER7 CPU, Alexander Graf, 2012/03/15
- [Qemu-ppc] [PATCH 12/16] ppc: Correctly define POWERPC_INSNS2_DEFAULT, Alexander Graf, 2012/03/15
- [Qemu-ppc] [PATCH 11/16] pseries: Add support for level interrupts to XICS, Alexander Graf, 2012/03/15
- [Qemu-ppc] [PATCH 04/16] pseries: Don't try to munmap() a malloc()ed TCE table, Alexander Graf, 2012/03/15
- [Qemu-ppc] [PATCH 05/16] PPC64: Add support for ldbrx and stdbrx instructions, Alexander Graf, 2012/03/15
- [Qemu-ppc] [PATCH 06/16] pseries: Update SLOF firmware image, Alexander Graf, 2012/03/15
- [Qemu-ppc] [PATCH 07/16] pseries: Remove unused constant from PCI code, Alexander Graf, 2012/03/15
- [Qemu-ppc] [PATCH 14/16] PPC: KVM: Synchronize regs on CPU dump, Alexander Graf, 2012/03/15
- [Qemu-ppc] [PATCH 10/16] PPC: Fix large page support in TCG, Alexander Graf, 2012/03/15
- Re: [Qemu-ppc] [PULL 00/16] ppc patch queue 2012-03-15, Blue Swirl, 2012/03/17