@@ -53,11 +53,20 @@ static inline bool msixcap_access(const struct pci_vdev *vdev, uint32_t offset)
53
53
return ret ;
54
54
}
55
55
56
+ /**
57
+ * @pre vdev != NULL
58
+ */
56
59
static inline bool msixtable_access (const struct pci_vdev * vdev , uint32_t offset )
57
60
{
58
61
return in_range (offset , vdev -> msix .table_offset , vdev -> msix .table_count * MSIX_TABLE_ENTRY_SIZE );
59
62
}
60
63
64
+ /**
65
+ * @pre vdev != NULL
66
+ * @pre vdev->vpci != NULL
67
+ * @pre vdev->vpci->vm != NULL
68
+ * @pre vdev->pdev != NULL
69
+ */
61
70
static int32_t vmsix_remap_entry (const struct pci_vdev * vdev , uint32_t index , bool enable )
62
71
{
63
72
struct msix_table_entry * pentry ;
@@ -92,6 +101,10 @@ static int32_t vmsix_remap_entry(const struct pci_vdev *vdev, uint32_t index, bo
92
101
return ret ;
93
102
}
94
103
104
+ /**
105
+ * @pre vdev != NULL
106
+ * @pre vdev->pdev != NULL
107
+ */
95
108
static inline void enable_disable_msix (const struct pci_vdev * vdev , bool enable )
96
109
{
97
110
uint32_t msgctrl ;
@@ -105,7 +118,11 @@ static inline void enable_disable_msix(const struct pci_vdev *vdev, bool enable)
105
118
pci_pdev_write_cfg (vdev -> pdev -> bdf , vdev -> msix .capoff + PCIR_MSIX_CTRL , 2U , msgctrl );
106
119
}
107
120
108
- /* Do MSI-X remap for all MSI-X table entries in the target device */
121
+ /**
122
+ * Do MSI-X remap for all MSI-X table entries in the target device
123
+ * @pre vdev != NULL
124
+ * @pre vdev->pdev != NULL
125
+ */
109
126
static int32_t vmsix_remap (const struct pci_vdev * vdev , bool enable )
110
127
{
111
128
uint32_t index ;
@@ -132,7 +149,11 @@ static int32_t vmsix_remap(const struct pci_vdev *vdev, bool enable)
132
149
return ret ;
133
150
}
134
151
135
- /* Do MSI-X remap for one MSI-X table entry only */
152
+ /**
153
+ * Do MSI-X remap for one MSI-X table entry only
154
+ * @pre vdev != NULL
155
+ * @pre vdev->pdev != NULL
156
+ */
136
157
static int32_t vmsix_remap_one_entry (const struct pci_vdev * vdev , uint32_t index , bool enable )
137
158
{
138
159
uint32_t msgctrl ;
@@ -336,6 +357,7 @@ int32_t vmsix_table_mmio_access_handler(struct io_request *io_req, void *handler
336
357
337
358
/**
338
359
* @pre vdev != NULL
360
+ * @pre vdev->pdev != NULL
339
361
*/
340
362
void init_vmsix (struct pci_vdev * vdev )
341
363
{
0 commit comments