Revision 502a5395 vl.h

b/vl.h
593 593

  
594 594
#define PCI_ROM_SLOT 6
595 595
#define PCI_NUM_REGIONS 7
596

  
597
#define PCI_DEVICES_MAX 64
598

  
599
#define PCI_VENDOR_ID		0x00	/* 16 bits */
600
#define PCI_DEVICE_ID		0x02	/* 16 bits */
601
#define PCI_COMMAND		0x04	/* 16 bits */
602
#define  PCI_COMMAND_IO		0x1	/* Enable response in I/O space */
603
#define  PCI_COMMAND_MEMORY	0x2	/* Enable response in Memory space */
604
#define PCI_CLASS_DEVICE        0x0a    /* Device class */
605
#define PCI_INTERRUPT_LINE	0x3c	/* 8 bits */
606
#define PCI_INTERRUPT_PIN	0x3d	/* 8 bits */
607
#define PCI_MIN_GNT		0x3e	/* 8 bits */
608
#define PCI_MAX_LAT		0x3f	/* 8 bits */
609

  
596 610
struct PCIDevice {
597 611
    /* PCI config space */
598 612
    uint8_t config[256];
......
606 620
    /* do not access the following fields */
607 621
    PCIConfigReadFunc *config_read;
608 622
    PCIConfigWriteFunc *config_write;
623
    /* ??? This is a PC-specific hack, and should be removed.  */
609 624
    int irq_index;
610 625
};
611 626

  
......
627 642
void generic_pci_save(QEMUFile* f, void *opaque);
628 643
int generic_pci_load(QEMUFile* f, void *opaque, int version_id);
629 644

  
630
extern struct PIIX3State *piix3_state;
645
typedef void (*pci_set_irq_fn)(PCIDevice *pci_dev, void *pic,
646
                               int irq_num, int level);
647
PCIBus *pci_register_bus(pci_set_irq_fn set_irq, void *pic, int devfn_min);
648

  
649
void pci_nic_init(PCIBus *bus, NICInfo *nd);
650
void pci_data_write(void *opaque, uint32_t addr, uint32_t val, int len);
651
uint32_t pci_data_read(void *opaque, uint32_t addr, int len);
652
int pci_bus_num(PCIBus *s);
653
void pci_for_each_device(void (*fn)(PCIDevice *d));
631 654

  
632
PCIBus *i440fx_init(void);
633
void piix3_init(PCIBus *bus);
634
void pci_bios_init(void);
635 655
void pci_info(void);
636 656

  
637
/* temporary: will be moved in platform specific file */
638
void pci_set_pic(PCIBus *bus, SetIRQFunc *set_irq, void *irq_opaque);
657
/* prep_pci.c */
639 658
PCIBus *pci_prep_init(void);
640
PCIBus *pci_grackle_init(uint32_t base);
641
PCIBus *pci_pmac_init(void);
642
PCIBus *pci_apb_init(target_ulong special_base, target_ulong mem_base);
643 659

  
644
void pci_nic_init(PCIBus *bus, NICInfo *nd);
660
/* grackle_pci.c */
661
PCIBus *pci_grackle_init(uint32_t base, void *pic);
662

  
663
/* unin_pci.c */
664
PCIBus *pci_pmac_init(void *pic);
665

  
666
/* apb_pci.c */
667
PCIBus *pci_apb_init(target_ulong special_base, target_ulong mem_base,
668
                     void *pic);
669

  
670
PCIBus *pci_vpb_init(void *pic);
671

  
672
/* piix_pci.c */
673
PCIBus *i440fx_init(void);
674
int piix3_init(PCIBus *bus);
675
void pci_bios_init(void);
645 676

  
646 677
/* openpic.c */
647 678
typedef struct openpic_t openpic_t;
......
726 757
                  BlockDriverState *hd0, BlockDriverState *hd1);
727 758
void pci_cmd646_ide_init(PCIBus *bus, BlockDriverState **hd_table,
728 759
                         int secondary_ide_enabled);
729
void pci_piix3_ide_init(PCIBus *bus, BlockDriverState **hd_table);
760
void pci_piix3_ide_init(PCIBus *bus, BlockDriverState **hd_table, int devfn);
730 761
int pmac_ide_init (BlockDriverState **hd_table,
731 762
                   SetIRQFunc *set_irq, void *irq_opaque, int irq);
732 763

  
......
843 874

  
844 875
/* acpi.c */
845 876
extern int acpi_enabled;
846
void piix4_pm_init(PCIBus *bus);
877
void piix4_pm_init(PCIBus *bus, int devfn);
847 878
void acpi_bios_init(void);
848 879

  
849 880
/* pc.c */

Also available in: Unified diff