X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fdevices%2Fpci.h;h=d39eae387c8f409debe5e7d322052cac014b6428;hb=59b6853965a3cd4b17d0466c3650feed594cd89e;hp=003096c7a52e3e654d28db82c5b15dbc6864630d;hpb=2137016ed7c531b573ef8aef0d0d545d75a01098;p=palacios.git diff --git a/palacios/include/devices/pci.h b/palacios/include/devices/pci.h index 003096c..d39eae3 100644 --- a/palacios/include/devices/pci.h +++ b/palacios/include/devices/pci.h @@ -39,15 +39,33 @@ struct pci_device; struct v3_pci_bar { pci_bar_type_t type; - int mem_hook; - int num_pages; - int (*bar_update)(struct pci_device * pci_dev, uint_t bar); + + union { + struct { + int num_pages; + addr_t default_base_addr; + int (*mem_read)(addr_t guest_addr, void * dst, uint_t length, void * private_data); + int (*mem_write)(addr_t guest_addr, void * src, uint_t length, void * private_data); + }; + + struct { + int num_ports; + uint16_t default_base_port; + int (*io_read)(ushort_t port, void * dst, uint_t length, struct vm_device * dev); + int (*io_write)(ushort_t port, void * src, uint_t length, struct vm_device * dev); + }; + }; // Internal PCI data + uint32_t val; int updated; uint32_t mask; }; + +#define PCI_IO_BASE(bar_val) (bar_val & 0xfffffffc) +#define PCI_MEM32_BASE(bar_val) (bar_val & 0xfffffff0) + struct pci_device { union { uint8_t config_space[256];