From cf602c7bf0fc4e9e183fbb2103dce1624b2bb7dc Mon Sep 17 00:00:00 2001 From: Izik Eidus Date: Thu, 25 Feb 2010 09:41:25 +0100 Subject: adding helper pci functions Signed-off-by: Izik Eidus Signed-off-by: Gerd Hoffmann Signed-off-by: Anthony Liguori --- hw/pci.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'hw/pci.h') diff --git a/hw/pci.h b/hw/pci.h index 37ebdc423c..20c670edbb 100644 --- a/hw/pci.h +++ b/hw/pci.h @@ -300,12 +300,30 @@ pci_config_set_device_id(uint8_t *pci_config, uint16_t val) pci_set_word(&pci_config[PCI_DEVICE_ID], val); } +static inline void +pci_config_set_revision(uint8_t *pci_config, uint8_t val) +{ + pci_set_byte(&pci_config[PCI_REVISION_ID], val); +} + static inline void pci_config_set_class(uint8_t *pci_config, uint16_t val) { pci_set_word(&pci_config[PCI_CLASS_DEVICE], val); } +static inline void +pci_config_set_prog_interface(uint8_t *pci_config, uint8_t val) +{ + pci_set_byte(&pci_config[PCI_CLASS_PROG], val); +} + +static inline void +pci_config_set_interrupt_pin(uint8_t *pci_config, uint8_t val) +{ + pci_set_byte(&pci_config[PCI_INTERRUPT_PIN], val); +} + typedef int (*pci_qdev_initfn)(PCIDevice *dev); typedef struct { DeviceInfo qdev; -- cgit v1.2.3