mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2026-06-07 09:41:30 +00:00
hv: change function parameters: pci_pdev_read_cfg and pci_pdev_write_cfg
In order to allow these functions to be called without an associated struct pci_pdev (for example, at the time of PCI bus enumeration), these two functions can not take the struct vdev as input parameter. Tracked-On: #1568 Signed-off-by: dongshen <dongsheng.x.zhang@intel.com> Signed-off-by: Zide Chen <zide.chen@intel.com> Reviewed-by: Zhao Yakui <yakui.zhao@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
This commit is contained in:
@@ -44,14 +44,14 @@ static uint32_t pci_pdev_calc_address(union pci_bdf bdf, uint32_t offset)
|
||||
return addr;
|
||||
}
|
||||
|
||||
uint32_t pci_pdev_read_cfg(struct pci_pdev *pdev, uint32_t offset, uint32_t bytes)
|
||||
uint32_t pci_pdev_read_cfg(union pci_bdf bdf, uint32_t offset, uint32_t bytes)
|
||||
{
|
||||
uint32_t addr;
|
||||
uint32_t val;
|
||||
|
||||
spinlock_obtain(&pci_device_lock);
|
||||
|
||||
addr = pci_pdev_calc_address(pdev->bdf, offset);
|
||||
addr = pci_pdev_calc_address(bdf, offset);
|
||||
|
||||
/* Write address to ADDRESS register */
|
||||
pio_write32(addr, PCI_CONFIG_ADDR);
|
||||
@@ -73,14 +73,13 @@ uint32_t pci_pdev_read_cfg(struct pci_pdev *pdev, uint32_t offset, uint32_t byte
|
||||
return val;
|
||||
}
|
||||
|
||||
void pci_pdev_write_cfg(struct pci_pdev *pdev, uint32_t offset, uint32_t bytes,
|
||||
uint32_t val)
|
||||
void pci_pdev_write_cfg(union pci_bdf bdf, uint32_t offset, uint32_t bytes, uint32_t val)
|
||||
{
|
||||
uint32_t addr;
|
||||
|
||||
spinlock_obtain(&pci_device_lock);
|
||||
|
||||
addr = pci_pdev_calc_address(pdev->bdf, offset);
|
||||
addr = pci_pdev_calc_address(bdf, offset);
|
||||
|
||||
/* Write address to ADDRESS register */
|
||||
pio_write32(addr, PCI_CONFIG_ADDR);
|
||||
|
||||
Reference in New Issue
Block a user