mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-10 12:32:45 +00:00
HV: declare and export sharing mode's vdev functions as global instead of static local
Export the following functions as global instead of static so that they can be called/referred outside of the files where they are declared: vmsi_init vmsi_cfgread vmsi_cfgwrite vmsi_deinit vmsix_init vmsix_cfgread vmsix_cfgwrite vmsix_deinit This is in preparation for removal of the sharing modes vdev ops, and call them directly instead. Tracked-On: #2534 Signed-off-by: dongshen <dongsheng.x.zhang@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
parent
562628b99e
commit
93f6142d14
@ -34,7 +34,6 @@
|
|||||||
#include <vpci.h>
|
#include <vpci.h>
|
||||||
#include "pci_priv.h"
|
#include "pci_priv.h"
|
||||||
|
|
||||||
static int32_t vmsi_init(struct pci_vdev *vdev);
|
|
||||||
|
|
||||||
static inline bool msicap_access(const struct pci_vdev *vdev, uint32_t offset)
|
static inline bool msicap_access(const struct pci_vdev *vdev, uint32_t offset)
|
||||||
{
|
{
|
||||||
@ -107,7 +106,7 @@ static int32_t vmsi_remap(const struct pci_vdev *vdev, bool enable)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t vmsi_cfgread(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val)
|
int32_t vmsi_cfgread(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val)
|
||||||
{
|
{
|
||||||
int32_t ret;
|
int32_t ret;
|
||||||
/* For PIO access, we emulate Capability Structures only */
|
/* For PIO access, we emulate Capability Structures only */
|
||||||
@ -121,7 +120,7 @@ static int32_t vmsi_cfgread(const struct pci_vdev *vdev, uint32_t offset, uint32
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t vmsi_cfgwrite(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val)
|
int32_t vmsi_cfgwrite(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val)
|
||||||
{
|
{
|
||||||
bool message_changed = false;
|
bool message_changed = false;
|
||||||
bool enable;
|
bool enable;
|
||||||
@ -159,7 +158,7 @@ static int32_t vmsi_cfgwrite(struct pci_vdev *vdev, uint32_t offset, uint32_t by
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t vmsi_deinit(struct pci_vdev *vdev)
|
int32_t vmsi_deinit(struct pci_vdev *vdev)
|
||||||
{
|
{
|
||||||
if (vdev->msi.capoff != 0U) {
|
if (vdev->msi.capoff != 0U) {
|
||||||
ptirq_remove_msix_remapping(vdev->vpci->vm, vdev->vbdf.value, 1U);
|
ptirq_remove_msix_remapping(vdev->vpci->vm, vdev->vbdf.value, 1U);
|
||||||
@ -190,7 +189,7 @@ static void buf_write32(uint8_t buf[], uint32_t val)
|
|||||||
buf[3] = (uint8_t)((val >> 24U) & 0xFFU);
|
buf[3] = (uint8_t)((val >> 24U) & 0xFFU);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t vmsi_init(struct pci_vdev *vdev)
|
int32_t vmsi_init(struct pci_vdev *vdev)
|
||||||
{
|
{
|
||||||
struct pci_pdev *pdev = vdev->pdev;
|
struct pci_pdev *pdev = vdev->pdev;
|
||||||
uint32_t val;
|
uint32_t val;
|
||||||
|
@ -156,7 +156,7 @@ static int32_t vmsix_remap_one_entry(const struct pci_vdev *vdev, uint32_t index
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t vmsix_cfgread(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val)
|
int32_t vmsix_cfgread(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val)
|
||||||
{
|
{
|
||||||
int32_t ret;
|
int32_t ret;
|
||||||
/* For PIO access, we emulate Capability Structures only */
|
/* For PIO access, we emulate Capability Structures only */
|
||||||
@ -171,7 +171,7 @@ static int32_t vmsix_cfgread(const struct pci_vdev *vdev, uint32_t offset, uint3
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t vmsix_cfgwrite(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val)
|
int32_t vmsix_cfgwrite(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val)
|
||||||
{
|
{
|
||||||
uint32_t msgctrl;
|
uint32_t msgctrl;
|
||||||
int32_t ret;
|
int32_t ret;
|
||||||
@ -383,7 +383,7 @@ static int32_t vmsix_init_helper(struct pci_vdev *vdev)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t vmsix_init(struct pci_vdev *vdev)
|
int32_t vmsix_init(struct pci_vdev *vdev)
|
||||||
{
|
{
|
||||||
struct pci_pdev *pdev = vdev->pdev;
|
struct pci_pdev *pdev = vdev->pdev;
|
||||||
int32_t ret = 0;
|
int32_t ret = 0;
|
||||||
@ -401,7 +401,7 @@ static int32_t vmsix_init(struct pci_vdev *vdev)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t vmsix_deinit(struct pci_vdev *vdev)
|
int32_t vmsix_deinit(struct pci_vdev *vdev)
|
||||||
{
|
{
|
||||||
vdev->msix.intercepted_size = 0U;
|
vdev->msix.intercepted_size = 0U;
|
||||||
|
|
||||||
|
@ -73,6 +73,16 @@ extern const struct vpci_ops partition_mode_vpci_ops;
|
|||||||
extern const struct vpci_ops sharing_mode_vpci_ops;
|
extern const struct vpci_ops sharing_mode_vpci_ops;
|
||||||
extern const struct pci_vdev_ops pci_ops_vdev_msi;
|
extern const struct pci_vdev_ops pci_ops_vdev_msi;
|
||||||
extern const struct pci_vdev_ops pci_ops_vdev_msix;
|
extern const struct pci_vdev_ops pci_ops_vdev_msix;
|
||||||
|
|
||||||
|
int32_t vmsi_init(struct pci_vdev *vdev);
|
||||||
|
int32_t vmsi_cfgread(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val);
|
||||||
|
int32_t vmsi_cfgwrite(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val);
|
||||||
|
int32_t vmsi_deinit(struct pci_vdev *vdev);
|
||||||
|
|
||||||
|
int32_t vmsix_init(struct pci_vdev *vdev);
|
||||||
|
int32_t vmsix_cfgread(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val);
|
||||||
|
int32_t vmsix_cfgwrite(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val);
|
||||||
|
int32_t vmsix_deinit(struct pci_vdev *vdev);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
uint32_t pci_vdev_read_cfg(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes);
|
uint32_t pci_vdev_read_cfg(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes);
|
||||||
|
Loading…
Reference in New Issue
Block a user