#include <metal/device.h>
#include <openamp/virtio.h>
#include <openamp/virtqueue.h>
Go to the source code of this file.
|
| void | virtio_mmio_register_device (struct virtio_device *vdev, int vq_num, struct virtqueue **vqs) |
| | Register a VIRTIO device with the VIRTIO stack. More...
|
| |
| struct virtqueue * | virtio_mmio_setup_virtqueue (struct virtio_device *vdev, unsigned int idx, struct virtqueue *vq, void(*cb)(void *), void *cb_arg, const char *vq_name) |
| | Setup a virtqueue structure. More...
|
| |
| int | virtio_mmio_device_init (struct virtio_mmio_device *vmdev, uintptr_t virt_mem_ptr, uintptr_t cfg_mem_ptr, void *user_data) |
| | VIRTIO MMIO device initialization. More...
|
| |
| void | virtio_mmio_isr (struct virtio_device *vdev) |
| | VIRTIO MMIO interrupt service routine. More...
|
| |
◆ VIRTIO_MMIO_CONFIG
| #define VIRTIO_MMIO_CONFIG 0x100 |
◆ VIRTIO_MMIO_CONFIG_GENERATION
| #define VIRTIO_MMIO_CONFIG_GENERATION 0x0fc |
◆ VIRTIO_MMIO_DEVICE_FEATURES
| #define VIRTIO_MMIO_DEVICE_FEATURES 0x010 |
◆ VIRTIO_MMIO_DEVICE_FEATURES_SEL
| #define VIRTIO_MMIO_DEVICE_FEATURES_SEL 0x014 |
◆ VIRTIO_MMIO_DEVICE_ID
| #define VIRTIO_MMIO_DEVICE_ID 0x008 |
◆ VIRTIO_MMIO_DRIVER_FEATURES
| #define VIRTIO_MMIO_DRIVER_FEATURES 0x020 |
◆ VIRTIO_MMIO_DRIVER_FEATURES_SEL
| #define VIRTIO_MMIO_DRIVER_FEATURES_SEL 0x024 |
◆ VIRTIO_MMIO_GUEST_PAGE_SIZE
| #define VIRTIO_MMIO_GUEST_PAGE_SIZE 0x028 |
◆ VIRTIO_MMIO_INT_CONFIG
| #define VIRTIO_MMIO_INT_CONFIG (1 << 1) |
◆ VIRTIO_MMIO_INT_VRING
| #define VIRTIO_MMIO_INT_VRING (1 << 0) |
◆ VIRTIO_MMIO_INTERRUPT_ACK
| #define VIRTIO_MMIO_INTERRUPT_ACK 0x064 |
◆ VIRTIO_MMIO_INTERRUPT_STATUS
| #define VIRTIO_MMIO_INTERRUPT_STATUS 0x060 |
◆ VIRTIO_MMIO_LEGACY
| #define VIRTIO_MMIO_LEGACY |
◆ VIRTIO_MMIO_MAGIC_VALUE
| #define VIRTIO_MMIO_MAGIC_VALUE 0x000 |
◆ VIRTIO_MMIO_MAGIC_VALUE_STRING
| #define VIRTIO_MMIO_MAGIC_VALUE_STRING ('v' | ('i' << 8) | ('r' << 16) | ('t' << 24)) |
◆ VIRTIO_MMIO_MAX_DATA_SIZE
| #define VIRTIO_MMIO_MAX_DATA_SIZE 128 |
◆ VIRTIO_MMIO_QUEUE_ALIGN
| #define VIRTIO_MMIO_QUEUE_ALIGN 0x03c |
◆ VIRTIO_MMIO_QUEUE_AVAIL_HIGH
| #define VIRTIO_MMIO_QUEUE_AVAIL_HIGH 0x094 |
◆ VIRTIO_MMIO_QUEUE_AVAIL_LOW
| #define VIRTIO_MMIO_QUEUE_AVAIL_LOW 0x090 |
◆ VIRTIO_MMIO_QUEUE_DESC_HIGH
| #define VIRTIO_MMIO_QUEUE_DESC_HIGH 0x084 |
◆ VIRTIO_MMIO_QUEUE_DESC_LOW
| #define VIRTIO_MMIO_QUEUE_DESC_LOW 0x080 |
◆ VIRTIO_MMIO_QUEUE_NOTIFY
| #define VIRTIO_MMIO_QUEUE_NOTIFY 0x050 |
◆ VIRTIO_MMIO_QUEUE_NUM
| #define VIRTIO_MMIO_QUEUE_NUM 0x038 |
◆ VIRTIO_MMIO_QUEUE_NUM_MAX
| #define VIRTIO_MMIO_QUEUE_NUM_MAX 0x034 |
◆ VIRTIO_MMIO_QUEUE_PFN
| #define VIRTIO_MMIO_QUEUE_PFN 0x040 |
◆ VIRTIO_MMIO_QUEUE_READY
| #define VIRTIO_MMIO_QUEUE_READY 0x044 |
◆ VIRTIO_MMIO_QUEUE_SEL
| #define VIRTIO_MMIO_QUEUE_SEL 0x030 |
◆ VIRTIO_MMIO_QUEUE_USED_HIGH
| #define VIRTIO_MMIO_QUEUE_USED_HIGH 0x0a4 |
◆ VIRTIO_MMIO_QUEUE_USED_LOW
| #define VIRTIO_MMIO_QUEUE_USED_LOW 0x0a0 |
◆ VIRTIO_MMIO_SHM_BASE_HIGH
| #define VIRTIO_MMIO_SHM_BASE_HIGH 0x0bc |
◆ VIRTIO_MMIO_SHM_BASE_LOW
| #define VIRTIO_MMIO_SHM_BASE_LOW 0x0b8 |
◆ VIRTIO_MMIO_SHM_LEN_HIGH
| #define VIRTIO_MMIO_SHM_LEN_HIGH 0x0b4 |
◆ VIRTIO_MMIO_SHM_LEN_LOW
| #define VIRTIO_MMIO_SHM_LEN_LOW 0x0b0 |
◆ VIRTIO_MMIO_SHM_SEL
| #define VIRTIO_MMIO_SHM_SEL 0x0ac |
◆ VIRTIO_MMIO_STATUS
| #define VIRTIO_MMIO_STATUS 0x070 |
◆ VIRTIO_MMIO_VENDOR_ID
| #define VIRTIO_MMIO_VENDOR_ID 0x00c |
◆ VIRTIO_MMIO_VERSION
| #define VIRTIO_MMIO_VERSION 0x004 |
◆ virtio_mmio_device_init()
| int virtio_mmio_device_init |
( |
struct virtio_mmio_device * |
vmdev, |
|
|
uintptr_t |
virt_mem_ptr, |
|
|
uintptr_t |
cfg_mem_ptr, |
|
|
void * |
user_data |
|
) |
| |
VIRTIO MMIO device initialization.
- Parameters
-
| vmdev | Pointer to virtio_mmio_device structure. |
| virt_mem_ptr | Guest virtio (shared) memory base address (virtual). |
| cfg_mem_ptr | Virtio device configuration memory base address (virtual). |
| user_data | Pointer to custom user data. |
- Returns
- int 0 for success.
◆ virtio_mmio_isr()
VIRTIO MMIO interrupt service routine.
- Parameters
-
◆ virtio_mmio_register_device()
Register a VIRTIO device with the VIRTIO stack.
- Parameters
-
| vdev | Pointer to device structure. |
| vq_num | Number of virtqueues the device uses. |
| vqs | Array of pointers to vthe virtqueues used by the device. |
◆ virtio_mmio_setup_virtqueue()
| struct virtqueue* virtio_mmio_setup_virtqueue |
( |
struct virtio_device * |
vdev, |
|
|
unsigned int |
idx, |
|
|
struct virtqueue * |
vq, |
|
|
void(*)(void *) |
cb, |
|
|
void * |
cb_arg, |
|
|
const char * |
vq_name |
|
) |
| |
Setup a virtqueue structure.
- Parameters
-
| vdev | Pointer to device structure. |
| idx | Index of the virtqueue. |
| vq | Pointer to virtqueue structure. |
| cb | Pointer to virtqueue callback. Can be NULL. |
| cb_arg | Argument for the virtqueue callback. |
| vq_name | Name of the virtqueue. |
- Returns
- pointer to virtqueue structure.