diff options
author | Yang Zhang <yang.z.zhang@intel.com> | 2015-08-28 09:58:54 +0800 |
---|---|---|
committer | Yang Zhang <yang.z.zhang@intel.com> | 2015-09-01 12:44:00 +0800 |
commit | e44e3482bdb4d0ebde2d8b41830ac2cdb07948fb (patch) | |
tree | 66b09f592c55df2878107a468a91d21506104d3f /qemu/roms/openbios/drivers/pci_database.h | |
parent | 9ca8dbcc65cfc63d6f5ef3312a33184e1d726e00 (diff) |
Add qemu 2.4.0
Change-Id: Ic99cbad4b61f8b127b7dc74d04576c0bcbaaf4f5
Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
Diffstat (limited to 'qemu/roms/openbios/drivers/pci_database.h')
-rw-r--r-- | qemu/roms/openbios/drivers/pci_database.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/qemu/roms/openbios/drivers/pci_database.h b/qemu/roms/openbios/drivers/pci_database.h new file mode 100644 index 000000000..7f053d808 --- /dev/null +++ b/qemu/roms/openbios/drivers/pci_database.h @@ -0,0 +1,57 @@ +typedef struct pci_config_t pci_config_t; + +struct pci_config_t { + char path[256]; + uint32_t dev; /* bus, dev, fn */ + uint32_t regions[7]; + uint32_t assigned[7]; + uint32_t sizes[7]; + int irq_pin; + int irq_line; + u32 primary_bus; + u32 secondary_bus; + u32 subordinate_bus; +}; + +typedef struct pci_dev_t pci_dev_t; +struct pci_dev_t { + uint16_t vendor; + uint16_t product; + const char *type; + const char *name; + const char *model; + const char *compat; + int acells; + int scells; + int icells; + int (*config_cb)(const pci_config_t *config); + const void *private; +}; + +extern int ide_config_cb2(const pci_config_t *config); +extern int eth_config_cb(const pci_config_t *config); +extern int macio_heathrow_config_cb(const pci_config_t *config); +extern int macio_keylargo_config_cb(const pci_config_t *config); +extern int vga_config_cb(const pci_config_t *config); +extern int host_config_cb(const pci_config_t *config); +extern int sabre_config_cb(const pci_config_t *config); +extern int bridge_config_cb(const pci_config_t *config); +extern int ebus_config_cb(const pci_config_t *config); +extern int i82378_config_cb(const pci_config_t *config); +extern int usb_ohci_config_cb(const pci_config_t *config); + +static inline int pci_compat_len(const pci_dev_t *dev) +{ + int len, ret; + const char *path = dev->compat; + ret = 0; + while ((len = strlen(path)) != 0) { + ret += len + 1; + path += len + 1; + } + return ret; +} + +extern const pci_dev_t *pci_find_device(uint8_t class, uint8_t subclass, + uint8_t iface, uint16_t vendor, + uint16_t product); |