mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-09 02:24:45 +00:00
vbar:msi:msix: export vbar/msi/msix access checking
Change vbar/msi/msix access checking from private to public. Tracked-On: #3241 Signed-off-by: Yin Fengwei <fengwei.yin@intel.com> Acked-by: Eddie Dong <eddie.dong@intel.com>
This commit is contained in:
committed by
ACRN System Integration
parent
c2d25aafb8
commit
37de8f0b99
@@ -93,6 +93,38 @@ static inline bool has_msix_cap(const struct pci_vdev *vdev)
|
||||
return (vdev->msix.capoff != 0U);
|
||||
}
|
||||
|
||||
/**
|
||||
* @pre vdev != NULL
|
||||
*/
|
||||
static inline bool msixcap_access(const struct pci_vdev *vdev, uint32_t offset)
|
||||
{
|
||||
return (has_msix_cap(vdev) && in_range(offset, vdev->msix.capoff, vdev->msix.caplen));
|
||||
}
|
||||
|
||||
/**
|
||||
* @pre vdev != NULL
|
||||
*/
|
||||
static inline bool vbar_access(const struct pci_vdev *vdev, uint32_t offset, uint32_t bytes)
|
||||
{
|
||||
return (is_bar_offset(vdev->nr_bars, offset) && (bytes == 4U) && ((offset & 0x3U) == 0U));
|
||||
}
|
||||
|
||||
/**
|
||||
* @pre vdev != NULL
|
||||
*/
|
||||
static inline bool has_msi_cap(const struct pci_vdev *vdev)
|
||||
{
|
||||
return (vdev->msi.capoff != 0U);
|
||||
}
|
||||
|
||||
/**
|
||||
* @pre vdev != NULL
|
||||
*/
|
||||
static inline bool msicap_access(const struct pci_vdev *vdev, uint32_t offset)
|
||||
{
|
||||
return (has_msi_cap(vdev) && in_range(offset, vdev->msi.capoff, vdev->msi.caplen));
|
||||
}
|
||||
|
||||
/**
|
||||
* @pre vdev != NULL
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user