Skip to content

Commit aa1ee94

Browse files
donshengEddie Dong
authored andcommitted
HV: declare and export vpci ops functions as global instead of static local
In preparation for vpci ops function removal, so that these functions can be called directly instead by vpci code Tracked-On: #2534 Signed-off-by: dongshen <dongsheng.x.zhang@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
1 parent a7f528c commit aa1ee94

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed

hypervisor/dm/vpci/partition_mode.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ static void partition_mode_pdev_init(struct pci_vdev *vdev, union pci_bdf pbdf)
9191
* @pre vm != NULL
9292
* @pre vm->vpci.pci_vdev_cnt <= CONFIG_MAX_PCI_DEV_NUM
9393
*/
94-
static int32_t partition_mode_vpci_init(const struct acrn_vm *vm)
94+
int32_t partition_mode_vpci_init(const struct acrn_vm *vm)
9595
{
9696
struct acrn_vpci *vpci = (struct acrn_vpci *)&(vm->vpci);
9797
struct pci_vdev *vdev;
@@ -121,7 +121,7 @@ static int32_t partition_mode_vpci_init(const struct acrn_vm *vm)
121121
* @pre vm != NULL
122122
* @pre vm->vpci.pci_vdev_cnt <= CONFIG_MAX_PCI_DEV_NUM
123123
*/
124-
static void partition_mode_vpci_deinit(const struct acrn_vm *vm)
124+
void partition_mode_vpci_deinit(const struct acrn_vm *vm)
125125
{
126126
struct pci_vdev *vdev;
127127
uint32_t i;
@@ -137,7 +137,7 @@ static void partition_mode_vpci_deinit(const struct acrn_vm *vm)
137137
}
138138
}
139139

140-
static void partition_mode_cfgread(struct acrn_vpci *vpci, union pci_bdf vbdf,
140+
void partition_mode_cfgread(struct acrn_vpci *vpci, union pci_bdf vbdf,
141141
uint32_t offset, uint32_t bytes, uint32_t *val)
142142
{
143143
struct pci_vdev *vdev = pci_find_vdev_by_vbdf(vpci, vbdf);
@@ -155,7 +155,7 @@ static void partition_mode_cfgread(struct acrn_vpci *vpci, union pci_bdf vbdf,
155155
}
156156
}
157157

158-
static void partition_mode_cfgwrite(struct acrn_vpci *vpci, union pci_bdf vbdf,
158+
void partition_mode_cfgwrite(struct acrn_vpci *vpci, union pci_bdf vbdf,
159159
uint32_t offset, uint32_t bytes, uint32_t val)
160160
{
161161
struct pci_vdev *vdev = pci_find_vdev_by_vbdf(vpci, vbdf);

hypervisor/dm/vpci/sharing_mode.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ static struct pci_vdev *sharing_mode_find_vdev_sos(union pci_bdf pbdf)
4242
return pci_find_vdev_by_pbdf(&vm->vpci, pbdf);
4343
}
4444

45-
static void sharing_mode_cfgread(__unused struct acrn_vpci *vpci, union pci_bdf bdf,
45+
void sharing_mode_cfgread(__unused struct acrn_vpci *vpci, union pci_bdf bdf,
4646
uint32_t offset, uint32_t bytes, uint32_t *val)
4747
{
4848
struct pci_vdev *vdev;
@@ -62,7 +62,7 @@ static void sharing_mode_cfgread(__unused struct acrn_vpci *vpci, union pci_bdf
6262
}
6363
}
6464

65-
static void sharing_mode_cfgwrite(__unused struct acrn_vpci *vpci, union pci_bdf bdf,
65+
void sharing_mode_cfgwrite(__unused struct acrn_vpci *vpci, union pci_bdf bdf,
6666
uint32_t offset, uint32_t bytes, uint32_t val)
6767
{
6868
struct pci_vdev *vdev;
@@ -105,7 +105,7 @@ static void init_vdev_for_pdev(struct pci_pdev *pdev, const void *vm)
105105
}
106106
}
107107

108-
static int32_t sharing_mode_vpci_init(const struct acrn_vm *vm)
108+
int32_t sharing_mode_vpci_init(const struct acrn_vm *vm)
109109
{
110110
int32_t ret = -ENODEV;
111111

@@ -126,7 +126,7 @@ static int32_t sharing_mode_vpci_init(const struct acrn_vm *vm)
126126
* @pre vm != NULL
127127
* @pre vm->vpci.pci_vdev_cnt <= CONFIG_MAX_PCI_DEV_NUM
128128
*/
129-
static void sharing_mode_vpci_deinit(const struct acrn_vm *vm)
129+
void sharing_mode_vpci_deinit(const struct acrn_vm *vm)
130130
{
131131
struct pci_vdev *vdev;
132132
uint32_t i;

hypervisor/include/dm/vpci.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,20 @@ struct acrn_vpci {
105105
struct pci_vdev pci_vdevs[CONFIG_MAX_PCI_DEV_NUM];
106106
};
107107

108+
int32_t partition_mode_vpci_init(const struct acrn_vm *vm);
109+
void partition_mode_cfgread(struct acrn_vpci *vpci, union pci_bdf vbdf,
110+
uint32_t offset, uint32_t bytes, uint32_t *val);
111+
void partition_mode_cfgwrite(struct acrn_vpci *vpci, union pci_bdf vbdf,
112+
uint32_t offset, uint32_t bytes, uint32_t val);
113+
void partition_mode_vpci_deinit(const struct acrn_vm *vm);
114+
115+
int32_t sharing_mode_vpci_init(const struct acrn_vm *vm);
116+
void sharing_mode_cfgread(struct acrn_vpci *vpci, union pci_bdf bdf,
117+
uint32_t offset, uint32_t bytes, uint32_t *val);
118+
void sharing_mode_cfgwrite(__unused struct acrn_vpci *vpci, union pci_bdf bdf,
119+
uint32_t offset, uint32_t bytes, uint32_t val);
120+
void sharing_mode_vpci_deinit(const struct acrn_vm *vm);
121+
108122
void vpci_init(struct acrn_vm *vm);
109123
void vpci_cleanup(const struct acrn_vm *vm);
110124
void vpci_set_ptdev_intr_info(const struct acrn_vm *target_vm, uint16_t vbdf, uint16_t pbdf);

0 commit comments

Comments
 (0)