pci.h
This interface presents a VMM PCI Driver. This manages the host's PCI devices, and handles guest OS PCI config space read & writes.
Functions:
Structs:
The interface pci.h
defines the following functions.
vmm_pci_init(space)
Initialize PCI space
Parameters:
space {vmm_pci_space_t **}
: Pointer to PCI space being initialisedReturns:
Back to interface description.
vmm_pci_add_entry(space, entry, addr)
Add a PCI entry. Optionally reports where it is located
Parameters:
space {vmm_pci_space_t *}
: PCI space handleentry {vmm_pci_entry_t}
: PCI entry being addraddr {vmm_pci_addr_t *}
: Resulting PCI address where entry gets locatedReturns:
Back to interface description.
make_addr_reg_from_config(conf, addr, reg)
Convert config to pci address
Parameters:
conf {uint32_t}
: Configuration value to convert to pci addressaddr {vmm_pci_address_t *}
: Resulting PCI addressreg {uint8_t *}
: Resulting register valueReturns:
No return
Back to interface description.
find_device(self, addr)
Find PCI device given a PCI address (Bus/Dev/Func)
Parameters:
self {vmm_pci_space_t *}
: PCI space handleaddr {vmm_pci_address_t}
: PCI address of deviceReturns:
Back to interface description.
The interface pci.h
defines the following structs.
vmm_pci_address
Represents a PCI address by Bus/Device/Function
Elements:
bus {uint8_t}
: Bus valuedev {uint8_t}
: Device valuefun {uint8_t}
: Function valueBack to interface description.
vmm_pci_entry
Abstracts the virtual PCI device. This is is inserted into the virtual PCI configuration space
Elements:
cookie {void *}
: User supplied cookie to pass onto callback functionsioread {int *(void *cookie, int offset, int size, uint32_t *result)}
: Configuration space read callbackiowrite {int *(void *cookie, int offset, int size, uint32_t value)}
: Configuration space write callbackBack to interface description.
vmm_pci_sapce
Represents a single host virtual PCI space This only supports one bus at the moment.
Elements:
bus {vmm_pci_entry_t *}
: The PCI bus, representing 32 devices, each of which has 8 functionsconf_port_addr {uint32_t}
: The current config address for IO port emulationBack to interface description.
Back to top.