diff options
author | Izik Eidus <ieidus@redhat.com> | 2010-02-25 09:41:25 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2010-03-08 11:30:09 -0600 |
commit | cf602c7bf0fc4e9e183fbb2103dce1624b2bb7dc (patch) | |
tree | 0907b48ea470207a6d15af2f7467c9c8e76245ef | |
parent | 80cd34787fc0fc31b1a341c7b8d8e729c1b6ea58 (diff) |
adding helper pci functions
Signed-off-by: Izik Eidus <ieidus@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
-rw-r--r-- | hw/pci.h | 18 |
1 files changed, 18 insertions, 0 deletions
@@ -301,11 +301,29 @@ pci_config_set_device_id(uint8_t *pci_config, uint16_t 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; |