const VIRTIO_MMIO_MAGIC_VALUE
pub const VIRTIO_MMIO_MAGIC_VALUE = 0x000Purpose
VirtIO MMIO Register Offsets
#core/virtioZero-allocation, freestanding VirtIO driver framework (Split Virtqueue, Modern VirtIO-MMIO v2, Legacy/Transitional VirtIO-PCI, VirtIO-Blk, VirtIO-Net). VirtIO MMIO Register Offsets
const VIRTIO_MMIO_MAGIC_VALUEpub const VIRTIO_MMIO_MAGIC_VALUE = 0x000VirtIO MMIO Register Offsets
const VIRTIO_MMIO_VERSIONpub const VIRTIO_MMIO_VERSION = 0x004Constant VIRTIO_MMIO_VERSION, defining protocol or algorithm parameters.
const VIRTIO_MMIO_DEVICE_IDpub const VIRTIO_MMIO_DEVICE_ID = 0x008Constant VIRTIO_MMIO_DEVICE_ID, defining protocol or algorithm parameters.
const VIRTIO_MMIO_VENDOR_IDpub const VIRTIO_MMIO_VENDOR_ID = 0x00CConstant VIRTIO_MMIO_VENDOR_ID, defining protocol or algorithm parameters.
const VIRTIO_MMIO_DEVICE_FEATURESpub const VIRTIO_MMIO_DEVICE_FEATURES = 0x010Constant VIRTIO_MMIO_DEVICE_FEATURES, defining protocol or algorithm parameters.
const VIRTIO_MMIO_DEVICE_FEATURES_SELpub const VIRTIO_MMIO_DEVICE_FEATURES_SEL = 0x014Constant VIRTIO_MMIO_DEVICE_FEATURES_SEL, defining protocol or algorithm parameters.
const VIRTIO_MMIO_DRIVER_FEATURESpub const VIRTIO_MMIO_DRIVER_FEATURES = 0x020Constant VIRTIO_MMIO_DRIVER_FEATURES, defining protocol or algorithm parameters.
const VIRTIO_MMIO_DRIVER_FEATURES_SELpub const VIRTIO_MMIO_DRIVER_FEATURES_SEL = 0x024Constant VIRTIO_MMIO_DRIVER_FEATURES_SEL, defining protocol or algorithm parameters.
const VIRTIO_MMIO_GUEST_PAGE_SIZEpub const VIRTIO_MMIO_GUEST_PAGE_SIZE = 0x028Constant VIRTIO_MMIO_GUEST_PAGE_SIZE, defining protocol or algorithm parameters.
const VIRTIO_MMIO_QUEUE_SELpub const VIRTIO_MMIO_QUEUE_SEL = 0x030Constant VIRTIO_MMIO_QUEUE_SEL, defining protocol or algorithm parameters.
const VIRTIO_MMIO_QUEUE_NUM_MAXpub const VIRTIO_MMIO_QUEUE_NUM_MAX = 0x034Constant VIRTIO_MMIO_QUEUE_NUM_MAX, defining protocol or algorithm parameters.
const VIRTIO_MMIO_QUEUE_NUMpub const VIRTIO_MMIO_QUEUE_NUM = 0x038Constant VIRTIO_MMIO_QUEUE_NUM, defining protocol or algorithm parameters.
const VIRTIO_MMIO_QUEUE_ALIGNpub const VIRTIO_MMIO_QUEUE_ALIGN = 0x03CConstant VIRTIO_MMIO_QUEUE_ALIGN, defining protocol or algorithm parameters.
const VIRTIO_MMIO_QUEUE_PFNpub const VIRTIO_MMIO_QUEUE_PFN = 0x040Constant VIRTIO_MMIO_QUEUE_PFN, defining protocol or algorithm parameters.
const VIRTIO_MMIO_QUEUE_READYpub const VIRTIO_MMIO_QUEUE_READY = 0x044Constant VIRTIO_MMIO_QUEUE_READY, defining protocol or algorithm parameters.
const VIRTIO_MMIO_QUEUE_NOTIFYpub const VIRTIO_MMIO_QUEUE_NOTIFY = 0x050Constant VIRTIO_MMIO_QUEUE_NOTIFY, defining protocol or algorithm parameters.
const VIRTIO_MMIO_INTERRUPT_STATUSpub const VIRTIO_MMIO_INTERRUPT_STATUS = 0x060Constant VIRTIO_MMIO_INTERRUPT_STATUS, defining protocol or algorithm parameters.
const VIRTIO_MMIO_INTERRUPT_ACKpub const VIRTIO_MMIO_INTERRUPT_ACK = 0x064Constant VIRTIO_MMIO_INTERRUPT_ACK, defining protocol or algorithm parameters.
const VIRTIO_MMIO_STATUSpub const VIRTIO_MMIO_STATUS = 0x070Constant VIRTIO_MMIO_STATUS, defining protocol or algorithm parameters.
const VIRTIO_MMIO_QUEUE_DESC_LOWpub const VIRTIO_MMIO_QUEUE_DESC_LOW = 0x080Constant VIRTIO_MMIO_QUEUE_DESC_LOW, defining protocol or algorithm parameters.
const VIRTIO_MMIO_QUEUE_DESC_HIGHpub const VIRTIO_MMIO_QUEUE_DESC_HIGH = 0x084Constant VIRTIO_MMIO_QUEUE_DESC_HIGH, defining protocol or algorithm parameters.
const VIRTIO_MMIO_QUEUE_DRIVER_LOWpub const VIRTIO_MMIO_QUEUE_DRIVER_LOW = 0x090Constant VIRTIO_MMIO_QUEUE_DRIVER_LOW, defining protocol or algorithm parameters.
const VIRTIO_MMIO_QUEUE_DRIVER_HIGHpub const VIRTIO_MMIO_QUEUE_DRIVER_HIGH = 0x094Constant VIRTIO_MMIO_QUEUE_DRIVER_HIGH, defining protocol or algorithm parameters.
const VIRTIO_MMIO_QUEUE_DEVICE_LOWpub const VIRTIO_MMIO_QUEUE_DEVICE_LOW = 0x0A0Constant VIRTIO_MMIO_QUEUE_DEVICE_LOW, defining protocol or algorithm parameters.
const VIRTIO_MMIO_QUEUE_DEVICE_HIGHpub const VIRTIO_MMIO_QUEUE_DEVICE_HIGH = 0x0A4Constant VIRTIO_MMIO_QUEUE_DEVICE_HIGH, defining protocol or algorithm parameters.
const VIRTIO_MMIO_CONFIGpub const VIRTIO_MMIO_CONFIG = 0x100Constant VIRTIO_MMIO_CONFIG, defining protocol or algorithm parameters.
const VIRTIO_MAGICpub const VIRTIO_MAGIC = 0x74726976Magic & Device IDs
const VIRTIO_DEV_NETpub const VIRTIO_DEV_NET = 1Constant VIRTIO_DEV_NET, defining protocol or algorithm parameters.
const VIRTIO_DEV_BLKpub const VIRTIO_DEV_BLK = 2Constant VIRTIO_DEV_BLK, defining protocol or algorithm parameters.
const VIRTIO_DEV_CONSOLEpub const VIRTIO_DEV_CONSOLE = 3Constant VIRTIO_DEV_CONSOLE, defining protocol or algorithm parameters.
const VIRTIO_DEV_ENTROPYpub const VIRTIO_DEV_ENTROPY = 4Constant VIRTIO_DEV_ENTROPY, defining protocol or algorithm parameters.
const VIRTIO_DEV_RNGpub const VIRTIO_DEV_RNG = 4Constant VIRTIO_DEV_RNG, defining protocol or algorithm parameters.
const VIRTIO_DEV_GPUpub const VIRTIO_DEV_GPU = 18Constant VIRTIO_DEV_GPU, defining protocol or algorithm parameters.
const VIRTIO_STATUS_RESETpub const VIRTIO_STATUS_RESET = 0Device status bits
const VIRTIO_STATUS_ACKNOWLEDGEpub const VIRTIO_STATUS_ACKNOWLEDGE = 1Constant VIRTIO_STATUS_ACKNOWLEDGE, defining protocol or algorithm parameters.
const VIRTIO_STATUS_DRIVERpub const VIRTIO_STATUS_DRIVER = 2Constant VIRTIO_STATUS_DRIVER, defining protocol or algorithm parameters.
const VIRTIO_STATUS_DRIVER_OKpub const VIRTIO_STATUS_DRIVER_OK = 4Constant VIRTIO_STATUS_DRIVER_OK, defining protocol or algorithm parameters.
const VIRTIO_STATUS_FEATURES_OKpub const VIRTIO_STATUS_FEATURES_OK = 8Constant VIRTIO_STATUS_FEATURES_OK, defining protocol or algorithm parameters.
const VIRTIO_STATUS_DEVICE_NEEDS_RESETpub const VIRTIO_STATUS_DEVICE_NEEDS_RESET = 64Constant VIRTIO_STATUS_DEVICE_NEEDS_RESET, defining protocol or algorithm parameters.
const VIRTIO_STATUS_FAILEDpub const VIRTIO_STATUS_FAILED = 128Constant VIRTIO_STATUS_FAILED, defining protocol or algorithm parameters.
const VIRTQ_DESC_F_NEXTpub const VIRTQ_DESC_F_NEXT = 1Virtqueue descriptor flags
const VIRTQ_DESC_F_WRITEpub const VIRTQ_DESC_F_WRITE = 2Constant VIRTQ_DESC_F_WRITE, defining protocol or algorithm parameters.
const VIRTQ_DESC_F_INDIRECTpub const VIRTQ_DESC_F_INDIRECT = 4Constant VIRTQ_DESC_F_INDIRECT, defining protocol or algorithm parameters.
const VIRTIO_BLK_T_INpub const VIRTIO_BLK_T_IN = 0VirtIO-Blk request types and status codes
const VIRTIO_BLK_T_OUTpub const VIRTIO_BLK_T_OUT = 1Constant VIRTIO_BLK_T_OUT, defining protocol or algorithm parameters.
const VIRTIO_BLK_T_FLUSHpub const VIRTIO_BLK_T_FLUSH = 4Constant VIRTIO_BLK_T_FLUSH, defining protocol or algorithm parameters.
const VIRTIO_BLK_S_OKpub const VIRTIO_BLK_S_OK = 0Constant VIRTIO_BLK_S_OK, defining protocol or algorithm parameters.
const VIRTIO_BLK_S_IOERRpub const VIRTIO_BLK_S_IOERR = 1Constant VIRTIO_BLK_S_IOERR, defining protocol or algorithm parameters.
const VIRTIO_BLK_S_UNSUPPpub const VIRTIO_BLK_S_UNSUPP = 2Constant VIRTIO_BLK_S_UNSUPP, defining protocol or algorithm parameters.
const PCI_CONFIG_ADDRpub const PCI_CONFIG_ADDR = 0x0CF8x86 PCI configuration & Legacy/Transitional VirtIO-PCI BAR0 offsets
const PCI_CONFIG_DATApub const PCI_CONFIG_DATA = 0x0CFCConstant PCI_CONFIG_DATA, defining protocol or algorithm parameters.
const VIRTIO_PCI_VENDORpub const VIRTIO_PCI_VENDOR = 0x1AF4Constant VIRTIO_PCI_VENDOR, defining protocol or algorithm parameters.
const VIRTIO_PCI_DEV_NET_LEGACYpub const VIRTIO_PCI_DEV_NET_LEGACY = 0x1000Constant VIRTIO_PCI_DEV_NET_LEGACY, defining protocol or algorithm parameters.
const VIRTIO_PCI_DEV_BLK_LEGACYpub const VIRTIO_PCI_DEV_BLK_LEGACY = 0x1001Constant VIRTIO_PCI_DEV_BLK_LEGACY, defining protocol or algorithm parameters.
const VIRTIO_PCI_DEV_RNG_LEGACYpub const VIRTIO_PCI_DEV_RNG_LEGACY = 0x1005Constant VIRTIO_PCI_DEV_RNG_LEGACY, defining protocol or algorithm parameters.
const VIRTIO_PCI_DEV_NET_MODERNpub const VIRTIO_PCI_DEV_NET_MODERN = 0x1041Constant VIRTIO_PCI_DEV_NET_MODERN, defining protocol or algorithm parameters.
const VIRTIO_PCI_DEV_BLK_MODERNpub const VIRTIO_PCI_DEV_BLK_MODERN = 0x1042Constant VIRTIO_PCI_DEV_BLK_MODERN, defining protocol or algorithm parameters.
const VIRTIO_PCI_DEV_RNG_MODERNpub const VIRTIO_PCI_DEV_RNG_MODERN = 0x1044Constant VIRTIO_PCI_DEV_RNG_MODERN, defining protocol or algorithm parameters.
const VIRTIO_PCI_DEV_GPU_MODERNpub const VIRTIO_PCI_DEV_GPU_MODERN = 0x1050Constant VIRTIO_PCI_DEV_GPU_MODERN, defining protocol or algorithm parameters.
const VIRTIO_GPU_CMD_GET_DISPLAY_INFOpub const VIRTIO_GPU_CMD_GET_DISPLAY_INFO = 0x0100VirtIO-GPU 2D command and response types and pixel formats
const VIRTIO_GPU_CMD_RESOURCE_CREATE_2Dpub const VIRTIO_GPU_CMD_RESOURCE_CREATE_2D = 0x0101Constant VIRTIO_GPU_CMD_RESOURCE_CREATE_2D, defining protocol or algorithm parameters.
const VIRTIO_GPU_CMD_SET_SCANOUTpub const VIRTIO_GPU_CMD_SET_SCANOUT = 0x0103Constant VIRTIO_GPU_CMD_SET_SCANOUT, defining protocol or algorithm parameters.
const VIRTIO_GPU_CMD_RESOURCE_FLUSHpub const VIRTIO_GPU_CMD_RESOURCE_FLUSH = 0x0104Constant VIRTIO_GPU_CMD_RESOURCE_FLUSH, defining protocol or algorithm parameters.
const VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2Dpub const VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D = 0x0105Constant VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D, defining protocol or algorithm parameters.
const VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKINGpub const VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING = 0x0106Constant VIRTIO_GPU_CMD_RESOURCE_ATTACH_BACKING, defining protocol or algorithm parameters.
const VIRTIO_GPU_RESP_OK_NODATApub const VIRTIO_GPU_RESP_OK_NODATA = 0x1100Constant VIRTIO_GPU_RESP_OK_NODATA, defining protocol or algorithm parameters.
const VIRTIO_GPU_RESP_OK_DISPLAY_INFOpub const VIRTIO_GPU_RESP_OK_DISPLAY_INFO = 0x1101Constant VIRTIO_GPU_RESP_OK_DISPLAY_INFO, defining protocol or algorithm parameters.
const VIRTIO_GPU_FORMAT_B8G8R8A8_UNORMpub const VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM = 1Constant VIRTIO_GPU_FORMAT_B8G8R8A8_UNORM, defining protocol or algorithm parameters.
const VIRTIO_GPU_FORMAT_B8G8R8X8_UNORMpub const VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM = 2Constant VIRTIO_GPU_FORMAT_B8G8R8X8_UNORM, defining protocol or algorithm parameters.
const VIRTIO_NET_F_MACpub const VIRTIO_NET_F_MAC = 5VirtIO-Net feature bits
const VIRTIO_NET_F_STATUSpub const VIRTIO_NET_F_STATUS = 16Constant VIRTIO_NET_F_STATUS, defining protocol or algorithm parameters.
const VIRTIO_PCI_CAP_COMMON_CFGpub const VIRTIO_PCI_CAP_COMMON_CFG = 1VirtIO 1.0 PCI Capability Types (PCI Cap ID 0x09)
const VIRTIO_PCI_CAP_NOTIFY_CFGpub const VIRTIO_PCI_CAP_NOTIFY_CFG = 2Constant VIRTIO_PCI_CAP_NOTIFY_CFG, defining protocol or algorithm parameters.
const VIRTIO_PCI_CAP_ISR_CFGpub const VIRTIO_PCI_CAP_ISR_CFG = 3Constant VIRTIO_PCI_CAP_ISR_CFG, defining protocol or algorithm parameters.
const VIRTIO_PCI_CAP_DEVICE_CFGpub const VIRTIO_PCI_CAP_DEVICE_CFG = 4Constant VIRTIO_PCI_CAP_DEVICE_CFG, defining protocol or algorithm parameters.
const VIRTIO_COMMON_DEV_FEAT_SELpub const VIRTIO_COMMON_DEV_FEAT_SEL = 0x00VirtIO 1.0 Common Configuration register offsets
const VIRTIO_COMMON_DEV_FEATpub const VIRTIO_COMMON_DEV_FEAT = 0x04Constant VIRTIO_COMMON_DEV_FEAT, defining protocol or algorithm parameters.
const VIRTIO_COMMON_DRV_FEAT_SELpub const VIRTIO_COMMON_DRV_FEAT_SEL = 0x08Constant VIRTIO_COMMON_DRV_FEAT_SEL, defining protocol or algorithm parameters.
const VIRTIO_COMMON_DRV_FEATpub const VIRTIO_COMMON_DRV_FEAT = 0x0CConstant VIRTIO_COMMON_DRV_FEAT, defining protocol or algorithm parameters.
const VIRTIO_COMMON_MSIX_VECpub const VIRTIO_COMMON_MSIX_VEC = 0x10Constant VIRTIO_COMMON_MSIX_VEC, defining protocol or algorithm parameters.
const VIRTIO_COMMON_NUM_QUEUESpub const VIRTIO_COMMON_NUM_QUEUES = 0x12Constant VIRTIO_COMMON_NUM_QUEUES, defining protocol or algorithm parameters.
const VIRTIO_COMMON_STATUSpub const VIRTIO_COMMON_STATUS = 0x14Constant VIRTIO_COMMON_STATUS, defining protocol or algorithm parameters.
const VIRTIO_COMMON_CFG_GENpub const VIRTIO_COMMON_CFG_GEN = 0x15Constant VIRTIO_COMMON_CFG_GEN, defining protocol or algorithm parameters.
const VIRTIO_COMMON_Q_SELECTpub const VIRTIO_COMMON_Q_SELECT = 0x16Constant VIRTIO_COMMON_Q_SELECT, defining protocol or algorithm parameters.
const VIRTIO_COMMON_Q_SIZEpub const VIRTIO_COMMON_Q_SIZE = 0x18Constant VIRTIO_COMMON_Q_SIZE, defining protocol or algorithm parameters.
const VIRTIO_COMMON_Q_MSIXpub const VIRTIO_COMMON_Q_MSIX = 0x1AConstant VIRTIO_COMMON_Q_MSIX, defining protocol or algorithm parameters.
const VIRTIO_COMMON_Q_ENABLEpub const VIRTIO_COMMON_Q_ENABLE = 0x1CConstant VIRTIO_COMMON_Q_ENABLE, defining protocol or algorithm parameters.
const VIRTIO_COMMON_Q_NOTIFY_OFFpub const VIRTIO_COMMON_Q_NOTIFY_OFF = 0x1EConstant VIRTIO_COMMON_Q_NOTIFY_OFF, defining protocol or algorithm parameters.
const VIRTIO_COMMON_Q_DESC_LOpub const VIRTIO_COMMON_Q_DESC_LO = 0x20Constant VIRTIO_COMMON_Q_DESC_LO, defining protocol or algorithm parameters.
const VIRTIO_COMMON_Q_DESC_HIpub const VIRTIO_COMMON_Q_DESC_HI = 0x24Constant VIRTIO_COMMON_Q_DESC_HI, defining protocol or algorithm parameters.
const VIRTIO_COMMON_Q_AVAIL_LOpub const VIRTIO_COMMON_Q_AVAIL_LO = 0x28Constant VIRTIO_COMMON_Q_AVAIL_LO, defining protocol or algorithm parameters.
const VIRTIO_COMMON_Q_AVAIL_HIpub const VIRTIO_COMMON_Q_AVAIL_HI = 0x2CConstant VIRTIO_COMMON_Q_AVAIL_HI, defining protocol or algorithm parameters.
const VIRTIO_COMMON_Q_USED_LOpub const VIRTIO_COMMON_Q_USED_LO = 0x30Constant VIRTIO_COMMON_Q_USED_LO, defining protocol or algorithm parameters.
const VIRTIO_COMMON_Q_USED_HIpub const VIRTIO_COMMON_Q_USED_HI = 0x34Constant VIRTIO_COMMON_Q_USED_HI, defining protocol or algorithm parameters.
const VIRTIO_PCI_DEV_FEATURESpub const VIRTIO_PCI_DEV_FEATURES = 0x00Constant VIRTIO_PCI_DEV_FEATURES, defining protocol or algorithm parameters.
const VIRTIO_PCI_GUEST_FEATURESpub const VIRTIO_PCI_GUEST_FEATURES = 0x04Constant VIRTIO_PCI_GUEST_FEATURES, defining protocol or algorithm parameters.
const VIRTIO_PCI_QUEUE_PFNpub const VIRTIO_PCI_QUEUE_PFN = 0x08Constant VIRTIO_PCI_QUEUE_PFN, defining protocol or algorithm parameters.
const VIRTIO_PCI_QUEUE_NUMpub const VIRTIO_PCI_QUEUE_NUM = 0x0CConstant VIRTIO_PCI_QUEUE_NUM, defining protocol or algorithm parameters.
const VIRTIO_PCI_QUEUE_SELpub const VIRTIO_PCI_QUEUE_SEL = 0x0EConstant VIRTIO_PCI_QUEUE_SEL, defining protocol or algorithm parameters.
const VIRTIO_PCI_QUEUE_NOTIFYpub const VIRTIO_PCI_QUEUE_NOTIFY = 0x10Constant VIRTIO_PCI_QUEUE_NOTIFY, defining protocol or algorithm parameters.
const VIRTIO_PCI_STATUSpub const VIRTIO_PCI_STATUS = 0x12Constant VIRTIO_PCI_STATUS, defining protocol or algorithm parameters.
const VIRTIO_PCI_ISRpub const VIRTIO_PCI_ISR = 0x13Constant VIRTIO_PCI_ISR, defining protocol or algorithm parameters.
const VIRTIO_PCI_BLK_CAP_LOpub const VIRTIO_PCI_BLK_CAP_LO = 0x14Constant VIRTIO_PCI_BLK_CAP_LO, defining protocol or algorithm parameters.
const VIRTIO_PCI_BLK_CAP_HIpub const VIRTIO_PCI_BLK_CAP_HI = 0x18Constant VIRTIO_PCI_BLK_CAP_HI, defining protocol or algorithm parameters.
struct VirtqDescpub struct VirtqDesc {
pub addr u64
pub len u32
pub flags u16
pub next u16
}Structure encapsulating addr, len, flags, next.
addr u64len u32flags u16next u16struct VirtqUsedElempub struct VirtqUsedElem {
pub id u32
pub len u32
}Structure encapsulating id, len.
id u32len u32struct VirtioBlkReqpub struct VirtioBlkReq {
pub req_type u32
pub reserved u32
pub sector u64
}Structure encapsulating req_type, reserved, sector.
req_type u32reserved u32sector u64struct VirtioNetHdrpub struct VirtioNetHdr {
pub flags u8
pub gso_type u8
pub hdr_len u16
pub gso_size u16
pub csum_start u16
pub csum_offset u16
pub num_buffers u16
}Structure encapsulating flags, gso_type, hdr_len, gso_size, csum_start.
flags u8gso_type u8hdr_len u16gso_size u16csum_start u16csum_offset u16num_buffers u16struct VirtioGpuCtrlHdrpub struct VirtioGpuCtrlHdr {
pub cmd_type u32
pub flags u32
pub fence_id u64
pub ctx_id u32
pub padding u32
}Structure encapsulating cmd_type, flags, fence_id, ctx_id, padding.
cmd_type u32flags u32fence_id u64ctx_id u32padding u32struct VirtioGpuRectpub struct VirtioGpuRect {
pub x u32
pub y u32
pub width u32
pub height u32
}Structure encapsulating x, y, width, height.
x u32y u32width u32height u32struct VirtioGpuDisplayOnepub struct VirtioGpuDisplayOne {
pub r VirtioGpuRect
pub enabled u32
pub flags u32
}Structure encapsulating r, enabled, flags.
r VirtioGpuRectenabled u32flags u32struct VirtioGpuRespDisplayInfopub struct VirtioGpuRespDisplayInfo {
pub hdr VirtioGpuCtrlHdr
pub pmodes [16]VirtioGpuDisplayOne
}Structure encapsulating hdr, pmodes.
hdr VirtioGpuCtrlHdrpmodes [16]VirtioGpuDisplayOnestruct VirtioGpuResourceCreate2dpub struct VirtioGpuResourceCreate2d {
pub hdr VirtioGpuCtrlHdr
pub resource_id u32
pub format u32
pub width u32
pub height u32
}Structure encapsulating hdr, resource_id, format, width, height.
hdr VirtioGpuCtrlHdrresource_id u32format u32width u32height u32struct VirtioGpuMemEntrypub struct VirtioGpuMemEntry {
pub addr u64
pub length u32
pub padding u32
}Structure encapsulating addr, length, padding.
addr u64length u32padding u32struct VirtioGpuAttachBackingpub struct VirtioGpuAttachBacking {
pub hdr VirtioGpuCtrlHdr
pub resource_id u32
pub nr_entries u32
}Structure encapsulating hdr, resource_id, nr_entries.
hdr VirtioGpuCtrlHdrresource_id u32nr_entries u32struct VirtioGpuSetScanoutpub struct VirtioGpuSetScanout {
pub hdr VirtioGpuCtrlHdr
pub r VirtioGpuRect
pub scanout_id u32
pub resource_id u32
}Structure encapsulating hdr, r, scanout_id, resource_id.
hdr VirtioGpuCtrlHdrr VirtioGpuRectscanout_id u32resource_id u32struct VirtioGpuTransferToHost2dpub struct VirtioGpuTransferToHost2d {
pub hdr VirtioGpuCtrlHdr
pub r VirtioGpuRect
pub offset u64
pub resource_id u32
pub padding u32
}Structure encapsulating hdr, r, offset, resource_id, padding.
hdr VirtioGpuCtrlHdrr VirtioGpuRectoffset u64resource_id u32padding u32struct VirtioGpuResourceFlushpub struct VirtioGpuResourceFlush {
pub hdr VirtioGpuCtrlHdr
pub r VirtioGpuRect
pub resource_id u32
pub padding u32
}Structure encapsulating hdr, r, resource_id, padding.
hdr VirtioGpuCtrlHdrr VirtioGpuRectresource_id u32padding u32struct VirtioDevicepub struct VirtioDevice {
pub base u64
}Structure encapsulating base.
base u64virtio_device_newpub fn virtio_device_new(base u64) VirtioDeviceVirtio device new.
base u64VirtioDevice — a value of this type
(&VirtioDevice) read_regpub fn (dev &VirtioDevice) read_reg(offset u64) u32Operation on &VirtioDevice: read reg.
dev &VirtioDeviceVirtioDevice instance used by this call (borrow).offset u64u32 — a value of this type
(&VirtioDevice) write_regpub fn (dev &VirtioDevice) write_reg(offset u64, val u32)Operation on &VirtioDevice: write reg.
dev &VirtioDeviceVirtioDevice instance used by this call (borrow).offset u64val u32This call does not return a value.
(&VirtioDevice) probepub fn (dev &VirtioDevice) probe() u32Execute probe on &VirtioDevice.
dev &VirtioDeviceVirtioDevice instance used by this call (borrow).u32 — a value of this type
virtio_mmio_find_blkpub fn virtio_mmio_find_blk(start_addr u64, stride u64, count int) u64Virtio mmio find blk.
start_addr u64stride u64count intu64 — a value of this type
(&VirtioDevice) init_featurespub fn (dev &VirtioDevice) init_features() boolOperation on &VirtioDevice: init features.
dev &VirtioDeviceVirtioDevice instance used by this call (borrow).bool — true or false
(&VirtioDevice) init_devicepub fn (dev &VirtioDevice) init_device() boolOperation on &VirtioDevice: init device.
dev &VirtioDeviceVirtioDevice instance used by this call (borrow).bool — true or false
struct VirtioBlkDriverpub struct VirtioBlkDriver {
pub dev VirtioDevice
pub capacity_sectors u64
pub queue_size u32
pub avail_idx u16
pub last_used_idx u16
pub desc_addr u64
pub avail_addr u64
pub used_addr u64
pub req_addr u64
pub status_addr u64
}Structure encapsulating dev, capacity_sectors, queue_size, avail_idx, last_used_idx.
dev VirtioDevicecapacity_sectors u64queue_size u32avail_idx u16last_used_idx u16desc_addr u64avail_addr u64used_addr u64req_addr u64status_addr u64virtio_blk_newpub fn virtio_blk_new(base u64) VirtioBlkDriverVirtio blk new.
base u64VirtioBlkDriver — a value of this type
($&VirtioBlkDriver) initpub fn (blk $&VirtioBlkDriver) init() boolInitialize internal state and default parameters.
blk $&VirtioBlkDriverVirtioBlkDriver instance used by this call (exclusive borrow).bool — true or false
($&VirtioBlkDriver) init_with_dmapub fn (blk $&VirtioBlkDriver) init_with_dma(dma_base u64, dma_bytes u64) boolOperation on $&VirtioBlkDriver: init with dma.
blk $&VirtioBlkDriverVirtioBlkDriver instance used by this call (exclusive borrow).dma_base u64dma_bytes u64bool — true or false
($&VirtioBlkDriver) rw_sectorpub fn (blk $&VirtioBlkDriver) rw_sector(sector u64, buf *raw u8, is_write bool) boolOperation on $&VirtioBlkDriver: rw sector.
blk $&VirtioBlkDriverVirtioBlkDriver instance used by this call (exclusive borrow).sector u64buf *raw u8is_write boolbool — true or false
($&VirtioBlkDriver) read_sectorpub fn (blk $&VirtioBlkDriver) read_sector(sector u64, buf *raw u8) boolOperation on $&VirtioBlkDriver: read sector.
blk $&VirtioBlkDriverVirtioBlkDriver instance used by this call (exclusive borrow).sector u64buf *raw u8bool — true or false
($&VirtioBlkDriver) write_sectorpub fn (blk $&VirtioBlkDriver) write_sector(sector u64, buf *raw u8) boolOperation on $&VirtioBlkDriver: write sector.
blk $&VirtioBlkDriverVirtioBlkDriver instance used by this call (exclusive borrow).sector u64buf *raw u8bool — true or false
pci_read32pub fn pci_read32(bus u8, dev u8, func u8, offset u8) u32Pci read32.
bus u8dev u8func u8offset u8u32 — a value of this type
pci_write32pub fn pci_write32(bus u8, dev u8, func u8, offset u8, val u32)Pci write32.
bus u8dev u8func u8offset u8val u32This call does not return a value.
pci_find_virtio_blkpub fn pci_find_virtio_blk() intPci find virtio blk.
No arguments are required.
int — a value of this type
pci_find_virtio_netpub fn pci_find_virtio_net() intPci find virtio net.
No arguments are required.
int — a value of this type
pci_find_virtio_rngpub fn pci_find_virtio_rng() intPci find virtio rng.
No arguments are required.
int — a value of this type
pci_find_virtio_gpupub fn pci_find_virtio_gpu() intPci find virtio gpu.
No arguments are required.
int — a value of this type
struct VirtioPciModernCapspub struct VirtioPciModernCaps {
pub pci_dev u8
pub pad0 u8
pub pad1 u16
pub notify_off_multiplier u32
pub bar_phys u64
pub bar_span u64
pub common_cfg u64
pub notify_base u64
pub isr_cfg u64
pub device_cfg u64
}Structure encapsulating pci_dev, pad0, pad1, notify_off_multiplier, bar_phys.
pci_dev u8pad0 u8pad1 u16notify_off_multiplier u32bar_phys u64bar_span u64common_cfg u64notify_base u64isr_cfg u64device_cfg u64pci_probe_virtio_modernpub fn pci_probe_virtio_modern(pci_dev u8, out *raw VirtioPciModernCaps) boolPci probe virtio modern.
pci_dev u8out *raw VirtioPciModernCapsbool — true or false
pci_probe_virtio_blk_modernpub fn pci_probe_virtio_blk_modern(out *raw VirtioPciModernCaps) boolPci probe virtio blk modern.
out *raw VirtioPciModernCapsbool — true or false
pci_probe_virtio_net_modernpub fn pci_probe_virtio_net_modern(out *raw VirtioPciModernCaps) boolPci probe virtio net modern.
out *raw VirtioPciModernCapsbool — true or false
pci_probe_virtio_rng_modernpub fn pci_probe_virtio_rng_modern(out *raw VirtioPciModernCaps) boolPci probe virtio rng modern.
out *raw VirtioPciModernCapsbool — true or false
pci_probe_virtio_gpu_modernpub fn pci_probe_virtio_gpu_modern(out *raw VirtioPciModernCaps) boolPci probe virtio gpu modern.
out *raw VirtioPciModernCapsbool — true or false
struct VirtioPciBlkDriverpub struct VirtioPciBlkDriver {
pub io_base u16
pub pci_dev u8
pub pad0 u8
pub queue_size u32
pub avail_idx u16
pub last_used_idx u16
pub is_modern u32
pub capacity_sectors u64
pub desc_addr u64
pub avail_addr u64
pub used_addr u64
pub req_addr u64
pub status_addr u64
pub common_cfg u64
pub notify_addr u64
pub isr_addr u64
pub device_cfg u64
}Structure encapsulating io_base, pci_dev, pad0, queue_size, avail_idx.
io_base u16pci_dev u8pad0 u8queue_size u32avail_idx u16last_used_idx u16is_modern u32capacity_sectors u64desc_addr u64avail_addr u64used_addr u64req_addr u64status_addr u64common_cfg u64notify_addr u64isr_addr u64device_cfg u64virtio_pci_blk_newpub fn virtio_pci_blk_new() VirtioPciBlkDriverVirtio pci blk new.
No arguments are required.
VirtioPciBlkDriver — a value of this type
($&VirtioPciBlkDriver) init_pci_modernpub fn (blk $&VirtioPciBlkDriver) init_pci_modern(caps *raw VirtioPciModernCaps, dma_base u64, dma_bytes u64) boolOperation on $&VirtioPciBlkDriver: init pci modern.
blk $&VirtioPciBlkDriverVirtioPciBlkDriver instance used by this call (exclusive borrow).caps *raw VirtioPciModernCapsdma_base u64dma_bytes u64bool — true or false
($&VirtioPciBlkDriver) init_pcipub fn (blk $&VirtioPciBlkDriver) init_pci(dma_base u64, dma_bytes u64) boolOperation on $&VirtioPciBlkDriver: init pci.
blk $&VirtioPciBlkDriverVirtioPciBlkDriver instance used by this call (exclusive borrow).dma_base u64dma_bytes u64bool — true or false
($&VirtioPciBlkDriver) rw_sectorpub fn (blk $&VirtioPciBlkDriver) rw_sector(sector u64, buf *raw u8, is_write bool) boolOperation on $&VirtioPciBlkDriver: rw sector.
blk $&VirtioPciBlkDriverVirtioPciBlkDriver instance used by this call (exclusive borrow).sector u64buf *raw u8is_write boolbool — true or false
($&VirtioPciBlkDriver) read_sectorspub fn (blk $&VirtioPciBlkDriver) read_sectors(sector u64, count int, buf *raw u8) boolOperation on $&VirtioPciBlkDriver: read sectors.
blk $&VirtioPciBlkDriverVirtioPciBlkDriver instance used by this call (exclusive borrow).sector u64count intbuf *raw u8bool — true or false
($&VirtioPciBlkDriver) write_sectorspub fn (blk $&VirtioPciBlkDriver) write_sectors(sector u64, count int, buf *raw u8) boolOperation on $&VirtioPciBlkDriver: write sectors.
blk $&VirtioPciBlkDriverVirtioPciBlkDriver instance used by this call (exclusive borrow).sector u64count intbuf *raw u8bool — true or false
($&VirtioPciBlkDriver) flushpub fn (blk $&VirtioPciBlkDriver) flush() boolOperation on $&VirtioPciBlkDriver: flush buffered data.
blk $&VirtioPciBlkDriverVirtioPciBlkDriver instance used by this call (exclusive borrow).bool — true or false
($&VirtioPciBlkDriver) read_sectorpub fn (blk $&VirtioPciBlkDriver) read_sector(sector u64, buf *raw u8) boolOperation on $&VirtioPciBlkDriver: read sector.
blk $&VirtioPciBlkDriverVirtioPciBlkDriver instance used by this call (exclusive borrow).sector u64buf *raw u8bool — true or false
($&VirtioPciBlkDriver) write_sectorpub fn (blk $&VirtioPciBlkDriver) write_sector(sector u64, buf *raw u8) boolOperation on $&VirtioPciBlkDriver: write sector.
blk $&VirtioPciBlkDriverVirtioPciBlkDriver instance used by this call (exclusive borrow).sector u64buf *raw u8bool — true or false
struct VirtioNetDriverpub struct VirtioNetDriver {
pub dev VirtioDevice
pub mac0 u8
pub mac1 u8
pub mac2 u8
pub mac3 u8
pub mac4 u8
pub mac5 u8
pub queue_size u32
pub rx_avail_idx u16
pub rx_last_used u16
pub tx_avail_idx u16
pub tx_last_used u16
pub rx_desc u64
pub rx_avail u64
pub rx_used u64
pub tx_desc u64
pub tx_avail u64
pub tx_used u64
pub rx_buf u64
pub tx_hdr u64
}Structure encapsulating dev, mac0, mac1, mac2, mac3.
dev VirtioDevicemac0 u8mac1 u8mac2 u8mac3 u8mac4 u8mac5 u8queue_size u32rx_avail_idx u16rx_last_used u16tx_avail_idx u16tx_last_used u16rx_desc u64rx_avail u64rx_used u64tx_desc u64tx_avail u64tx_used u64rx_buf u64tx_hdr u64virtio_net_newpub fn virtio_net_new(base u64) VirtioNetDriverVirtio net new.
base u64VirtioNetDriver — a value of this type
($&VirtioNetDriver) initpub fn (net $&VirtioNetDriver) init() boolInitialize internal state and default parameters.
net $&VirtioNetDriverVirtioNetDriver instance used by this call (exclusive borrow).bool — true or false
($&VirtioNetDriver) init_with_dmapub fn (net $&VirtioNetDriver) init_with_dma(dma_base u64, dma_bytes u64) boolOperation on $&VirtioNetDriver: init with dma.
net $&VirtioNetDriverVirtioNetDriver instance used by this call (exclusive borrow).dma_base u64dma_bytes u64bool — true or false
($&VirtioNetDriver) send_packetpub fn (net $&VirtioNetDriver) send_packet(frame *raw u8, len int) boolOperation on $&VirtioNetDriver: send packet.
net $&VirtioNetDriverVirtioNetDriver instance used by this call (exclusive borrow).frame *raw u8len intbool — true or false
($&VirtioNetDriver) recv_packetpub fn (net $&VirtioNetDriver) recv_packet(out_buf *raw u8, max_len int) intOperation on $&VirtioNetDriver: recv packet.
net $&VirtioNetDriverVirtioNetDriver instance used by this call (exclusive borrow).out_buf *raw u8max_len intint — a value of this type
struct VirtioPciNetDriverpub struct VirtioPciNetDriver {
pub pci_dev u8
pub mac0 u8
pub mac1 u8
pub mac2 u8
pub mac3 u8
pub mac4 u8
pub mac5 u8
pub pad0 u8
pub rx_queue_size u32
pub tx_queue_size u32
pub rx_avail_idx u16
pub rx_last_used u16
pub tx_avail_idx u16
pub tx_last_used u16
pub rx_desc u64
pub rx_avail u64
pub rx_used u64
pub tx_desc u64
pub tx_avail u64
pub tx_used u64
pub rx_buf u64
pub tx_buf u64
pub common_cfg u64
pub rx_notify_addr u64
pub tx_notify_addr u64
pub isr_addr u64
pub device_cfg u64
}Structure encapsulating pci_dev, mac0, mac1, mac2, mac3.
pci_dev u8mac0 u8mac1 u8mac2 u8mac3 u8mac4 u8mac5 u8pad0 u8rx_queue_size u32tx_queue_size u32rx_avail_idx u16rx_last_used u16tx_avail_idx u16tx_last_used u16rx_desc u64rx_avail u64rx_used u64tx_desc u64tx_avail u64tx_used u64rx_buf u64tx_buf u64common_cfg u64rx_notify_addr u64tx_notify_addr u64isr_addr u64device_cfg u64virtio_pci_net_newpub fn virtio_pci_net_new() VirtioPciNetDriverVirtio pci net new.
No arguments are required.
VirtioPciNetDriver — a value of this type
($&VirtioPciNetDriver) init_pci_modernpub fn (net $&VirtioPciNetDriver) init_pci_modern(caps *raw VirtioPciModernCaps, dma_base u64, dma_bytes u64) boolOperation on $&VirtioPciNetDriver: init pci modern.
net $&VirtioPciNetDriverVirtioPciNetDriver instance used by this call (exclusive borrow).caps *raw VirtioPciModernCapsdma_base u64dma_bytes u64bool — true or false
($&VirtioPciNetDriver) send_packetpub fn (net $&VirtioPciNetDriver) send_packet(frame *raw u8, len int) boolOperation on $&VirtioPciNetDriver: send packet.
net $&VirtioPciNetDriverVirtioPciNetDriver instance used by this call (exclusive borrow).frame *raw u8len intbool — true or false
($&VirtioPciNetDriver) recv_packetpub fn (net $&VirtioPciNetDriver) recv_packet(out_buf *raw u8, max_len int) intOperation on $&VirtioPciNetDriver: recv packet.
net $&VirtioPciNetDriverVirtioPciNetDriver instance used by this call (exclusive borrow).out_buf *raw u8max_len intint — a value of this type
struct VirtioMmioRngDriverpub struct VirtioMmioRngDriver {
pub dev VirtioDevice
pub queue_size u32
pub avail_idx u16
pub last_used_idx u16
pub desc_addr u64
pub avail_addr u64
pub used_addr u64
pub buf_addr u64
}Structure encapsulating dev, queue_size, avail_idx, last_used_idx, desc_addr.
dev VirtioDevicequeue_size u32avail_idx u16last_used_idx u16desc_addr u64avail_addr u64used_addr u64buf_addr u64virtio_rng_newpub fn virtio_rng_new(base u64) VirtioMmioRngDriverVirtio rng new.
base u64VirtioMmioRngDriver — a value of this type
($&VirtioMmioRngDriver) init_with_dmapub fn (rng $&VirtioMmioRngDriver) init_with_dma(dma_base u64, dma_bytes u64) boolOperation on $&VirtioMmioRngDriver: init with dma.
rng $&VirtioMmioRngDriverVirtioMmioRngDriver instance used by this call (exclusive borrow).dma_base u64dma_bytes u64bool — true or false
($&VirtioMmioRngDriver) read_bytespub fn (rng $&VirtioMmioRngDriver) read_bytes(out_buf *raw u8, len int) intOperation on $&VirtioMmioRngDriver: read through delim (inclusive).
rng $&VirtioMmioRngDriverVirtioMmioRngDriver instance used by this call (exclusive borrow).out_buf *raw u8len intint — a value of this type
struct VirtioPciRngDriverpub struct VirtioPciRngDriver {
pub pci_dev u8
pub pad0 u8
pub pad1 u16
pub queue_size u32
pub avail_idx u16
pub last_used_idx u16
pub desc_addr u64
pub avail_addr u64
pub used_addr u64
pub buf_addr u64
pub common_cfg u64
pub notify_addr u64
pub isr_addr u64
}Structure encapsulating pci_dev, pad0, pad1, queue_size, avail_idx.
pci_dev u8pad0 u8pad1 u16queue_size u32avail_idx u16last_used_idx u16desc_addr u64avail_addr u64used_addr u64buf_addr u64common_cfg u64notify_addr u64isr_addr u64virtio_pci_rng_newpub fn virtio_pci_rng_new() VirtioPciRngDriverVirtio pci rng new.
No arguments are required.
VirtioPciRngDriver — a value of this type
($&VirtioPciRngDriver) init_pci_modernpub fn (rng $&VirtioPciRngDriver) init_pci_modern(caps *raw VirtioPciModernCaps, dma_base u64, dma_bytes u64) boolOperation on $&VirtioPciRngDriver: init pci modern.
rng $&VirtioPciRngDriverVirtioPciRngDriver instance used by this call (exclusive borrow).caps *raw VirtioPciModernCapsdma_base u64dma_bytes u64bool — true or false
($&VirtioPciRngDriver) read_bytespub fn (rng $&VirtioPciRngDriver) read_bytes(out_buf *raw u8, len int) intOperation on $&VirtioPciRngDriver: read through delim (inclusive).
rng $&VirtioPciRngDriverVirtioPciRngDriver instance used by this call (exclusive borrow).out_buf *raw u8len intint — a value of this type
struct VirtioPciGpuDriverpub struct VirtioPciGpuDriver {
pub pci_dev u8
pub pad0 u8
pub pad1 u16
pub queue_size u32
pub avail_idx u16
pub last_used_idx u16
pub desc_addr u64
pub avail_addr u64
pub used_addr u64
pub req_addr u64
pub resp_addr u64
pub common_cfg u64
pub notify_addr u64
pub isr_addr u64
}Structure encapsulating pci_dev, pad0, pad1, queue_size, avail_idx.
pci_dev u8pad0 u8pad1 u16queue_size u32avail_idx u16last_used_idx u16desc_addr u64avail_addr u64used_addr u64req_addr u64resp_addr u64common_cfg u64notify_addr u64isr_addr u64virtio_pci_gpu_newpub fn virtio_pci_gpu_new() VirtioPciGpuDriverVirtio pci gpu new.
No arguments are required.
VirtioPciGpuDriver — a value of this type
($&VirtioPciGpuDriver) init_pci_modernpub fn (gpu $&VirtioPciGpuDriver) init_pci_modern(caps *raw VirtioPciModernCaps, dma_base u64, dma_bytes u64) boolOperation on $&VirtioPciGpuDriver: init pci modern.
gpu $&VirtioPciGpuDriverVirtioPciGpuDriver instance used by this call (exclusive borrow).caps *raw VirtioPciModernCapsdma_base u64dma_bytes u64bool — true or false
($&VirtioPciGpuDriver) send_ctrl_cmdpub fn (gpu $&VirtioPciGpuDriver) send_ctrl_cmd(req *raw u8, req_len int, resp *raw u8, resp_len int) boolOperation on $&VirtioPciGpuDriver: send ctrl cmd.
gpu $&VirtioPciGpuDriverVirtioPciGpuDriver instance used by this call (exclusive borrow).req *raw u8req_len intresp *raw u8resp_len intbool — true or false
($&VirtioPciGpuDriver) get_display_infopub fn (gpu $&VirtioPciGpuDriver) get_display_info(out_w *raw u32, out_h *raw u32) boolOperation on $&VirtioPciGpuDriver: read display info.
gpu $&VirtioPciGpuDriverVirtioPciGpuDriver instance used by this call (exclusive borrow).out_w *raw u32out_h *raw u32bool — true or false
($&VirtioPciGpuDriver) create_2d_resourcepub fn (gpu $&VirtioPciGpuDriver) create_2d_resource(res_id u32, fmt u32, w u32, h u32) boolOperation on $&VirtioPciGpuDriver: create 2d resource.
gpu $&VirtioPciGpuDriverVirtioPciGpuDriver instance used by this call (exclusive borrow).res_id u32fmt u32w u32h u32bool — true or false
($&VirtioPciGpuDriver) attach_backingpub fn (gpu $&VirtioPciGpuDriver) attach_backing(res_id u32, phys_addr u64, byte_len u32) boolOperation on $&VirtioPciGpuDriver: attach backing.
gpu $&VirtioPciGpuDriverVirtioPciGpuDriver instance used by this call (exclusive borrow).res_id u32phys_addr u64byte_len u32bool — true or false
($&VirtioPciGpuDriver) set_scanoutpub fn (gpu $&VirtioPciGpuDriver) set_scanout(scanout_id u32, res_id u32, w u32, h u32) boolOperation on $&VirtioPciGpuDriver: set scanout.
gpu $&VirtioPciGpuDriverVirtioPciGpuDriver instance used by this call (exclusive borrow).scanout_id u32res_id u32w u32h u32bool — true or false
($&VirtioPciGpuDriver) transfer_to_host_2dpub fn (gpu $&VirtioPciGpuDriver) transfer_to_host_2d(res_id u32, w u32, h u32) boolOperation on $&VirtioPciGpuDriver: transfer to host 2d.
gpu $&VirtioPciGpuDriverVirtioPciGpuDriver instance used by this call (exclusive borrow).res_id u32w u32h u32bool — true or false
($&VirtioPciGpuDriver) flush_resourcepub fn (gpu $&VirtioPciGpuDriver) flush_resource(res_id u32, w u32, h u32) boolOperation on $&VirtioPciGpuDriver: flush resource.
gpu $&VirtioPciGpuDriverVirtioPciGpuDriver instance used by this call (exclusive borrow).res_id u32w u32h u32bool — true or false