class PciBar
Defined at line 106 of file ../../src/virtualization/bin/vmm/pci.h
64-bit PCI Base Address Register (BAR)
PCI BARs indicate a region in memory or (for x86) the IO Port space
that is used to interact with the device.
This class tracks the size/region/type of such a region and implements
logic to call back into the device to handle reads and writes as
necessary.
Thread compatible.
Public Methods
void PciBar (PciDevice *device,uint64_tsize,TrapTypetrap_type,Callback *callback)
Construct a BAR of the given type, size, and ID.
`size` will be rounded up to be a power of two, and at least PAGE_SIZE.
Defined at line 92 of file ../../src/virtualization/bin/vmm/pci.cc
void set_addr (uint64_t value)
Defined at line 118 of file ../../src/virtualization/bin/vmm/pci.cc
uint32_t pci_config_reg (size_t slot)
Get/set the high/low 32-bits of the BAR registers in the PCI config space.
Each 64-bit BAR occupies two 32-bit slots in the config space,
so `slot` must be 0 or 1.
Defined at line 113 of file ../../src/virtualization/bin/vmm/pci.cc
uint64_t size ()
Get the size / type of the region.
Defined at line 120 of file ../../src/virtualization/bin/vmm/pci.h
TrapType trap_type ()
Defined at line 121 of file ../../src/virtualization/bin/vmm/pci.h
void set_pci_config_reg (size_t slot, uint32_t value)
Defined at line 124 of file ../../src/virtualization/bin/vmm/pci.cc
uint64_t addr ()
Get/set base address.
Setting the address overwrites any guest-configured value of the register.
Defined at line 126 of file ../../src/virtualization/bin/vmm/pci.h
zx_status_t Read (uint64_t addr, IoValue * value)
IoHandler interface.
Defined at line 138 of file ../../src/virtualization/bin/vmm/pci.cc
zx_status_t Write (uint64_t addr, const IoValue & value)
Defined at line 145 of file ../../src/virtualization/bin/vmm/pci.cc
std::string_view Name ()
Defined at line 152 of file ../../src/virtualization/bin/vmm/pci.cc