1#ifndef _DRIVERS_VIRTIO_VIRTIO_PCI_COMMON_H
2#define _DRIVERS_VIRTIO_VIRTIO_PCI_COMMON_H
38#define ioread8(vdev, addr) \
39 vdev->system->vdev_read_byte((ULONG_PTR)(addr))
40#define ioread16(vdev, addr) \
41 vdev->system->vdev_read_word((ULONG_PTR)(addr))
42#define ioread32(vdev, addr) \
43 vdev->system->vdev_read_dword((ULONG_PTR)(addr))
44#define iowrite8(vdev, val, addr) \
45 vdev->system->vdev_write_byte((ULONG_PTR)(addr), val)
46#define iowrite16(vdev, val, addr) \
47 vdev->system->vdev_write_word((ULONG_PTR)(addr), val)
48#define iowrite32(vdev, val, addr) \
49 vdev->system->vdev_write_dword((ULONG_PTR)(addr), val)
50#define iowrite64_twopart(vdev, val, lo_addr, hi_addr) \
51 vdev->system->vdev_write_dword((ULONG_PTR)(lo_addr), (u32)(val)); \
52 vdev->system->vdev_write_dword((ULONG_PTR)(hi_addr), (val) >> 32)
54#define mem_alloc_contiguous_pages(vdev, size) \
55 vdev->system->mem_alloc_contiguous_pages(vdev->DeviceContext, size)
56#define mem_free_contiguous_pages(vdev, virt) \
57 vdev->system->mem_free_contiguous_pages(vdev->DeviceContext, virt)
58#define mem_get_physical_address(vdev, virt) \
59 vdev->system->mem_get_physical_address(vdev->DeviceContext, virt)
60#define mem_alloc_nonpaged_block(vdev, size) \
61 vdev->system->mem_alloc_nonpaged_block(vdev->DeviceContext, size)
62#define mem_free_nonpaged_block(vdev, addr) \
63 vdev->system->mem_free_nonpaged_block(vdev->DeviceContext, addr)
65#define pci_read_config_byte(vdev, where, bVal) \
66 vdev->system->pci_read_config_byte(vdev->DeviceContext, where, bVal)
67#define pci_read_config_word(vdev, where, wVal) \
68 vdev->system->pci_read_config_word(vdev->DeviceContext, where, wVal)
69#define pci_read_config_dword(vdev, where, dwVal) \
70 vdev->system->pci_read_config_dword(vdev->DeviceContext, where, dwVal)
72#define pci_get_resource_len(vdev, bar) \
73 vdev->system->pci_get_resource_len(vdev->DeviceContext, bar)
74#define pci_map_address_range(vdev, bar, offset, maxlen) \
75 vdev->system->pci_map_address_range(vdev->DeviceContext, bar, offset, maxlen)
77#define vdev_get_msix_vector(vdev, queue) \
78 vdev->system->vdev_get_msix_vector(vdev->DeviceContext, queue)
79#define vdev_sleep(vdev, msecs) \
80 vdev->system->vdev_sleep(vdev->DeviceContext, msecs)
NTSTATUS vio_modern_initialize(VirtIODevice *vdev)
void vp_notify(struct virtqueue *vq)
NTSTATUS vio_legacy_initialize(VirtIODevice *vdev)