hv: implement sharing_mode.c for PCI emulation in sharing mode

Compared with partition_mode.c, the major difference between them is
the list of PCI devices is statically defined or dynamically
enumerated and allocated.

Tracked-On: #1568
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Signed-off-by: Zide Chen <zide.chen@intel.com>
Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
Zide Chen
2018-10-09 10:24:05 -07:00
committed by lijinxia
parent 7c506ebc69
commit 83dbfe4fd3
5 changed files with 223 additions and 0 deletions

View File

@@ -85,7 +85,14 @@ struct msix {
};
struct pci_vdev {
#ifndef CONFIG_PARTITION_MODE
#define MAX_VPCI_DEV_OPS 4U
struct pci_vdev_ops ops[MAX_VPCI_DEV_OPS];
uint32_t nr_ops;
#else
struct pci_vdev_ops *ops;
#endif
struct vpci *vpci;
/* The bus/device/function triple of the virtual PCI device. */
union pci_bdf vbdf;