aboutsummaryrefslogtreecommitdiff
path: root/hw/pci.h
diff options
context:
space:
mode:
authorIsaku Yamahata <yamahata@valinux.co.jp>2009-10-30 21:20:59 +0900
committerAnthony Liguori <aliguori@us.ibm.com>2009-11-09 08:43:04 -0600
commitfb5ce7d289f8e34c6f8a025e55e0d96e9a496cd9 (patch)
tree70f51cb25e5af642b60523de9df2ea0c865258c8 /hw/pci.h
parent182f9c8a64d530d992df35a1a4b17a562c7d1aef (diff)
downloadqemu-fb5ce7d289f8e34c6f8a025e55e0d96e9a496cd9.zip
qemu-fb5ce7d289f8e34c6f8a025e55e0d96e9a496cd9.tar.gz
qemu-fb5ce7d289f8e34c6f8a025e55e0d96e9a496cd9.tar.bz2
pci: helper functions to access PCIDevice::config
add helper functions to get/set PCIDevice::config Those will be used later. Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/pci.h')
-rw-r--r--hw/pci.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/hw/pci.h b/hw/pci.h
index bab9cab..157995c 100644
--- a/hw/pci.h
+++ b/hw/pci.h
@@ -312,6 +312,18 @@ pci_get_long(uint8_t *config)
}
static inline void
+pci_set_quad(uint8_t *config, uint64_t val)
+{
+ cpu_to_le64w((uint64_t *)config, val);
+}
+
+static inline uint64_t
+pci_get_quad(uint8_t *config)
+{
+ return le64_to_cpup((uint64_t *)config);
+}
+
+static inline void
pci_config_set_vendor_id(uint8_t *pci_config, uint16_t val)
{
pci_set_word(&pci_config[PCI_VENDOR_ID], val);