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

@@ -37,31 +37,49 @@ static inline bool in_range(uint32_t value, uint32_t lower, uint32_t len)
return ((value >= lower) && (value < (lower + len)));
}
/**
* @pre vdev != NULL
*/
static inline uint8_t pci_vdev_read_cfg_u8(const struct pci_vdev *vdev, uint32_t offset)
{
return vdev->cfgdata.data_8[offset];
}
/**
* @pre vdev != NULL
*/
static inline uint16_t pci_vdev_read_cfg_u16(const struct pci_vdev *vdev, uint32_t offset)
{
return vdev->cfgdata.data_16[offset >> 1U];
}
/**
* @pre vdev != NULL
*/
static inline uint32_t pci_vdev_read_cfg_u32(const struct pci_vdev *vdev, uint32_t offset)
{
return vdev->cfgdata.data_32[offset >> 2U];
}
/**
* @pre vdev != NULL
*/
static inline void pci_vdev_write_cfg_u8(struct pci_vdev *vdev, uint32_t offset, uint8_t val)
{
vdev->cfgdata.data_8[offset] = val;
}
/**
* @pre vdev != NULL
*/
static inline void pci_vdev_write_cfg_u16(struct pci_vdev *vdev, uint32_t offset, uint16_t val)
{
vdev->cfgdata.data_16[offset >> 1U] = val;
}
/**
* @pre vdev != NULL
*/
static inline void pci_vdev_write_cfg_u32(struct pci_vdev *vdev, uint32_t offset, uint32_t val)
{
vdev->cfgdata.data_32[offset >> 2U] = val;