Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/bhyve/pci_emul.h
Show All 40 Lines | |||||
#include <assert.h> | #include <assert.h> | ||||
#define PCI_BARMAX PCIR_MAX_BAR_0 /* BAR registers in a Type 0 header */ | #define PCI_BARMAX PCIR_MAX_BAR_0 /* BAR registers in a Type 0 header */ | ||||
struct vmctx; | struct vmctx; | ||||
struct pci_devinst; | struct pci_devinst; | ||||
struct memory_region; | struct memory_region; | ||||
struct vm_snapshot_meta; | struct vm_snapshot_meta; | ||||
struct vm_snapshot_dev_info; | |||||
struct pci_devemu { | struct pci_devemu { | ||||
char *pe_emu; /* Name of device emulation */ | char *pe_emu; /* Name of device emulation */ | ||||
/* instance creation */ | /* instance creation */ | ||||
int (*pe_init)(struct vmctx *, struct pci_devinst *, | int (*pe_init)(struct vmctx *, struct pci_devinst *, | ||||
char *opts); | char *opts); | ||||
▲ Show 20 Lines • Show All 189 Lines • ▼ Show 20 Lines | int pci_emul_msix_twrite(struct pci_devinst *pi, uint64_t offset, int size, | ||||
uint64_t value); | uint64_t value); | ||||
uint64_t pci_emul_msix_tread(struct pci_devinst *pi, uint64_t offset, int size); | uint64_t pci_emul_msix_tread(struct pci_devinst *pi, uint64_t offset, int size); | ||||
int pci_count_lintr(int bus); | int pci_count_lintr(int bus); | ||||
void pci_walk_lintr(int bus, pci_lintr_cb cb, void *arg); | void pci_walk_lintr(int bus, pci_lintr_cb cb, void *arg); | ||||
void pci_write_dsdt(void); | void pci_write_dsdt(void); | ||||
uint64_t pci_ecfg_base(void); | uint64_t pci_ecfg_base(void); | ||||
int pci_bus_configured(int bus); | int pci_bus_configured(int bus); | ||||
#ifdef BHYVE_SNAPSHOT | #ifdef BHYVE_SNAPSHOT | ||||
int pci_snapshot(struct vm_snapshot_meta *meta); | int pci_snapshot(struct vm_snapshot_meta *meta, struct vm_snapshot_dev_info *dev_info); | ||||
int pci_pause(struct vmctx *ctx, const char *dev_name); | int pci_pause(struct vmctx *ctx, struct vm_snapshot_dev_info *dev_info); | ||||
int pci_resume(struct vmctx *ctx, const char *dev_name); | int pci_resume(struct vmctx *ctx, struct vm_snapshot_dev_info *dev_info); | ||||
#endif | #endif | ||||
static __inline void | static __inline void | ||||
pci_set_cfgdata8(struct pci_devinst *pi, int offset, uint8_t val) | pci_set_cfgdata8(struct pci_devinst *pi, int offset, uint8_t val) | ||||
{ | { | ||||
assert(offset <= PCI_REGMAX); | assert(offset <= PCI_REGMAX); | ||||
*(uint8_t *)(pi->pi_cfgdata + offset) = val; | *(uint8_t *)(pi->pi_cfgdata + offset) = val; | ||||
} | } | ||||
Show All 37 Lines |