diff --git a/hypervisor/dm/vpci/hostbridge.c b/hypervisor/dm/vpci/hostbridge.c index c03702eb6..e0030543b 100644 --- a/hypervisor/dm/vpci/hostbridge.c +++ b/hypervisor/dm/vpci/hostbridge.c @@ -39,7 +39,7 @@ #include #include "pci_priv.h" -static int32_t vdev_hostbridge_init(struct pci_vdev *vdev) +int32_t vdev_hostbridge_init(struct pci_vdev *vdev) { /* PCI config space */ pci_vdev_write_cfg_u16(vdev, PCIR_VENDOR, (uint16_t)0x8086U); @@ -86,12 +86,12 @@ static int32_t vdev_hostbridge_init(struct pci_vdev *vdev) return 0; } -static int32_t vdev_hostbridge_deinit(__unused struct pci_vdev *vdev) +int32_t vdev_hostbridge_deinit(__unused struct pci_vdev *vdev) { return 0; } -static int32_t vdev_hostbridge_cfgread(const struct pci_vdev *vdev, uint32_t offset, +int32_t vdev_hostbridge_cfgread(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val) { /* Assumption: access needed to be aligned on 1/2/4 bytes */ @@ -105,7 +105,7 @@ static int32_t vdev_hostbridge_cfgread(const struct pci_vdev *vdev, uint32_t off return 0; } -static int32_t vdev_hostbridge_cfgwrite(struct pci_vdev *vdev, uint32_t offset, +int32_t vdev_hostbridge_cfgwrite(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val) { /* Assumption: access needed to be aligned on 1/2/4 bytes */ diff --git a/hypervisor/dm/vpci/pci_priv.h b/hypervisor/dm/vpci/pci_priv.h index b1236078b..29ecb0c22 100644 --- a/hypervisor/dm/vpci/pci_priv.h +++ b/hypervisor/dm/vpci/pci_priv.h @@ -69,6 +69,16 @@ static inline void pci_vdev_write_cfg_u32(struct pci_vdev *vdev, uint32_t offset #ifdef CONFIG_PARTITION_MODE extern const struct vpci_ops partition_mode_vpci_ops; +int32_t vdev_hostbridge_init(struct pci_vdev *vdev); +int32_t vdev_hostbridge_cfgread(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val); +int32_t vdev_hostbridge_cfgwrite(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val); +int32_t vdev_hostbridge_deinit(__unused struct pci_vdev *vdev); + +int32_t vdev_pt_init(struct pci_vdev *vdev); +int32_t vdev_pt_cfgread(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val); +int32_t vdev_pt_cfgwrite(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val); +int32_t vdev_pt_deinit(struct pci_vdev *vdev); + #else extern const struct vpci_ops sharing_mode_vpci_ops; extern const struct pci_vdev_ops pci_ops_vdev_msi; diff --git a/hypervisor/dm/vpci/pci_pt.c b/hypervisor/dm/vpci/pci_pt.c index eb4905f67..809fa9d31 100644 --- a/hypervisor/dm/vpci/pci_pt.c +++ b/hypervisor/dm/vpci/pci_pt.c @@ -58,7 +58,7 @@ static int32_t vdev_pt_init_validate(struct pci_vdev *vdev) return 0; } -static int32_t vdev_pt_init(struct pci_vdev *vdev) +int32_t vdev_pt_init(struct pci_vdev *vdev) { int32_t ret; struct acrn_vm *vm = vdev->vpci->vm; @@ -91,7 +91,7 @@ static int32_t vdev_pt_init(struct pci_vdev *vdev) return ret; } -static int32_t vdev_pt_deinit(struct pci_vdev *vdev) +int32_t vdev_pt_deinit(struct pci_vdev *vdev) { int32_t ret; struct acrn_vm *vm = vdev->vpci->vm; @@ -102,7 +102,7 @@ static int32_t vdev_pt_deinit(struct pci_vdev *vdev) return ret; } -static int32_t vdev_pt_cfgread(const struct pci_vdev *vdev, uint32_t offset, +int32_t vdev_pt_cfgread(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val) { /* Assumption: access needed to be aligned on 1/2/4 bytes */ @@ -181,7 +181,7 @@ static void vdev_pt_cfgwrite_bar(struct pci_vdev *vdev, uint32_t offset, pci_vdev_write_cfg_u32(vdev, offset, new_bar); } -static int32_t vdev_pt_cfgwrite(struct pci_vdev *vdev, uint32_t offset, +int32_t vdev_pt_cfgwrite(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val) { /* Assumption: access needed to be aligned on 1/2/4 bytes */