mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13:54 -06:00
pcie: Helper functions to check to check if PRI is enabled
pri_enabled can be used to check whether the capability is present and enabled on a PCIe device Signed-off-by: Clement Mathieu--Drif <clement.mathieu--drif@eviden.com> Message-Id: <20250520071823.764266-6-clement.mathieu--drif@eviden.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
dcad6cb2ab
commit
5be8cf7918
2 changed files with 10 additions and 0 deletions
|
@ -1266,6 +1266,15 @@ void pcie_pri_init(PCIDevice *dev, uint16_t offset, uint32_t outstanding_pr_cap,
|
|||
dev->exp.pri_cap = offset;
|
||||
}
|
||||
|
||||
bool pcie_pri_enabled(const PCIDevice *dev)
|
||||
{
|
||||
if (!pci_is_express(dev) || !dev->exp.pri_cap) {
|
||||
return false;
|
||||
}
|
||||
return (pci_get_word(dev->config + dev->exp.pri_cap + PCI_PRI_CTRL) &
|
||||
PCI_PRI_CTRL_ENABLE) != 0;
|
||||
}
|
||||
|
||||
bool pcie_pasid_enabled(const PCIDevice *dev)
|
||||
{
|
||||
if (!pci_is_express(dev) || !dev->exp.pasid_cap) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue