From: Isaku Yamahata Date: Fri, 30 Oct 2009 12:20:59 +0000 (+0900) Subject: pci: helper functions to access PCIDevice::config X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=fb5ce7d289f8e34c6f8a025e55e0d96e9a496cd9;p=qemu.git 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 Acked-by: Michael S. Tsirkin Signed-off-by: Anthony Liguori --- diff --git a/hw/pci.h b/hw/pci.h index bab9caba98..157995c96d 100644 --- a/hw/pci.h +++ b/hw/pci.h @@ -311,6 +311,18 @@ pci_get_long(uint8_t *config) return le32_to_cpupu((uint32_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) {