提交 cf602c7b 编写于 作者: I Izik Eidus 提交者: Anthony Liguori

adding helper pci functions

Signed-off-by: NIzik Eidus <ieidus@redhat.com>
Signed-off-by: NGerd Hoffmann <kraxel@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 80cd3478
...@@ -300,12 +300,30 @@ pci_config_set_device_id(uint8_t *pci_config, uint16_t val) ...@@ -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); 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 static inline void
pci_config_set_class(uint8_t *pci_config, uint16_t val) pci_config_set_class(uint8_t *pci_config, uint16_t val)
{ {
pci_set_word(&pci_config[PCI_CLASS_DEVICE], 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 int (*pci_qdev_initfn)(PCIDevice *dev);
typedef struct { typedef struct {
DeviceInfo qdev; DeviceInfo qdev;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册