class PciBar

Defined at line 75 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

uint64_t size ()

Get the size / type of the region.

Defined at line 89 of file ../../src/virtualization/bin/vmm/pci.h

TrapType trap_type ()

Defined at line 90 of file ../../src/virtualization/bin/vmm/pci.h

uint64_t addr ()

Get/set base address.

Setting the address overwrites any guest-configured value of the register.

Defined at line 95 of file ../../src/virtualization/bin/vmm/pci.h

void PciBar (PciDevice * device, uint64_t size, TrapType trap_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 116 of file ../../src/virtualization/bin/vmm/pci.cc

void set_addr (uint64_t value)

Defined at line 142 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 137 of file ../../src/virtualization/bin/vmm/pci.cc

void set_pci_config_reg (size_t slot, uint32_t value)

Defined at line 148 of file ../../src/virtualization/bin/vmm/pci.cc

zx_status_t Read (uint64_t addr, IoValue * value)

IoHandler interface.

Defined at line 162 of file ../../src/virtualization/bin/vmm/pci.cc

zx_status_t Write (uint64_t addr, const IoValue & value)

Defined at line 169 of file ../../src/virtualization/bin/vmm/pci.cc

std::string_view Name ()

Defined at line 176 of file ../../src/virtualization/bin/vmm/pci.cc

Records