From 65f9370d760afa5d1e4016b315e7ca9f88177559 Mon Sep 17 00:00:00 2001 From: dongshen Date: Wed, 23 Jan 2019 14:26:50 -0800 Subject: [PATCH] HV: move struct pci_bar and pci_pdev to pci.h Tracked-On: #2431 Signed-off-by: dongshen Reviewed-by: Anthony Xu --- hypervisor/include/dm/pci.h | 15 +++++++++++++++ hypervisor/include/dm/vpci.h | 14 -------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/hypervisor/include/dm/pci.h b/hypervisor/include/dm/pci.h index cf6f66e38..65b60ecd5 100644 --- a/hypervisor/include/dm/pci.h +++ b/hypervisor/include/dm/pci.h @@ -138,6 +138,21 @@ enum pci_bar_type { PCIBAR_MEM64, }; +struct pci_bar { + uint64_t base; + uint64_t size; + enum pci_bar_type type; +}; + +struct pci_pdev { + /* The bar info of the physical PCI device. */ + struct pci_bar bar[PCI_BAR_COUNT]; + + /* The bus/device/function triple of the physical PCI device. */ + union pci_bdf bdf; +}; + + typedef void (*pci_enumeration_cb)(uint16_t pbdf, const void *data); static inline uint32_t pci_bar_offset(uint32_t idx) diff --git a/hypervisor/include/dm/vpci.h b/hypervisor/include/dm/vpci.h index 61b8a711c..aadd71b8b 100644 --- a/hypervisor/include/dm/vpci.h +++ b/hypervisor/include/dm/vpci.h @@ -45,26 +45,12 @@ struct pci_vdev_ops { uint32_t bytes, uint32_t *val); }; -struct pci_bar { - uint64_t base; - uint64_t size; - enum pci_bar_type type; -}; - struct msix_table_entry { uint64_t addr; uint32_t data; uint32_t vector_control; }; -struct pci_pdev { - /* The bar info of the physical PCI device. */ - struct pci_bar bar[PCI_BAR_COUNT]; - - /* The bus/device/function triple of the physical PCI device. */ - union pci_bdf bdf; -}; - /* MSI capability structure */ struct pci_msi { uint32_t capoff;