[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 03/20] pcihp: make PCI hotplug mmio handlers indiffer
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 03/20] pcihp: make PCI hotplug mmio handlers indifferent to PCI_HOTPLUG_ADDR |
Date: |
Mon, 10 Feb 2014 18:47:50 +0200 |
From: Igor Mammedov <address@hidden>
... removes dependency of mmio handler on PCI_HOTPLUG_ADDR.
It will be needed in case of Q35 where base could be different.
Signed-off-by: Igor Mammedov <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/acpi/pcihp.c | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/hw/acpi/pcihp.c b/hw/acpi/pcihp.c
index 464739a..64c8cf2 100644
--- a/hw/acpi/pcihp.c
+++ b/hw/acpi/pcihp.c
@@ -48,11 +48,11 @@
#define PCI_HOTPLUG_ADDR 0xae00
#define PCI_HOTPLUG_SIZE 0x0014
-#define PCI_UP_BASE 0xae00
-#define PCI_DOWN_BASE 0xae04
-#define PCI_EJ_BASE 0xae08
-#define PCI_RMV_BASE 0xae0c
-#define PCI_SEL_BASE 0xae10
+#define PCI_UP_BASE 0x0000
+#define PCI_DOWN_BASE 0x0004
+#define PCI_EJ_BASE 0x0008
+#define PCI_RMV_BASE 0x000c
+#define PCI_SEL_BASE 0x0010
typedef struct AcpiPciHpFind {
int bsel;
@@ -213,24 +213,24 @@ static uint64_t pci_read(void *opaque, hwaddr addr,
unsigned int size)
}
switch (addr) {
- case PCI_UP_BASE - PCI_HOTPLUG_ADDR:
+ case PCI_UP_BASE:
val = s->acpi_pcihp_pci_status[bsel].up;
s->acpi_pcihp_pci_status[bsel].up = 0;
ACPI_PCIHP_DPRINTF("pci_up_read %" PRIu32 "\n", val);
break;
- case PCI_DOWN_BASE - PCI_HOTPLUG_ADDR:
+ case PCI_DOWN_BASE:
val = s->acpi_pcihp_pci_status[bsel].down;
ACPI_PCIHP_DPRINTF("pci_down_read %" PRIu32 "\n", val);
break;
- case PCI_EJ_BASE - PCI_HOTPLUG_ADDR:
+ case PCI_EJ_BASE:
/* No feature defined yet */
ACPI_PCIHP_DPRINTF("pci_features_read %" PRIu32 "\n", val);
break;
- case PCI_RMV_BASE - PCI_HOTPLUG_ADDR:
+ case PCI_RMV_BASE:
val = s->acpi_pcihp_pci_status[bsel].hotplug_enable;
ACPI_PCIHP_DPRINTF("pci_rmv_read %" PRIu32 "\n", val);
break;
- case PCI_SEL_BASE - PCI_HOTPLUG_ADDR:
+ case PCI_SEL_BASE:
val = s->hotplug_select;
ACPI_PCIHP_DPRINTF("pci_sel_read %" PRIu32 "\n", val);
default:
@@ -245,7 +245,7 @@ static void pci_write(void *opaque, hwaddr addr, uint64_t
data,
{
AcpiPciHpState *s = opaque;
switch (addr) {
- case PCI_EJ_BASE - PCI_HOTPLUG_ADDR:
+ case PCI_EJ_BASE:
if (s->hotplug_select >= ACPI_PCIHP_MAX_HOTPLUG_BUS) {
break;
}
@@ -253,7 +253,7 @@ static void pci_write(void *opaque, hwaddr addr, uint64_t
data,
ACPI_PCIHP_DPRINTF("pciej write %" HWADDR_PRIx " <== %" PRIu64 "\n",
addr, data);
break;
- case PCI_SEL_BASE - PCI_HOTPLUG_ADDR:
+ case PCI_SEL_BASE:
s->hotplug_select = data;
ACPI_PCIHP_DPRINTF("pcisel write %" HWADDR_PRIx " <== %" PRIu64 "\n",
addr, data);
--
MST
- [Qemu-devel] [PULL 00/20] acpi,pc,pci fixes and enhancements, Michael S. Tsirkin, 2014/02/10
- [Qemu-devel] [PULL 01/20] pcihp: reduce number of device check events, Michael S. Tsirkin, 2014/02/10
- [Qemu-devel] [PULL 03/20] pcihp: make PCI hotplug mmio handlers indifferent to PCI_HOTPLUG_ADDR,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 04/20] pcihp: make pci_read() mmio calback compatible with legacy ACPI hotplug, Michael S. Tsirkin, 2014/02/10
- [Qemu-devel] [PULL 02/20] pcihp: replace enable|disable_device() with oneliners, Michael S. Tsirkin, 2014/02/10
- [Qemu-devel] [PULL 06/20] hw:piix4:acpi: reuse pcihp code for legacy PCI hotplug, Michael S. Tsirkin, 2014/02/10
- [Qemu-devel] [PULL 05/20] pcihp: remove unused AcpiPciHpPciStatus.device_present field, Michael S. Tsirkin, 2014/02/10
- [Qemu-devel] [PULL 07/20] qtest: don't report signals if qtest driver enabled, Michael S. Tsirkin, 2014/02/10
- [Qemu-devel] [PULL 08/20] pc_piix: enable legacy hotplug for Xen, Michael S. Tsirkin, 2014/02/10
- [Qemu-devel] [PULL 10/20] loader: document that errno is set, Michael S. Tsirkin, 2014/02/10
- [Qemu-devel] [PULL 09/20] pc.c: better error message on initrd sizing failure, Michael S. Tsirkin, 2014/02/10
- [Qemu-devel] [PULL 11/20] define hotplug interface, Michael S. Tsirkin, 2014/02/10
- [Qemu-devel] [PULL 12/20] qdev: add to BusState "hotplug-handler" link, Michael S. Tsirkin, 2014/02/10