aboutsummaryrefslogtreecommitdiff
path: root/hw/pci/pci_host.h
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-12-21 07:53:48 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-12-21 07:53:48 -0600
commitbb5801f551ee8591d576d87a9290af297998e322 (patch)
tree232402f237f940946c642c4cd6e0edcf6f94dd3f /hw/pci/pci_host.h
parent914606d26e654d4c01bd5186f4d05e3fd445e219 (diff)
parent9848a40427cd76628d04d918fa4751c542527915 (diff)
Merge remote-tracking branch 'quintela/thread-20121220.next' into staging
* quintela/thread-20121220.next: (79 commits) migration: merge QEMUFileBuffered into MigrationState migration: fix qemu_get_fd for BufferedFile ram: refactor ram_save_block() return value ram: account the amount of transferred ram better ram: optimize migration bitmap walking ram: Use memory_region_test_and_clear_dirty memory: introduce memory_region_test_and_clear_dirty ram: Add last_sent_block ram: rename last_block to last_seen_block migration: move migration notifier migration: Inline qemu_fopen_ops_buffered into migrate_fd_connect migration: move migration_fd_put_ready() migration: add XFER_LIMIT_RATIO migration: move buffered_file.c code into migration.c savevm: New save live migration method: pending buffered_file: unfold buffered_append in buffered_put_buffer buffered_file: don't flush on put buffer buffered_file: Unfold the trick to restart generating migration data migration: just lock migrate_fd_put_ready migration: remove unfreeze logic ... Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/pci/pci_host.h')
-rw-r--r--hw/pci/pci_host.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/hw/pci/pci_host.h b/hw/pci/pci_host.h
new file mode 100644
index 0000000000..1845d4dfd5
--- /dev/null
+++ b/hw/pci/pci_host.h
@@ -0,0 +1,62 @@
+/*
+ * QEMU Common PCI Host bridge configuration data space access routines.
+ *
+ * Copyright (c) 2006 Fabrice Bellard
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ */
+
+/* Worker routines for a PCI host controller that uses an {address,data}
+ register pair to access PCI configuration space. */
+
+#ifndef PCI_HOST_H
+#define PCI_HOST_H
+
+#include "hw/sysbus.h"
+
+#define TYPE_PCI_HOST_BRIDGE "pci-host-bridge"
+#define PCI_HOST_BRIDGE(obj) \
+ OBJECT_CHECK(PCIHostState, (obj), TYPE_PCI_HOST_BRIDGE)
+
+struct PCIHostState {
+ SysBusDevice busdev;
+
+ MemoryRegion conf_mem;
+ MemoryRegion data_mem;
+ MemoryRegion mmcfg;
+ MemoryRegion *address_space;
+ uint32_t config_reg;
+ PCIBus *bus;
+};
+
+/* common internal helpers for PCI/PCIe hosts, cut off overflows */
+void pci_host_config_write_common(PCIDevice *pci_dev, uint32_t addr,
+ uint32_t limit, uint32_t val, uint32_t len);
+uint32_t pci_host_config_read_common(PCIDevice *pci_dev, uint32_t addr,
+ uint32_t limit, uint32_t len);
+
+void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, int len);
+uint32_t pci_data_read(PCIBus *s, uint32_t addr, int len);
+
+extern const MemoryRegionOps pci_host_conf_le_ops;
+extern const MemoryRegionOps pci_host_conf_be_ops;
+extern const MemoryRegionOps pci_host_data_le_ops;
+extern const MemoryRegionOps pci_host_data_be_ops;
+
+#endif /* PCI_HOST_H */