mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
pci: add config space access traces
This adds pci_cfg_read and pci_cfg_write traces for config spaces accesses. Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
parent
1466cef32d
commit
3bf4dfdd11
2 changed files with 14 additions and 1 deletions
|
@ -20,6 +20,7 @@
|
|||
|
||||
#include "hw/pci/pci.h"
|
||||
#include "hw/pci/pci_host.h"
|
||||
#include "trace.h"
|
||||
|
||||
/* debug PCI */
|
||||
//#define DEBUG_PCI
|
||||
|
@ -51,14 +52,22 @@ void pci_host_config_write_common(PCIDevice *pci_dev, uint32_t addr,
|
|||
uint32_t limit, uint32_t val, uint32_t len)
|
||||
{
|
||||
assert(len <= 4);
|
||||
trace_pci_cfg_write(pci_dev->name, PCI_SLOT(pci_dev->devfn),
|
||||
PCI_FUNC(pci_dev->devfn), addr, val);
|
||||
pci_dev->config_write(pci_dev, addr, val, MIN(len, limit - addr));
|
||||
}
|
||||
|
||||
uint32_t pci_host_config_read_common(PCIDevice *pci_dev, uint32_t addr,
|
||||
uint32_t limit, uint32_t len)
|
||||
{
|
||||
uint32_t ret;
|
||||
|
||||
assert(len <= 4);
|
||||
return pci_dev->config_read(pci_dev, addr, MIN(len, limit - addr));
|
||||
ret = pci_dev->config_read(pci_dev, addr, MIN(len, limit - addr));
|
||||
trace_pci_cfg_read(pci_dev->name, PCI_SLOT(pci_dev->devfn),
|
||||
PCI_FUNC(pci_dev->devfn), addr, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void pci_data_write(PCIBus *s, uint32_t addr, uint32_t val, int len)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue