PCI qdev support

Signed-off-by: Paul Brook <paul@codesourcery.com>
This commit is contained in:
Paul Brook 2009-05-14 22:35:07 +01:00
parent 4d6ae6741e
commit 6b1b92d35b
2 changed files with 56 additions and 7 deletions

View file

@ -3,6 +3,8 @@
#include "qemu-common.h"
#include "qdev.h"
/* PCI includes legacy ISA access. */
#include "isa.h"
@ -138,6 +140,7 @@ typedef struct PCIIORegion {
#define PCI_COMMAND_RESERVED_MASK_HI (PCI_COMMAND_RESERVED >> 8)
struct PCIDevice {
DeviceState qdev;
/* PCI config space */
uint8_t config[256];
@ -217,6 +220,11 @@ pci_config_set_class(uint8_t *pci_config, uint16_t val)
cpu_to_le16wu((uint16_t *)&pci_config[PCI_CLASS_DEVICE], val);
}
typedef void (*pci_qdev_initfn)(PCIDevice *dev);
void pci_qdev_register(const char *name, int size, pci_qdev_initfn init);
PCIDevice *pci_create_simple(PCIBus *bus, int devfn, const char *name);
/* lsi53c895a.c */
#define LSI_MAX_DEVS 7
void lsi_scsi_attach(void *opaque, BlockDriverState *bd, int id);