Skip to content

Commit 93f6142

Browse files
donshengwenlingz
authored andcommitted
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>
1 parent 562628b commit 93f6142

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

hypervisor/dm/vpci/msi.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#include <vpci.h>
3535
#include "pci_priv.h"
3636

37-
static int32_t vmsi_init(struct pci_vdev *vdev);
3837

3938
static inline bool msicap_access(const struct pci_vdev *vdev, uint32_t offset)
4039
{
@@ -107,7 +106,7 @@ static int32_t vmsi_remap(const struct pci_vdev *vdev, bool enable)
107106
return ret;
108107
}
109108

110-
static int32_t vmsi_cfgread(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val)
109+
int32_t vmsi_cfgread(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val)
111110
{
112111
int32_t ret;
113112
/* 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
121120
return ret;
122121
}
123122

124-
static int32_t vmsi_cfgwrite(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val)
123+
int32_t vmsi_cfgwrite(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val)
125124
{
126125
bool message_changed = false;
127126
bool enable;
@@ -159,7 +158,7 @@ static int32_t vmsi_cfgwrite(struct pci_vdev *vdev, uint32_t offset, uint32_t by
159158
return ret;
160159
}
161160

162-
static int32_t vmsi_deinit(struct pci_vdev *vdev)
161+
int32_t vmsi_deinit(struct pci_vdev *vdev)
163162
{
164163
if (vdev->msi.capoff != 0U) {
165164
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)
190189
buf[3] = (uint8_t)((val >> 24U) & 0xFFU);
191190
}
192191

193-
static int32_t vmsi_init(struct pci_vdev *vdev)
192+
int32_t vmsi_init(struct pci_vdev *vdev)
194193
{
195194
struct pci_pdev *pdev = vdev->pdev;
196195
uint32_t val;

hypervisor/dm/vpci/msix.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static int32_t vmsix_remap_one_entry(const struct pci_vdev *vdev, uint32_t index
156156
return ret;
157157
}
158158

159-
static int32_t vmsix_cfgread(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val)
159+
int32_t vmsix_cfgread(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val)
160160
{
161161
int32_t ret;
162162
/* 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
171171
return ret;
172172
}
173173

174-
static int32_t vmsix_cfgwrite(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val)
174+
int32_t vmsix_cfgwrite(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val)
175175
{
176176
uint32_t msgctrl;
177177
int32_t ret;
@@ -383,7 +383,7 @@ static int32_t vmsix_init_helper(struct pci_vdev *vdev)
383383
return ret;
384384
}
385385

386-
static int32_t vmsix_init(struct pci_vdev *vdev)
386+
int32_t vmsix_init(struct pci_vdev *vdev)
387387
{
388388
struct pci_pdev *pdev = vdev->pdev;
389389
int32_t ret = 0;
@@ -401,7 +401,7 @@ static int32_t vmsix_init(struct pci_vdev *vdev)
401401
return ret;
402402
}
403403

404-
static int32_t vmsix_deinit(struct pci_vdev *vdev)
404+
int32_t vmsix_deinit(struct pci_vdev *vdev)
405405
{
406406
vdev->msix.intercepted_size = 0U;
407407

hypervisor/dm/vpci/pci_priv.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,16 @@ extern const struct vpci_ops partition_mode_vpci_ops;
7373
extern const struct vpci_ops sharing_mode_vpci_ops;
7474
extern const struct pci_vdev_ops pci_ops_vdev_msi;
7575
extern const struct pci_vdev_ops pci_ops_vdev_msix;
76+
77+
int32_t vmsi_init(struct pci_vdev *vdev);
78+
int32_t vmsi_cfgread(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val);
79+
int32_t vmsi_cfgwrite(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val);
80+
int32_t vmsi_deinit(struct pci_vdev *vdev);
81+
82+
int32_t vmsix_init(struct pci_vdev *vdev);
83+
int32_t vmsix_cfgread(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t *val);
84+
int32_t vmsix_cfgwrite(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, uint32_t val);
85+
int32_t vmsix_deinit(struct pci_vdev *vdev);
7686
#endif
7787

7888
uint32_t pci_vdev_read_cfg(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes);

0 commit comments

Comments
 (0)