HV: add missing @pre for some functions

Add @pre for some functions, and fix outdated @pre statements

Tracked-On: #3056
Signed-off-by: dongshen <dongsheng.x.zhang@intel.com>
Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
dongshen
2019-05-14 16:35:13 -07:00
committed by ACRN System Integration
parent b957802164
commit 0018da4114
5 changed files with 66 additions and 4 deletions

View File

@@ -57,6 +57,12 @@ static inline bool msicap_access(const struct pci_vdev *vdev, uint32_t offset)
return ret;
}
/**
* @pre vdev != NULL
* @pre vdev->vpci != NULL
* @pre vdev->vpci->vm != NULL
* @pre vdev->pdev != NULL
*/
static int32_t vmsi_remap(const struct pci_vdev *vdev, bool enable)
{
struct ptirq_msi_info info;
@@ -172,6 +178,11 @@ int32_t vmsi_write_cfg(struct pci_vdev *vdev, uint32_t offset, uint32_t bytes, u
return ret;
}
/**
* @pre vdev != NULL
* @pre vdev->vpci != NULL
* @pre vdev->vpci->vm != NULL
*/
void deinit_vmsi(const struct pci_vdev *vdev)
{
if (has_msi_cap(vdev)) {
@@ -194,6 +205,10 @@ static void buf_write32(uint8_t buf[], uint32_t val)
buf[3] = (uint8_t)((val >> 24U) & 0xFFU);
}
/**
* @pre vdev != NULL
* @pre vdev->pdev != NULL
*/
void init_vmsi(struct pci_vdev *vdev)
{
struct pci_pdev *pdev = vdev->pdev;